00:00
00:00
Newgrounds Background Image Theme

RobotHeadProductions just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Question on looping animation.

328 Views | 2 Replies
New Topic Respond to this Topic

Question on looping animation. 2016-02-13 09:12:01


I want to have a segment of my animation loop and have a button that will stop it looping when pressed and have the animation keep playing. Is there any way this can be done?
I am using Action Script 2.0 in CS3.


At 2/13/16 09:12 AM, ALROM wrote: I want to have a segment of my animation loop and have a button that will stop it looping when pressed and have the animation keep playing. Is there any way this can be done?
I am using Action Script 2.0 in CS3.

Are you making an interactive hentai flash or something?..

Your animation segment that is going to loop is surrounded by two frames: A and B. On frame A you need to set a variable, on frame B check that variable. Now, when you click the resume button, it changes the value of the variable, so when you reach frame B it does not take you back to frame A if that variable has a different value.

frame A actions

keepLooping=true;

frame B actions

if(keepLooping==true){
gotoAndPlay(please type frame A's number of frame label here HELLO DON'T COPY PASTE CODE BLINDLY it can have stuff like this Frame label is typed inside quotation marks);
}

The resume button actions (select the button, without going inside it, and open Actions panel)

on(release){
keepLooping=false;
}

Response to Question on looping animation. 2016-02-13 12:56:43


frame A actions

keepLooping=true;

frame B actions

if(keepLooping==true){
gotoAndPlay(please type frame A's number of frame label here HELLO DON'T COPY PASTE CODE BLINDLY it can have stuff like this Frame label is typed inside quotation marks);
}

The resume button actions (select the button, without going inside it, and open Actions panel)

on(release){
keepLooping=false;
}

Thank you so much, it works perfectly!! And yeah I am making a hentai.