couldnt you just use 2 methods in your class to control the sequence of tweens?

// Start a tween for a photo
private function tweenPhoto()
{
    var animPhotoX:Tween = new Tween (photoStrip[currentIndex], "_xscale",
                               Bounce.easeOut, 100, 120, 0.5, true);
    var animPhotoY:Tween= new Tween (photoStrip[currentIndex], "_yscale",
                               Bounce.easeOut, 100, 120, 0.5, true);

    // Get the tween to call us back when its finished
    animPhotoY.onMotionFinished = Delegate.create(this,tweenFinished);
}

// Tween finished
private function tweenFinished()
{
    currentIndex++;

    if(currentIndex == numberOfPhotos)
    {
       // The sequence is complete
       // do something, dispatch an event, call a method etc.. :)
    }
    else
    {
        startTween(currentIndex);
    }
}

Then to start the whole show just make sure currentIndex and numberOfPhotos are setup correctly and call tweenPhoto();

e.g.

private function createPhotos(photolist:Array)
{
    // photo creation stuff here

    currentIndex = 0;
    numberOfPhotos = photolist.length;
    tweenPhoto();
}

no need for intervals or anything fancy.

hope thats what you mean.

Martin


jcarlos wrote:
Hi All,

I need some ideas how to workaround the following situation

I have na mc as an holder for some photoStrip >>>> this photoStrip has n photos as mcs in it >>>> I want to produce some tween over each one BUT the next tween should only begin after the previous has finished

as I don´t know how many photos are ther and as I´m using DepthManager class to to set up the photos into the PhotoStrip

I begin using for in to trasverse the strip but I´m stucked here with some clever idea about how to chain these tweens, any help,please ?

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to