petermaxo -> RE: Flash Q&A thread 3 (4/5/2007 15:52:21)
|
quote:
Okay, let me explain it better. I told it to attatch the movie "playerhit" whenever the variable _global.action = "hit". on 1 frame in the movie clip "greenslimeattack", which is attached earlier, the variable _global.action = hit. when I run the movie, _global.variable != hit, no matter how many times the frame in the movie clip goes by. some more clarification, the total script is: on the scene: if(_global.back == 1){ _root.attachMovie("grassback", "back", 1,{_x:335,_y:300}) }if(_global.back == 2){ _root.attachMovie("labback1", "back", 1,{_x:335,_y:300}) }if(_global.back == 3){ _root.attachMovie("labback2", "back", 1,{_x:335,_y:300}) }if(_global.back == 4){ _root.attachMovie("riverback", "back", 1,{_x:335,_y:300}) // determines the background }if(_global.ename == "green slime"){ _root.attachMovie("greenslimeattack", "enemy", 3,{_x:400,_y:300})// determines the enemy }_root.enemy.play()// plays the enemy movie _root.onEnterFrame = function(){ if(_global.action == "hit"){ _root.attachMovie("playerhit", "player", 2, {_x:200,_y:300})// attatches the movie "playerhit" if action = "hit" }if(_global.action == "attackcomplete"){ gotoAndStop("battle") } } on the movie clip "greenslimeattack" frame 6: _global.action = "hit" Edit: is it just me, or have things been a little quiet around here? I have another problem. what code should I use to set the global variable eaction to "attack" when the movie clip enemy is within 50 pixils of the movie clip player?
|
|
|
|