private function onLoad( data:XML ):void
{
for each ( var obj:XML in data..image )
{
trace("It's " + obj);
}
}
Which is more or less what I posted, works fine with your data. The E4X
expression "data.*" is an XMLList of the child nodes underneath data. You
will get only one iteration, which is the node for <dep>. When you trace
obj..image, you're getting an XMLList of two nodes, because there's two
<image> node descendants of <dep>.
When you're using E4X and things aren't working as you expect, always try:
trace("My current node's xml is\"" + obj.toXMLString() + "\".");
It'll help you figure out where you are in your xml tree and help debug the
problem with your expression.
-Josh
On Tue, Jul 8, 2008 at 11:48 PM, flexawesome <[EMAIL PROTECTED]> wrote:
> hey here is my code, or you are able to find it on my first post.
>
> http://www.privatepaste.com/f8hQrmzTyB
>
> Cheers
>
> --- In [email protected], "Josh McDonald" <[EMAIL PROTECTED]> wrote:
> >
> > That's all I've got, I was just typing it in off the top of my
> head. Post
> > your code that doesn't work, and I'll have a look.
> >
> > -Josh
> >
> > On Tue, Jul 8, 2008 at 2:00 PM, flexawesome <[EMAIL PROTECTED]> wrote:
> >
> > > humm..it makes sense. but... how can I modify my code accordingly?
> > >
> > > seems doesn't work for me here, do you mind to post the code
> > > completely?
> > >
> > > :)
> > >
> > >
> > >
> > > --- In [email protected], "Josh McDonald" <dznuts@>
> wrote:
> > > >
> > > > No worries mate. Assuming you're talking about an XMLList, this
> > > should do
> > > > it:
> > > >
> > > > for each (var node:* in myXMLList.image) {
> > > > myArray.push(node.toString());
> > > > }
> > > >
> > > > -Josh
> > > >
> > > > On Tue, Jul 8, 2008 at 1:45 PM, flexawesome <flexawesome@>
> wrote:
> > > >
> > > > > hey Josh, may I get an array of strings containing the
> URLs ? :)
> > > > >
> > > > > Cheers
> > > > >
> > > > > --- In [email protected], "Josh McDonald" <dznuts@>
> > > wrote:
> > > > > >
> > > > > > That's not much of a description for your problem buddy :)
> > > > > >
> > > > > > Do you want to get an array of strings containing just the
> urls
> > > > > from an
> > > > > > XMLList? Or do you just want to drop those nodes from an XML
> > > > > document? We
> > > > > > need more info to be of any help.
> > > > > >
> > > > > > -Josh
> > > > > >
> > > > > > On Tue, Jul 8, 2008 at 1:34 PM, flexawesome <flexawesome@>
> > > wrote:
> > > > > >
> > > > > > > hey there, is there a way to get rid off the tag (
> image)?
> > > > > humm, I got
> > > > > > > this...
> > > > > > > <image>www.google.com/a.jpg</image>
> > > > > > > <image>www.msn.com/b.jpg</image>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > http://www.privatepaste.com/f8hQrmzTyB
> > > > > > >
> > > > > > > Thank you
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > "Therefore, send not to know For whom the bell tolls. It
> tolls
> > > for
> > > > > thee."
> > > > > >
> > > > > > :: Josh 'G-Funk' McDonald
> > > > > > :: 0437 221 380 :: josh@
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > ------------------------------------
> > > > >
> > > > > --
> > > > > Flexcoders Mailing List
> > > > > FAQ:
> > > http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > > > Search Archives:
> > > > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> > > Groups
> > > > > Links
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > "Therefore, send not to know For whom the bell tolls. It tolls
> for
> > > thee."
> > > >
> > > > :: Josh 'G-Funk' McDonald
> > > > :: 0437 221 380 :: josh@
> > > >
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives:
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> Groups
> > > Links
> > >
> > >
> > >
> > >
> >
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls for
> thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]