So I have my code written like this.
var classReference:Class = getDefinitionByName("Widget") as Class;
var instance:Object = new classReference();
And I realize I am getting this error because I have no other instance of Widget anywhere and so it's not being compiled. Let's say I have 100 different classes that I need to use getDefinitionByName() ...Is there a way I can get around this without having to have:
var classReferene:Widget;
Thanks,
Hi,
having:
package
{
public class Widget
{
public function test():void
{
trace("test");
}
}
}
accessed as:
var widgetClass:Class = flash.utils.getDefinitionByName("Widget") as Class;
var widgetInstance:Object = new widgetClass();
widgetInstance.test();
you could add:
-includes Widget
to additional compiler options (and then everything will work ;))
see:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf 69084-7a92.html
hth,
kind regards,
Peter
Can you tell me how to do this? I tried -load-config+=addonclasses.xml as a compiler argument. This is the content of addonclasses.xml:
<?xml version="1.0"?>
<flex-config xmlns="http://www.adobe.com/2006/flex-config">
<compiler>
<source-path>
<path-element>.</path-element>
</source-path>
</compiler>
<include-classes>
<class>ch.crealogix.satellite.addons.learningcontent.LearningCon tentFacadeAddon</class>
</include-classes>
</flex-config>
North America
Europe, Middle East and Africa
Asia Pacific