-
Aircraft shot (please help)
Hello folks,
I´ve got a little problem with this script:
onClipEvent(enterFrame){
while (Key.isDown(Key.SPACE) && _currentframe == 1) {
gotoAndPlay("fire");
}
}
Well, the shot works for a while...
What can i do for?
-
not a free man
I'm not an expert on this, but are you sure you need to use while? As the goto can only happen once in the script, wouldn't if work better?
-
Right! that "while" was there by nothing...in fact, it´s becouse i was trying something else before...sorry...
onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE) && _currentframe == 1) {
gotoAndPlay("fire");
}
}
So...i discovery something else...the shot just stop when i press the SPACE to quick...
-
Originally posted by methark
So...i discovery something else...the shot just stop when i press the SPACE to quick...
That was bad!
I´ve discovered something else...(i´s that right?)
-
It stops shooting, because each time when you press the SPACE key the movie clip jumps to specific frame (named "fire"). Hence, the animation doesn't have time to finish before you hit the SPACE key again.
You should investigate other methods of firing...
Good luck
-
Simple
Well folks...
My solution was simple and nice... The code are not so different of the firt...was just a case to ajust the lines...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|