ForumsProgramming ForumPlay/Pause Button

13 5233
LennonTheMage
offline
LennonTheMage
55 posts
Nomad

1. I have a movieclip(button) and when you click it it plays a song(this part already works). To play the song it goes to the 2nd frame.

2.On the second frame the play button turns into the pause button. I want it so when I click this pause button it stops the song by going back to frame one.

Right now I have the pause button as a movieclip inside the playbutton movieclip.

  • 13 Replies
LennonTheMage
offline
LennonTheMage
55 posts
Nomad

If people don't understand my question. I just need one button that when clicked it plays a song and turns into a pause button, then when the pause button is clicked it stops the song and turns into a play button.

logantheking
offline
logantheking
254 posts
Scribe

Perhaps when clicked the button both becomes invisible and the other button becomes visible as well as performing the required function?
Hope this helps.

LennonTheMage
offline
LennonTheMage
55 posts
Nomad

Yes that is a good idea, but the main problem is, I do not know what the code would be for the pause button.

On movieclip(play button):
on(release){
gotoAndStop(2);
}
(This goes to the second frame which has the music on it)

Would it just be a simple:
on(release){
gotoAndStop(1);
}

Let me try it out :/

LennonTheMage
offline
LennonTheMage
55 posts
Nomad

Nope, I just remembered why that doesn't work, I need the pause button to tell the play button to go back to frame one. I tried doing this:

on(release){
_root.playbutton(gotoAndStop(2)){
}
}

Phoenix2049
offline
Phoenix2049
3 posts
Nomad

How good does your game have to be before published?

Phoenix2049
offline
Phoenix2049
3 posts
Nomad

Because i made a game and its a beginner not sure if it'll be published

Darkroot
offline
Darkroot
2,763 posts
Peasant

It has to be pretty awesome and original before they even consider it. I would recommend you go to kongregate (they take anything) and put it there and see what people rate is as, and what comments you get. If your in the 4-5 range they you can consider AG.

LennonTheMage
offline
LennonTheMage
55 posts
Nomad

I figured it out from a guide. I learned Action Script 2.0 by myself and guides mainly so I never really learn the technicality of the codes that I write(I just use memorization).

I did learn from making this button(I was never sure on how the _root.'s worked I just knew when I had to use them). Your post helped me a bit to so thank you ^_^.

tylerjones57
offline
tylerjones57
86 posts
Nomad

Yay that is the best idea ever. I agree

Darkroot
offline
Darkroot
2,763 posts
Peasant

Yeah Lennon the "localization" of code on an object can be a pain. But you learn over time. I've personally haven't touched flash in a year so I forgot.

LennonTheMage
offline
LennonTheMage
55 posts
Nomad

Thank you This can be locked or w.e. armorgames does hahaha. :3

Showing 1-11 of 13