Need help with on/off buttons

I want to make a set of buttons, on and off, which will cause the animation shown here to be stoped and resumed. Can anyone provide the proper actionscript for each of the buttons?

like:


on (release){
movieClip.stop();
//replace movieClip with your mc name.
}

and


on (release){
movieClip.play();
}

try something like that.

it doesn’t work, i even tried _root.circle.play(); &
_root.circle.stop(); and it still doesn’t work, any other ideas?

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31875

Hi,
Did you solve your problem from the thread that Voetsjoeba posted for you ?

If not, tell me, do you want each button to be on & off or do you want an ON and OFF button for each ani ?

Cheers

SteveD

Hi,
Did you solve your problem from the thread that Voetsjoeba posted for you ?

If not, tell me, do you want each button to be on & off or do you want an ON and OFF button for each ani ?

Cheers

SteveD

No unfortunatly the problem still continues. If you can help, i want 2 seperate buttons, one to stop the animation (off) and one to start the animation (on) The animation is set by default to start automatically when you enter a specific frame.

Thx :stuck_out_tongue:

Maybe this helps

Hi,
Nice one Claudio, my version does the same, tho’ I have stuck to basic button actions, therefore more lines of code.

between the 2 files Sauce2k you should solve your prob. Any Q’s post again

SteveD

Hi,
Nice one Claudio, my version does the same, tho’ I have stuck to basic button actions, therefore more lines of code.

between the 2 files Sauce2k you should solve your prob. Any Q’s post again

SteveD

Your fla’s, although nicely scripted, only work for tweened animations, not action scripted like the vibration effect. The stop(); command doesn’t do anything because inside the movieclip circle, there is no animation. Instead actionscript animates it, so therefore, I need and on and off button, which sets a certain x and y position of the circle to keep it from moving. If you can help me in doing this, that would be great :smirk:

hmm well what effect are you trying to do? if you want it to stop scripted animations try a boolean…

in the first frame declare var play = true;

put your whole actionscrip thing in an if statement saying

if(_root.play)
{
a/s…
}

then in your buttons change play to true for on and to false for off…

since you declared it in the frame use _root.play = true; or _root.play = false;

in your if statement use if(_root.play) for the same reason

should work

hmm well what effect are you trying to do?

As i said in my first post, i am using the vibration effect :esmirk:

Could you make an fla with the vibration effect and the buttons by any chance?

here ya go

thx dude :beam:

Well, why can’t you just make the buttons inside the movieClip? This way when the stop button is pressed, its stops the movie, and when the play button is pressed it plays. Or you could make 2 keyframes, 1 with the thingies there and one without. [Play] gotoandStops at 1. [Stop] gotoandStops at 2. :smirk:

[swf=http://www.geocities.com/claudiodj/vibrate.swf][/swf]

And this would be the fla :wink:

lol i forgot to attach the fla :trout:
though voetsjoeba already posted, ill place my fla in case any1 wants to check

lol i thought my way had solved the problem :wink:

nice claudio, scootman, thx for the fla, it solved the problem :thumb:

Welcome :slight_smile: