Strike Force Heroes 2
The explosive sequel to the hit game Strike Force Heroes!
3.94 / 5.00 10,213 ViewsObsolescence
Defeat the enormous mechanical beasts--and become one of them.
4.03 / 5.00 46,432 ViewsHey guys. I haven't touched Flash in about a year and recently have been getting back into it. Decided to try and learn AS3 this time around and I am having trouble.
I've used code to stop at a certain frame in the timeline. On this frame there is a button (I do know the basics of setting up a button). What I want is that when it is clicked to have text appear on the screen and when the user finishes reading it to click an "ok" button to make the text disappear.
I figure I need an add.eventListener for the mouse click but to listen for what? Do I make the readable text a MC? Would this MC already be in place but is transparent until add.eventListener is activated?
Trying to have all of this happen on the same frame because the only way I know around this is to have to add.eventListener jump to another identical looking frame except with the text present but I don't want to do it that way.
Any help would be greatly appreciated.
Thanks in advance.
Well first things first, if you're going to relearn AS3, relearn it correctly using a class based setup, not just code on keyframes.
At 2/1/13 08:44 PM, MintPaw wrote: Well first things first, if you're going to relearn AS3, relearn it correctly using a class based setup, not just code on keyframes.
I've noticed this in other threads when I was searching for an answer to my question... Anyone care to explain what a
"class based setup" is...?
Also...I'm still looking for an answer to my question....
At 2/1/13 08:48 PM, Hero101 wrote:At 2/1/13 08:44 PM, MintPaw wrote: Well first things first, if you're going to relearn AS3, relearn it correctly using a class based setup, not just code on keyframes.I've noticed this in other threads when I was searching for an answer to my question... Anyone care to explain what a
"class based setup" is...?
What Mint meant is that instead of writing code in AS1 style on the main timeline, use what AS3 brings powerfully to you, the object-oriented programming, create a class for you button, learn how to deal with document classes etc.
Diki made a tutorial for AS3: Main about that.
At 2/1/13 08:48 PM, Hero101 wrote:At 2/1/13 08:44 PM, MintPaw wrote: Well first things first, if you're going to relearn AS3, relearn it correctly using a class based setup, not just code on keyframes.I've noticed this in other threads when I was searching for an answer to my question... Anyone care to explain what a
"class based setup" is...?
Also...I'm still looking for an answer to my question....
Check out FlashDevelop. It's free and it makes you code with classes. A class is basically the blueprint for a thing, telling it what its properties and methods are; MovieClip is a class, it has x, y, rotation, etc properties. Egg's guide is helpful for getting started.
To answer your question, use a mouseclick event listener to add and removechild a textfield.
Look no further: http://msghero.newgrounds.com/
Thank you guys for your input! I'm very grateful for the advice and the links to the tutorials!
To transition from frame script to classes, look at this:
http://www.untoldentertainment.com/blog/2009/08/25/tutorial-
understanding-classes-in-as3-part-1/
make sure to read the other parts as well