TwelvestoneFlash

AS3: MovieClip Rotator


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
n-gen.dk
 
2011-10-07

Halp! I'm an AS3 newbie

I'm working on my new website, but I havent worked with flash for years and I have pretty much forgotten everything. Now I want upgrade myself and learn some AS3, but its doing my head in. So the little AS2 I remember cant even be used anymore.

Basically what I cant get to work is having a rotator that fades in and out between X number of movieclips.

And I dont even know where to start. Any tutorial or help in the thread is greatly appreciated. It needs to be absolutely basic. Ie.

myClip1 Fade in -> wait ->

myClip1 Fade out, myClip2 Fade in -> wait ->

myClip2 Fade out, myClip3 Fade in -> wait ->

myClip3 Fade out, myClip1 Fade in -> etc. etc.

God Im such a code newbie :S

lithium
 
2011-10-09

You can use something like TweenMax to handle the timing / tweening. With that in mind:

import com.greensock.easing.*;
import com.greensock.*;

import flash.display.*;

var currentImage : MovieClip;
var images : Array = [ image0, image1, image2, image3, image4 ]; // Just a bunch of MovieClips. Assumes their beginning alpha value is 0

var imageIndex : int = 0;

function fadeImageIn ( image : MovieClip ) : void
{
    var delay : Number = 0;

    if ( currentImage != null ) 
    {
        TweenMax.to ( currentImage, 1, { alpha : 0 } );
        delay = 1;
    }

    currentImage = image;

    TweenMax.to ( currentImage, 1, { alpha : 1, delay : delay } );

    imageIndex++;
    if ( imageIndex > images.length - 1 ) imageIndex = 0;

    var nextImage : MovieClip = images [ imageIndex ];

    TweenMax.delayedCall ( delay + 2, fadeImageIn, [ nextImage ] );

}

fadeImageIn ( images[0] );

Hope it helps.

lith.

JLM_
 
2011-10-10

I use Pages.as, let me know if you need an example posted, or if the hx/js example checked in which can be seen here is enough photoswipe

n-gen.dk
 
2011-10-13

Thanks for the help guys, your solution looks kinda advanced for a newbie like me. But I will take a closer look this weekend and see if I have any questions to the execution.

n-gen.dk
 
2011-10-14

Ohh tween max has a lot of features. I like!

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

AS3: MovieClip Rotator