im creating a game in which once the user presses space bar it calls the following code:
I want this code to be called only once. However, the point of the game is to have keep something afloat by pressing the spacebar many many times a session. How do i make it so this section of code is only called once, instead of every time the user presses the spacebar.Code:on(keyPress "<Space>"){ _root.top1.play(); _root.bottom1.play(); totalNum=200; // custom actions begin _root.count = _root.count+1; if (_root.count <= totalNum) { duplicateMovieClip("_root.clip", "clip"+_root.count,_root.count); _root["clip"+_root.count]._y = random(350)+50; } // custom actions end }
Thank you






Bookmarks