Some way you have to create a dependency on VBox to actually get it linked into the SWF, otherwise it isn't there to be found. One way is to use the shared RSL, but otherwise, you have to actually use the class somewhere. In import statement doesn't actually create a link dependency, it simply says what the fully qualified name is when you just use VBox.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of djhatrick Sent: Wednesday, July 30, 2008 1:17 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Flex woes, wo-iz-o, i hate it (sometimes) I am having one of those days where i want to throw this computer off the 30th floor of midtown Manhattan onto a taxi-cab's hood, and leave for the day never come back. This is the problem, I can't get, "getDefinitionByName" to work right, what a load of horse pucky... Sorry for being so salty, but if you are a developer and you have tried to use this function, it must have given you the same type of error, if it hasn't it will... I've tried classes with variables and public classes and the whole nine-yards, it always gives me this stupid error. Any suggestions, that don't require me to lose life or limb? Thanks, Patrick import mx.containers.VBox; import flash.utils.getDefinitionByName; private function init():void { var ClassReference:Class = getDefinitionByName("mx.containers.VBox") as Class; // throws error //var ClassReference:Class = getDefinitionByName("flash.display.Sprite") as Class; // works var instance:Object = new ClassReference(); // addChild(DisplayObject(instance)); } ReferenceError: Error #1065: Variable VBox is not defined. at global/flash.utils::getDefinitionByName() at TotalBullshitIHavetodoThisTest/init()