You've got to check out the flexcoders group (yahoo), if you haven't
already. There's a number of adobe people who are trolling there.

BTW This list was created by Adobe, so I am sure there are plenty of people
from Adobe that read it.

This is also a flexcoders question. The flexcomponents list is primarily
aimed at component creation, framework questions, not flex/as3 use or flex
application use.

Peace, Mike

On 12/14/06, Roger Gonzalez <[EMAIL PROTECTED]> wrote:

   Your class isn't being linked in, because it isn't referenced.

Your options are:

(a) force it to be linked in, either with an explicit reference, or via a
compiler flag.
(b) make sure that the code below is in a SWF is loaded into (or as a
child of) an ApplicationDomain containing your class.
(c) dynamically load another SWF that contains the definition, and use
ApplicationDomain.getDefinition.

-rg

 ------------------------------
*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *genius_gen2k
*Sent:* Thursday, December 14, 2006 8:50 AM
*To:* [email protected]
*Subject:* [flexcoders] Instantiating Class Dynamically

 Hello Everyone,

I am trying to instantiate a class dynamically via the data from an
external XML file. I get the class name as a String in Flex code and
then I have applied the below code to instantiate that string as a
class. Here "MyClass" is a custom class inside the "com.apps"
package. I have also imported the above class with fully qualified
name.

I have a code written as below:

try {
var dynamicClass: String = "com.apps.MyClass";
var classRef:Class = flash.utils. getDefinitionByN ame(dynamicClass )
as Class;
var myClass:* = new classRef();
}
catch(e:ReferenceEr ror) {
tracer.traceMe( e.errorID + " "+e.message);
}

This code works perfectly with the standard Flex classes like
"flash.display. MovieClip" but gives me Reference error (code 1065)
when I use "com.apps.MyClass" for the dynamicClass statement above.

Anything specific needed to be done with the custom class, to make it
accessible, the way MovieClip class is accessed. Any ideas of how do
i go about this?

Amol.




--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to