Remember also that panel is just a class. So, give it an id, like so:

<mx:Panel id="panel1" />

and then you can do:

panel1.title = myXML.day[0].name;

(but, you should also be able to bind via the example I sent earlier).

mike chambers

[EMAIL PROTECTED]

Merrill, Jason wrote:
Actually, yeah, so doing this in a <mx:Script> tag:

                panelTitle0 = myXML.day[0].name;
                panelTitle1 = myXML.day[1].name;
                panelTitle2 = myXML.day[2].name;

Just to get it from XML into my mxml component via
<mx:Panel title="{panelTitle1}" />
<mx:Panel title="{panelTitle2}" />
<mx:Panel title="{panelTitle3}" />

is going to get REAL old, REAL fast, and I'm sure is not the proper
"Flex" way to do it, so any better code is appreciated.

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com











-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Merrill, Jason
Sent: Thursday, October 20, 2005 1:19 PM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Help with Flexbuilder 2 and XML loading

Cool, well if you figure it out, let me know.  Thanks!

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com











-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Muzak
Sent: Thursday, October 20, 2005 1:18 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Help with Flexbuilder 2 and XML loading

Yes you can :-)
But in this case, a warning (not an error) kept showing up that

changes to the

value that was bound to the title of the panel would
not be 'spotted'.
I think this means that in order to do some kind of dynamic binding,

a

data source

is required that emits (modelChanged?) events (or
something in that direction).

I just kind of worked around it by using a variable (panelTitle)

instead of some

node (name) nested inside an xml strucure.
I'm pretty sure there's a way to use {myXML.day[0].name} as the

title

value (and

not get any warnings), but I'm not that smart yet,
hehe..

regards,
Muzak (--> totally digs this flex2 sh*t <--)

----- Original Message -----
From: "Merrill, Jason" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Thursday, October 20, 2005 7:01 PM
Subject: RE: [Flashcoders] Help with Flexbuilder 2 and XML loading


Ah - cool, thanks.  That worked.  So I learned something I didn't

know

about mxml - which probably should have been obvious to me - I

cannot

use Actionscript 3 outside of a <mx:Script> tag - only public

variables

created by the actionscript within the tag. So you cannot use
actionscript objects like object.object.property in other mxml tags,

you

have to make them a single variable like your code below?


panelTitle = myXML.day[0].name;
<mx:Panel title="{panelTitle}" width="300" height="200"/>

Thanks for the help.  I suppose then you cannot use dot syntax on
actionscript objects outside of a script tag.  Only single

references

are allowed...

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

NOTICE:
This message is for the designated recipient only and may contain

privileged or

confidential information. If you have received it in error, please

notify the sender

immediately and delete the original. Any other use of this e-mail by

you is

prohibited.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to