Enjoy an ad free experience by logging in. Not a member yet?
Register .
03-19-2007, 06:50 PM
PM User |
#1
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
Tween vs. actionscript
Hi there
I am creating a flash file that has many long tweens... With each additional tween I had (because of the image I'm tweening) the swf gets bigger and bigger... I was wondering if there is some actionscript that I could use instead of tweening to make the same effect but to minimize the file size.
All I'm doing is scrolling a series of images from up to down, side to side. The images fade in... scroll and fade out...
Thanks gang!
Losse
03-19-2007, 06:55 PM
PM User |
#2
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
This tutorial might help.
http://tutorialoutpost.com/count/6152
You'll need to install the plugin that it tells you to install.
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 07:16 PM
PM User |
#3
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks this works for the alpha part... Can this be modified to include the scrolling? For example... moving it from left to right or top to bottom?
03-19-2007, 07:25 PM
PM User |
#4
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
I don't know, did you even try reading the documentation on this page?
http://laco.wz.cz/tween/?page=download
Its at the bottom.
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 07:50 PM
PM User |
#5
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
I just did... didn't help much. Thanks for looking
03-19-2007, 07:52 PM
PM User |
#6
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
Quote:
Originally Posted by
losse
I just did... didn't help much. Thanks for looking
Then you didn't read it well enough. There is some code in there that uses slideTo which sounds like it will do what you want.
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 08:12 PM
PM User |
#7
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
Yes... this one?
my_mc.slideTo(x,y, seconds, animtype, delay, callback, extra1, extra2);
where would the alpha component come in?
03-19-2007, 08:15 PM
PM User |
#8
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
Just call each function. You can have more than one tween you know...
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 08:19 PM
PM User |
#9
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
Pardon my ignorance... I'm not that savvy in actionscript... No idea where to start
03-19-2007, 08:36 PM
PM User |
#10
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
There isn't much to it really. Read this
http://laco.wz.cz/tween/?page=docs/slideTo
Then read this to find out what the parameters are for.
http://laco.wz.cz/tween/?page=docs/tween
Here is an example of a alpha fade in.
mcinstancename._alpha = 0;
mcinstancename.alphaTo(100,3);
To get the alpha tween and the slideTo tween to work together just do this
Code:
mcinstancename._alpha = 0;
mcinstancename.alphaTo(100,3);
mcinstancename.slideTo(0,20);
setTimeout(function(){mcinstancename.slideTo(0,0)},5000);
The above fades the movie clip with instance name mcinstancename to full opacity in 3 seconds. At the same time the movie clip is moved 20 pixels down and then after 5 seconds it is moved 20 pixels backup.
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
Last edited by _Aerospace_Eng_; 03-19-2007 at 08:40 PM ..
03-19-2007, 08:55 PM
PM User |
#11
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
thanks man... I appreciate the effort...
So if I wanted to fade the movie in to full opacity in 3 seconds, then keep it at full opacity for another 3 seconds and then fade it back to 0 opacity in 3 seconds... would this be the code
Code:
mcinstancename._alpha = 0;
mcinstancename.alphaTo(100,3);
mcinstancename.slideTo(0,20);
setTimeout(function(){mcinstancename.slideTo(0,0)},{mcinstancename.alphaTo(0,3)},5000);
03-19-2007, 09:10 PM
PM User |
#12
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
Okay so you aren't wanting to move the movie then? Try this
Code:
mcinstancename._alpha = 0;
mcinstancename.alphaTo(100,3);
setTimeout(function(){mcinstancename.alphaTo(0,3)},3000);
1000 in the settimeout is 1 second.
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 09:15 PM
PM User |
#13
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
yes I am... The move is fading in, then out while moving from top to bottom...
03-19-2007, 09:18 PM
PM User |
#14
Supreme Master coder!
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
Okay tyr this
Code:
mcinstancename._alpha = 0;
mcinstancename.alphaTo(100,3);
mcinstancename.slideTo(0,20,3);
setTimeout(fadeandmove,3000);
function fadeandmove()
{
mcinstancename.alphaTo(0,3);
mcinstancename.slideTo(0,0,3);
}
__________________
|||| If you are getting paid to do a job, don't ask for help on it! ||||
03-19-2007, 09:21 PM
PM User |
#15
Regular Coder
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
ok... By the way... do I need to put anything before or after that? I tried your previous suggestion and nothing happened!?
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 03:48 AM .
Advertisement
Log in to turn off these ads.