A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Collision help, yeah im new to flash8

  1. #1
    Senior Member sadako232's Avatar
    Join Date
    Mar 2006
    Posts
    153

    Collision help, yeah im new to flash8

    k, ill get to the point

    **Error** Symbol=endportal, layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler
    if (endportal.hitTest(_root.char)) {

    i have a Platformer game that has 2 main frames one is one level the 2nd frame is the other level, i want it so that if it hits the portal it will play frame 2


    i have frame1 on on "stop();"
    and then when it hits the portal it is play(); then says stop(); again on frame 2

    all help is great


    ~sada~

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    More information on your script, please.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Interactive Designer
    Join Date
    May 2006
    Location
    Connecticut
    Posts
    154
    **Error** Symbol=endportal, layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler
    if (endportal.hitTest(_root.char)) {

    so far- your code is fine! however you seem to have placed it in some arbitrary place.

    in games, most checks have to happen within a main game loop - this means all of your collision as well. If you have main game loop, paste your code into that instead of where you have it now. IE:

    this.onEnterFrame{

    //my game stuff
    if(endportal.hitTest(_root.char)) {
    gotoAndPlay("level2",1);
    }

    -Mike

  4. #4
    Senior Member sadako232's Avatar
    Join Date
    Mar 2006
    Posts
    153
    Yes, i realize now what i did thanks for all your 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