Are you looking for:
<local:myContainerComponent id=”containerComponent”>
<local:imageVar>
<mx:Image source=”myTestImage.jpg” />
</local:imageVar>
</local:myContainerComponent>
On 4/14/10 12:53 PM, "Christopher McArthur" <[email protected]> wrote:
I have a component, that has a property of type Image. I need to assign a new
Image component to it. this is trivial to do in action script. But, how do I do
it in MXML?
Example:
mxml:
<local:myContainerComponent id="containerComponent"/>
actionscript:
var myImage:Image = new Image("myTestImage.jpg");
containerComponent.imageVar = myImage;
Is there anyway to do that creation of the image, and assignment purely from
MXML? The image cant be a child of anything else, so I cant just declare it
randomly somewhere in the same container.
For context, im using the Flash Component Kit, and the myContainerComponent is
a container exported from flash a "mx.flash.ContainerMovieClip". And it
requires you to assign a component to its "content" property. Ideally, id like
to create and assign this content component using mxml only.
--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui