In my Flex gallery program, I have a custom MXML component 'DisplayImage' and a piece of program that popup the component.
The 'DisplayImage' component is just a with a in it.
I instantiate a 'DisplayImage' control and popup it using the following code in my main application:
...
var img:DisplayImage = new DisplayImage();
img.innerImage.source = file;
PopUpManager.addPopUp(img, this, true);
...
When I run the program, I'll get error information saying the Image control in my DisplayImage control is null.
I tried to change the object 'img' to mx:Image type and the program runs correctly.
If I add the DisplayImage to the popup manager before I set the image source, the program runs correctly, as well.
It seems to me a compound component like my DisplayImage is not instantiated until paint is required. However, an simple Image component gets instantiated right after being constructed.