Hi Everyone,
I been trying to create a gallery in Flash with different movie clips.
Timeline
-back button
-next button
-stop button
-play button
-Main Movie
(these are inside Main Movie)
--Animation 1
--Animation 2
--Animation 3
I have the animations set up in Main Movie with instance name and frame names like "Animation 1". I got it to play and stop, but I can't go back and forth through each animations with the back and next buttons. What's the right way I can pull this off?
---Update 8-20-2010
I got it to work, but with a tiny bug. Whenever I click the next or back buttons it goes to the first frame name then the other. I did a trace and I found it counting "ad-1, ad-2, ad-3, etc.." or "ad1, ad2, ad3, etc.."
var currentAnimationIndex:int;
var currentAnimation:int;
var animeOstart:Number = 1;
var animeOend:Number = 3;
function playAnimation(frameIndex:int):void
{
var frameName:String = "ad" + frameIndex.toString();
trace(frameName)
ads.gotoAndPlay(frameName);
ads.movie.gotoAndPlay(1);
currentAnimationIndex = frameIndex;
}
function playBack(event:MouseEvent):void
{
--currentAnimationIndex;
if(currentAnimationIndex < animeOstart)
currentAnimation == 1;
playAnimation(currentAnimationIndex);
}
function playNext(event:MouseEvent):void
{
++currentAnimationIndex;
if(currentAnimationIndex > animeOend)
currentAnimation == 3;
playAnimation(currentAnimationIndex);
}