Copy link to clipboard
Copied
I was wondering how you can edit a Movie Clip, in one frame when the action script controlling it is on another frame. (Both in the same layer though.)
The context is I am making a maze game and each frame is a room on the maze, there is a locked door in one room and a key in another. When you find the key and click it the door will be unlocked and you will be able to progress further within the maze.
The exact error is "TypeError: Error #1009: Cannot access a property or method of a null object reference."
My code is.... ("gKey" is in the current frame while "A25" and "gLock" are in another frame)
Function GreenUnlock(m:MouseEvent)
{
A25.addEventListener(MouseEvent.CLICK, hop25);
gLock.visible = false
}
function hop25(m:MouseEvent)
{
gotoAndStop(13);
}
The short answer is most likely that you cannot try to execute code for an object that does not exist in the frame where the code executes. You will need to either move the object to where the code is or move the code to where the object is.
Copy link to clipboard
Copied
The short answer is most likely that you cannot try to execute code for an object that does not exist in the frame where the code executes. You will need to either move the object to where the code is or move the code to where the object is.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now