Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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!||||

  • #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?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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!||||

  • #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

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #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?

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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!||||

  • #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

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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.
    Last edited by _Aerospace_Eng_; 03-19-2007 at 09:40 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #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);

  • #12
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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!||||

  • #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...

  • #14
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 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!||||

  • #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!?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •