Hi,
I’m creating a game and I want to test if an object (created by a class)
hit the main character (created on the stage)
I tried referencing the main character in the class (parent.main_character),
but it states that it doesn’t recognize that instance name.
How can I reference an object on the main stage through a class?
I think you should better make a function to reference the object which created on the stage and assign it to a variable.
var myOwnObj:Object = new Object();
public function getMyOnwObj():Object
{
return myOwnObj;
}
when you want the myOwnObj then you can call this function,if you put this function in a public class then it can be called every where,
if you want to disable the object then you just change the function only.
(square is the name of the object on the stage)
They all give me this error:
1119: Access of possibly undefined property square through a reference with static type Class.