Why would I get ReferenceError #1065: "Variable title is not defined."
Well of course it's not defined. It's a dynamic class, and strict mode compilation is turned off so that I don't have to declare the property to compile it.
I've created a library item named "Page" with a single TextField instance named "title".
Page's class is defined in an ActionScript file, and it's assigned to the library item in export for ActionScript.
Page's ActionScript file defines the class as a "dynamic" class, so I should not be getting this runtime error. I turned off strict mode compiling, since it seems to be designed to check the presense of property definitions at compile time for dynamic classes like MovieClip.
public dynamic class Page extends MovieClip
{
public function Page()
{
super();
var text:String = title.text; //title can be moused over in the debugger here and shows the correct value, but the flash player throws a runtime error when it tries to access it, but it shouldn't because this is a dynamic class.
}
}
So why am I getting a runtime error for the field "title". It makes no sense, because if I step to that line in the FlashDevelop debugger and hold the mouse over "title", it shows that it is in fact the instance of the TextField that I'm trying to access. Yet the player throws an error when I actually try to access it.
Is it a problem or limitation with the access style (i.e. would it work fine if I accessed it as "this.title" or "this["title"]"?
