TellTarget help! How to do HitTest with a mc that's inside another mc.
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: TellTarget help! How to do HitTest with a mc that's inside another mc.

  1. #1
    Junior Member
    Join Date
    Nov 2002
    Location
    BC, Canada
    Posts
    24

    TellTarget help! How to do HitTest with a mc that's inside another mc.

    Hi, I have a problem with the car game i'm making. I have a hitTest for when you hit a mailbox. I put this on the first frame inside the car movie clip (where mailbox is the instance for the mailbox):

    flag = this.hitTest("/mailbox");
    if (flag == true) {
    tellTarget ("/") {
    gotoAndStop ("hit");
    }
    }
    if (flag == true) {
    tellTarget ("/mailbox") {
    gotoAndPlay (2);
    }
    }


    What I did was have a stop action on the first frame of the mailbox. Then on frame 2, is the animation of the mailbox when my car collides. So far this works perfectly well in the game. Understand it so far?

    Ok, so my problem is, I want to put the mailbox mc inside a different mc that's on the main layer. Therefor, making it so the mailbox mc is in a different mc, not on the main timeline. But, for some reason, when I play it, the script won't work. Could this be become it is looking for the instance of my mailbox on the main timeline and not in a different movie clip?

    Please help me figure this one out, I need to know how to make the script look for the istance of the mailbox on a level other than the main timeline. Any suggestions?

    Thanks
    JPMoney

  2. #2
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    You need to change your target to /whateverthemovieclipyouareputtingthemailboxin/mailbox

    What version of flash are you using? If its flash5 or above you should really use the dot syntax.

    _root.newmovieclip.mailbox etc...

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

Poll by Flashkit.com