dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: I need a script that does 2 things and then it goes to another frame

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    115
    Right, I need a script where you use the keyboard to move a movie clip (I already know that part) and..
    1, If a collision is detected between it and another movie clip
    AND
    2, The user pressess space

    It then goes to another frame in the movie? eg.) The user moves a circle with the keyboard to hit a square, then the user press space and the movie goes to another frame but it will work if the object is touching the other object.

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    44

    Unhappy

    Maybe this...
    according to Your example:
    Code:
    onClipEvent (keyDown) {
    	if (circle.hitTest(square) && Key.isDown(Key.SPACE)){
    	gotoAndPlay(frame_number);
    	}
    }
    or You can use enterFrame event instead of keyDown.
    Any questions? Write !

    ZeroIQ


  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    115
    Originally posted by ZeroIQ
    Maybe this...
    according to Your example:
    Code:
    onClipEvent (keyDown) {
    	if (circle.hitTest(square) && Key.isDown(Key.SPACE)){
    	gotoAndPlay(frame_number);
    	}
    }
    or You can use enterFrame event instead of keyDown.
    Any questions? Write !

    ZeroIQ

    ??????????? I can't work this? I have made a moving circle, but when you hit the spquare and press space? It doesn't work! Please help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center