Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-19-2007, 06:50 PM   PM User | #1
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
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
losse is offline   Reply With Quote
Old 03-19-2007, 06:55 PM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 07:16 PM   PM User | #3
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
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?
losse is offline   Reply With Quote
Old 03-19-2007, 07:25 PM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 07:50 PM   PM User | #5
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
I just did... didn't help much. Thanks for looking
losse is offline   Reply With Quote
Old 03-19-2007, 07:52 PM   PM User | #6
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Quote:
Originally Posted by losse View Post
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 08:12 PM   PM User | #7
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
Yes... this one?

my_mc.slideTo(x,y, seconds, animtype, delay, callback, extra1, extra2);

where would the alpha component come in?
losse is offline   Reply With Quote
Old 03-19-2007, 08:15 PM   PM User | #8
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 08:19 PM   PM User | #9
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
Pardon my ignorance... I'm not that savvy in actionscript... No idea where to start
losse is offline   Reply With Quote
Old 03-19-2007, 08:36 PM   PM User | #10
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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..
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 08:55 PM   PM User | #11
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
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);
losse is offline   Reply With Quote
Old 03-19-2007, 09:10 PM   PM User | #12
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 09:15 PM   PM User | #13
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
yes I am... The move is fading in, then out while moving from top to bottom...
losse is offline   Reply With Quote
Old 03-19-2007, 09:18 PM   PM User | #14
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 03-19-2007, 09:21 PM   PM User | #15
losse
Regular Coder

 
Join Date: Mar 2005
Posts: 240
Thanks: 1
Thanked 0 Times in 0 Posts
losse is an unknown quantity at this point
ok... By the way... do I need to put anything before or after that? I tried your previous suggestion and nothing happened!?
losse is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:55 PM.


Advertisement
Log in to turn off these ads.