This may sound like a stupid question, but Flash is giving out an (Error 1120: Access of Undefined Property “InstanceName”) while everything is perfectly in order.
As shown in the image below:
- Instance name is “back1”
- The action is on the same frame as the instance.
Actions:
stop();
back1.addEventListener(MouseEvent.CLICK, goback);
function goback(e:MouseEvent):void
{
play();
}
Error:
Scene 1, Layer ‘Actions’, Frame 11, Line 3 1120: Access of Undefined Property back1
From what I believe this should work perfectly as the following is happening:
- Instance name spellings are correct in both the properties and script.
- The instance is on the same frame as the actions.
- The instance is not nested inside another and is directly placed on stage.
- The timeline stops at the given frame to await further events with the “stop();” command, thus the script has free access to the instance.
So, why am I still getting the error message? Please help me out. Thanks in advance.