2 Replies Latest reply on Apr 27, 2007 10:37 AM by parallaxed

    Convert mxml component to an AS class?

      I just made a custom MXML component ("ProjectImage.mxml") and expected to be able to instantiate instances of it from AS scripts like so:

      var newImage:ProjectImage = new ProjectImage();

      (this is within an <mx:Script> block in Flex, and I've explicitly imported the component.)

      but apparently this doesn't work (got "Access of possibly undefined property source through a reference with static type customComp.views:ProjectImage.") Is there any easy way to convert my mxml component to an AS class without writing it from scratch? Flex does this anyway at runtime, yes? So it seems like it should be able to do it on command....

      Any help would be appreciated. Thanks!