RE: [flexcoders] What is the MXML syntax for this?

2010-04-15 Thread Christopher McArthur
Thanks for the response Alex.

 

And this works great for my test example! 

 

However, I am curious, is this as deep as you can go, one level? Or is
it possible to nest it deeper? 

 

Just trying to get an idea of whats allowed and how its actually
working.

 

Nesting one level deeper, in a simple test application, I get the error
:

could not resolve local:imageVar to a component implementation.

so, for an example, if you had a ParentContainer, that had a variable
named childComponent, that has a variable named imageVar.

 

 

local:ParentContainter

local:childComponent
  local:imageVar
mx:Image source=myTestImage.jpg /

/local:imageVar
/local: childComponent 
/local: ParentContainter 

 

This gives the could not resolve local:imageVar to a component
implementation. error.

 

 

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Alex Harui
Sent: Wednesday, April 14, 2010 10:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] What is the MXML syntax for this?

 

  

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 cmcart...@riotgames.com
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.



 



Re: [flexcoders] What is the MXML syntax for this?

2010-04-15 Thread Alex Harui
You can go as deep as you want.  What you are doing is declaring a component, 
then naming one of its properties, then declaring the value of the property to 
be another component.  Once you do that you can name one of that component’s 
properties and define its value to be another component, etc.

It is easier to see the pattern if all of your components start with uppercase 
letters and properties start with lower case.

thirdParty:SomeContainer
thirdParty:somePropertyInSomeContainer
local:MyContainer
local:somePropertyInMyContainer
s:Group
s:layout
s:VerticalLayout /


On 4/15/10 3:03 PM, Christopher McArthur cmcart...@riotgames.com wrote:






Thanks for the response Alex.

And this works great for my test example!

However, I am curious, is this as deep as you can go, one level? Or is it 
possible to nest it deeper?

Just trying to get an idea of whats allowed and how its actually working.

Nesting one level deeper, in a simple test application, I get the error :
could not resolve local:imageVar to a component implementation.
so, for an example, if you had a ParentContainer, that had a variable named 
childComponent, that has a variable named imageVar.


local:ParentContainter
  local:childComponent
  local:imageVar
   mx:Image source=”myTestImage.jpg” /
   /local:imageVar
/local: childComponent 
/local: ParentContainter 

This gives the could not resolve local:imageVar to a component 
implementation. error.




From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Wednesday, April 14, 2010 10:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] What is the MXML syntax for this?



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 cmcart...@riotgames.com 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


Re: [flexcoders] What is the MXML syntax for this?

2010-04-15 Thread Amanda Machutta
If you want to do it purely in MXML, I would just use a [Bindable] variable.
So you can do this:


mx:Image id=myImage source={myvar}/

Then you can change the variable myvar to store any image you like and it
will automatically update the mxml.

So to add what Alex wrote you could do this:

local:myContainerComponent id=”containerComponent”
local:imageVar
mx:Image source=”{myvar}” /
/local:imageVar
/local:myContainerComponent



Amanda

On Wed, Apr 14, 2010 at 3:53 PM, Christopher McArthur 
cmcart...@riotgames.com 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.









  




-- 
   ´¨)   __o
 .·´  .·´¨)¸.·´¨)  _'\ .
(¸.·´ (¸.·´ (¸.·´¨¨  Amanda ¨¨( * )  (   )


[flexcoders] What is the MXML syntax for this?

2010-04-14 Thread Christopher McArthur
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.

 

 

 

 



Re: [flexcoders] What is the MXML syntax for this?

2010-04-14 Thread Alex Harui
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 cmcart...@riotgames.com 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