lil boi blue
Member
|
quote:
Using a Hit Test to 'goto' Another Keyframe 1) In flash draw a image that you want to be your character and convert it to a MC (movie clip) 2) Name the character guy for now in the properties inspector and give it this script----> onClipEvent (load) { moveSpeed = 19; } onClipEvent (enterFrame) { if (Key.isDown (Key.RIGHT)) { this._x += moveSpeed; } else if (Key.isDown (Key.UP)) { this._y -= moveSpeed; } else if (Key.isDown (Key.DOWN)) { this._y += moveSpeed; } else if (Key.isDown (Key.LEFT)) { this._x -= moveSpeed; } } 3) Create the object that when it is hit by the 'guy' goes to another keyframe make it a MC and give it this script----> onClipEvent (enterFrame) { if (_parent.guy.hitTest (this)) { _parent.gotoAndStop("inn"); } } for instance this hitest, a hit test is a way of saying "when my character touches this other character in any way i want him to: go to another scene change color backflip off the moon anything..... this code specifically says: this guy walks at a speed of 19, press the arrow keys to move him
whenever he touches the door (Movie clip) i want him to go to the
frame "inn" in order to get into the inn
< Message edited by lil boi blue -- 3/27/2006 21:07:29 >
|