I stil;l haven't been able to grasp the whole concept. I have a mc that I want to flip on a keyUp... on a keyDown I want it to flip and move... But with this code it will flip and move no matter what...
Ideas anyone?Code:keyListener = new Object(); keyListener.onKeyUp = function() { Flip(); this.onKeyDown = function() { Flip(); Move(); }; }; function Flip() { if (_root.snowman._currentframe == 1) { if (Key.getCode() == Key.RIGHT) { _root.snowman._xscale = 100; } if (Key.getCode() == Key.LEFT) { _root.snowman._xscale = -100; } } } function Move() { if (_root.snowman._currentframe == 1) { if (Key.getCode() == Key.RIGHT) { _root.snowman._xscale = 100; _root.snowman.play(); _root.snowman.x = x_movement; } if (Key.getCode() == Key.LEFT) { _root.snowman._xscale = -100; _root.snowman.play(); _root.snowman.x = -1*x_movement; } } } Key.addListener(keyListener);
Cheers!





Reply With Quote