0

I am trying to get hitTestPoint to work. When I type this in, I get this error:

Scene 1 1046: Type was not found or was not a compile-time constant: mcircle.

Here is the code I have:

    import flash.events.Event;

    addEventListener(Event.ENTER_FRAME, hitTest);

function hitTest(evt:Event){
if(mcircle.hitTestPoint(mouseX, mouseY, true)){
    hitText1.text= "hitTestPoint- TRUE";
}
else{
    hitText1.text= "hitTestPoint-FALSE";
}

}

I am a really new to flash, so I know I am doing some silly mistake. Any help will be really appreciated :)

jackbtroop62
  • 63
  • 1
  • 5

1 Answers1

0

Make sure that your instance name for mcircle matches your code exactly.

In the flash IDE, click on your circle on the stage so the clip is selected. Then view the properties panel and verify the Instance Name of your clip.

If you are not sure where the properties panel is, you can use the menu at the top of the screen to find it, by choosing Window/Properties.

The name you see in the library, is the name of the symbol. It is not the instance name.

prototypical
  • 6,731
  • 3
  • 24
  • 34
  • Are you sure ? go to the properties panel when selecting that object on the stage an make sure it's exactly the same. It is case sensitive. Are you sure it's not mcccircle ? or mCircle ? – prototypical Jan 10 '13 at 00:31
  • http://postimage.org/image/6k75mtofx/ I am certain there is a pic to show what it looks like ^ – jackbtroop62 Jan 10 '13 at 00:41
  • 2
    prototypical means the instance name for the clip, under the object properties, not the name in the library. In your screenshot, select the movie clip on stage and click on the 'properties' tab next to the library tab. – mitim Jan 10 '13 at 00:49
  • And always name your linkages and classes with a capital letter and don't use the classname for your instance name. Often results in problems. – Gio Jan 10 '13 at 08:33