View Full Version : Need help with on/off buttons
Sauce2k
August 21st, 2003, 10:35 AM
I want to make a set of buttons, on and off, which will cause the animation shown here (http://www.kirupa.com/developer/mx/vibrate.htm) to be stoped and resumed. Can anyone provide the proper actionscript for each of the buttons?
mdipi
August 21st, 2003, 10:50 AM
like:
on (release){
movieClip.stop();
//replace movieClip with your mc name.
}
and
on (release){
movieClip.play();
}
try something like that.
Sauce2k
August 21st, 2003, 10:55 AM
it doesn't work, i even tried _root.circle.play(); &
_root.circle.stop(); and it still doesn't work, any other ideas?
Voetsjoeba
August 21st, 2003, 11:18 AM
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=31875
SteveD
August 22nd, 2003, 01:51 PM
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
Sauce2k
August 22nd, 2003, 01:55 PM
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 :P
claudio
August 22nd, 2003, 02:10 PM
Maybe this helps
SteveD
August 22nd, 2003, 02:33 PM
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
Sauce2k
August 22nd, 2003, 03:52 PM
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:
Scootman
August 22nd, 2003, 10:47 PM
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
Sauce2k
August 22nd, 2003, 10:51 PM
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?
Scootman
August 23rd, 2003, 12:07 AM
here ya go
Sauce2k
August 23rd, 2003, 10:16 AM
thx dude :beam:
REEFˇ
August 23rd, 2003, 11:17 AM
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:
claudio
August 23rd, 2003, 12:36 PM
Voetsjoeba
August 23rd, 2003, 01:27 PM
And this would be the fla ;)
claudio
August 23rd, 2003, 01:36 PM
lol i forgot to attach the fla :trout:
though voetsjoeba already posted, ill place my fla in case any1 wants to check
Scootman
August 23rd, 2003, 04:58 PM
lol i thought my way had solved the problem ;)
Sauce2k
August 23rd, 2003, 06:34 PM
nice claudio, scootman, thx for the fla, it solved the problem :thumb:
claudio
August 23rd, 2003, 07:12 PM
Welcome :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.