I am trying to set up a code that will make a MovieClip visible = false when you press the spacebar then reapear when you hit the spacebar again.
I had it working once but I lost the code somehow … think I deleted the wrong file. Anyway … the one time I got it to work I used a keylistener and stuck the code in the action panel on the timeline at frame 1.
I thought maybe there is a way to do the same thing but instead of the frame 1 action panel thing. I thought you might be able to set it up in a movieclip class action script file.
I did these tutorials on the kongregate site … shootorials and they teach you how to make a MC move with the arrow keys … which was easy … they had you make a ship into a movie clip then you created a new AS class file for the ship movie clip. Then they placed the code under the function onEnterFrame() in the ship class AS file which works well when you want to move something … because it checks every frame.
I can set up what I want in that area just fine … problem is it fires off every frame … so my movie clip blinks on and off several times everytime I hit the spacebar. I just want it to disapear when you hit the spacebar then become visible again when you hit the spacebar again.
Seems like this should be a very easy thing to do but I spent all day reading through tutorials and searching google … everything I tried all I did was run into one error or another when I tried to compile for a test.
I am very new to all this so the other thing that confuses me is the fact that you can put code in so many different places and depending on where it goes the same thing might be written a different way depending on where you write it.
I am using adobe cs4 flash 10 as2.