views:

51

answers:

1

I've created a SittingDuck.as class that extends the MovieClip class. When I instantiate SittingDuck in my .fla file, I try and access both the properties I created in the SittingDuck.as file, as well as its inherited properties. I'm able to refer to and change x and y properties, but when I attempt to access the instanceName property, I get the message,

"Access of possibly undefined property instanceName through a reference with static type com.examples.SittingDuck.

Problem is, prior to writing the SittingDuck.as file, I was able to get the instanceName property with no problem. Any ideas why my instance of SittingDuck hasn't inherited this property from MovieClip?

+2  A: 

Do you mean the name property? as in like MovieClip.name? I don't believe there is an instance variable called instanceName

Chris Gutierrez
That's funny, b/c, as I mentioned, I was able to set the movieClip's "instanceName" property prior to creating a class definition file of my own for the object. However, according to the documentation, it should be "name" (although the property "instanceName" exists for many other objects, such as Error and Motion objects).
staypuffinpc