my problem is that when I upload this… and test it, its not working. I also tried by removing _root. to it, but it didn’t work either. I need other .swf’s to pause and play too when its called from the main movie where the buttons are.
on those two buttons, stop() and play() are attempting to control the buttons. Try [AS]playbutton.onRelease = function() {
MovieClipName.play();
_root.pause._visible = true;
_root.playbutton._visible = false;
}
pause.onRelease = function() {
MovieClipName.play();
_root.pause._visible = true;
_root.playbutton._visible = false;
}[/AS] where MovieClipName is the on you want to pause and play.
So I tried your coding on each button and also modified the movie clips to the mc’s I want to control (play and pause). but it gave an error this time.
**Error** Scene=Scene 1, layer=Layer 23, frame=1:Line 1: Statement must appear within on handler
playbutton.onRelease = function() {
**Error** Scene=Scene 1, layer=Layer 23, frame=1:Line 1: Statement must appear within on handler
pause.onRelease = function() {
Total ActionScript Errors: 2 Reported Errors: 2
You need to put the code on a frame in the timeline that targets those two movieclips. In other words, if the buttons are sitting on the main timeline then put it on the main timeline. If those two buttons are within a movieclip then put it on a frame of the movieclip’s timeline, otherwise you’ll have to change your paths.
in other words, _root is your main timeline. It’s like starting from your C: drive and working inwards through all the folders, though in your case the folders are the movieclips. So start with _root then target a movieclip that is on the main timeline, then target the movieclip inside that movieclip, like _root.MC1.MC2 if that makes sense. (and I’m speaking in general of how to target things - yours will look different depending on your setup).
hello again, so I tried that but i think my problem is that these buttons are not on the main timeline. neither the mc. I have a separate .swf with buttons for pause and play.
I’m still a bit confused, but I did notice that you have code for a movieclip on your button symbol. When using a button symbol you put the code directly on the button and use
on(release)
When using a movieclip as a button you would put the code on the timeline somewhere, not on the symbol itself and you would address it by instance name such as
playbutton.onRelease = function()
Now, you have the same exact code on both buttons, so I’m not sure what it is you are trying to do - but at least the error messages go away when you change
well yeah i uploaded the wrong .fla :hair: but yes, i was trying to follow instructions from another helper but i realized that I do not want to play and stop mcs… so i fixed my as. take a look now please.
okay so, sorry for being confused but what is it you are trying to do with these buttons? What do you mean by “pause the whole movie?” Do you mean you want to stop all sounds, stop the menu from working, etc.? Can you be as specific as possible about what you want the buttons to do? And why? That will help us figure out the right steps.
Yes, I would like to use those buttons to pause the entire movie and to play again. the volume icon are working nicely so I don’t have to make modifications to that one. Just the pause/play button. I would like to be able to pause any .swf movies and play back again. Also, this main4.swf is not the main movie… its just another .swf that will be loaded when loading the main movie.
I hope you are following me. All I need is to be able to pause and play my movie.
not really sure why you want to pause and play? Can you explain that?
but the only way i can think of is to put all your container clips (i assume you are loading external swfs into container clips) into an array and then apply your stop() and play() actions to the array.
I don’t know but it may be possible to use _root.stop()? Never tried it though.
what I’m trying to have is a button that would allow me to pause my movie.
another button to allow to play the movie. both buttons I would prefer to be in the same place. just like I had my volume button.
:sigh: well you keep saying “my movie” but you aren’t defining it. You say you have multiple movieclips and multiple external swf files. So you aren’t really clarifying what exactly you want to pause/play. You want to hit the pause button and have the entire fla, all loaded external swfs, all sounds, all button actions, all menu items, etc etc etc stop? And then become active again when you hit play?
Or are you talking about only the currently loaded external swf?
sorry for the confusion, yes I want to hit the pause button and have the entire .fla, all loaded external swfs, all sounds, all button actions, all menu items, etc etc etc stop, then become active again when I hit play.