View Full Version : Stopping Timer and Assigning Actions on Button Release
Coconut99 05-05-2003, 02:10 AM I've been messing around with building simple games with Flash MX this weekend. Amazingly (:D), most things have worked, but I have a few questions. (The game is here (http://www.laughingotter.net/ja/game.swf) and the FLA file is here (http://www.laughingotter.net/ja/game.fla).) Does anyone know or is there a way to assign actions to a movie clip when a button is released? I have a start button on my game which starts a timer, but before the button is pressed the character can be moved around with the arrow keys. I want the character to be able to move only AFTER the button is pressed, not before. Second question: I've gotten my collision detection to work, but after the character hits the treasure (the object of the game), the timer keeps on going. How do you make it stop? Thanks in advance! I really need help... :blush:
Coconut99 05-05-2003, 02:26 AM Grrr... It timed out on me so I can't edit the above message. Anyway, I have a few more questions: How do you set boundaries? I don't want the character to be able to move off of the stage. I thought I knew what to do, but what I tried didn't work. Also, once the character reaches the treasure, how do you go to a new frame that says, "You Win!" or something like that? Again, I thought I knew what to do but it didn't work. The screen started shaking when I made a new keyframe and assigned the go to frame action to the treasure movie clip. I am so confused!
Arc Angel 05-05-2003, 02:36 AM Ohh. This is complicated! :D No wonder your confused. I'll see what I can do, although it may take awhile. So please be patient. Unless Marianne come up with it before I do. ;)
-Arc
Arc Angel 05-05-2003, 02:48 AM Well for some reason I can't view your code. What version of Flash do you have. So I'll do my best. Lets see. Your first one now, since it's somewhat easier than the other so I'll answer it first. hehe. For the movie clip, I don't know how to assign actions but you can create the movie clip then add something like this:
on (release)
{
loadMovie( YourMovie, target, method);
}
That should Load the movie clip into the frame. Or will that not work? Or you could have it so the user presses the button on frame 1 which takes them to the movie clip on frame2?
I'll see about the other ones. *calls Marianne* :D
-Arc
Marianne 05-05-2003, 07:20 AM I don't have MX, I have 5, unfortunately, so I can't view the fla I think, but this really is complicated stuff.
When I make games I use www.actionscript.org a lot. I don't mean to lure you away from this forum, but here I'm supposed to be the "expert" while actionscript has erm.. more advanced experts, and a whole lot of them. So far I've always been able to find everything I needed there.
Arc Angel 05-05-2003, 05:57 PM Originally posted by Marianne
I don't have MX, I have 5, unfortunately, so I can't view the fla I think, but this really is complicated stuff.
When I make games I use www.actionscript.org a lot. I don't mean to lure you away from this forum, but here I'm supposed to be the "expert" while actionscript has erm.. more advanced experts, and a whole lot of them. So far I've always been able to find everything I needed there.
hehe. Now I don't feel so bad.:D
Coconut99 05-05-2003, 10:45 PM Thanks for trying to help! I should have told you I use MX. Sorry! I will try using the actionscript you showed me, Arc, and I will check out the actionscript forums, too.
|