No, you must have a refernence to MyClass somewhere in your code in order for it to be linked in to the SWF at compile time. A string 'myPackage.MyClass' does not constitute a reference. This is not a bug - the compiler must optimize what classes are actually needed to keep the SWF size down.
-----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of tyombria Sent: Wednesday, March 22, 2006 4:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex 2.0 b2: 'getClassByName' method of the 'flash.util' package Hi, all. Method 'getClassByName' works correctly only with adobe classes. For example, getClassByName('flash.net.URLLoader') works fine. I've got a problem with my custom classes. For example: var myClassReference:MyClass = getClassByName('myPackage.MyClass'); I get error: Error #1065: Variable MyClass is not defined. Class exists in classpath or in the library. If i put somewhere inside declaration block: var myClass:MyClass It (getClassByName) works fine. Is it a bug? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/