Hi greg h,

Thank you for replying. With your help, my program is OK now. I've found
the problem. In my program, I was using blockXML.block.length, and it
reported a property not found error. I was thinking that it's because of
"block", but now I find the reason is "length".I thoungt
"blockXML.block" should return an Array, but it seems like that the
return type is ArrayCollection or XMLList(I'm not sure), so "length"
cannot be used and "length()" is the right way.

Thanks again for you reply. It really helps.


Allen.

--- In [email protected], "greg h" <[EMAIL PROTECTED]> wrote:
>
> Hi allenyoungsjtu,
>
> When I run your code, this is what I get returned:
>
> <block id="001">
>   <point x="0" y="0"/>
>   <point x="50" y="0"/>
>   <point x="0" y="50"/>
> </block>
>
> Is this what you meant by "the <block id='001' /> node"?  If not,
could you
> please cut and paste in the return value that you would expect given
the
> value of blockXML.  Or what are you seeing that leads you to conclude
"it
> turned out that as cannot recognise block as blockXML's property"?
>
> Here is my MXML:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; >
>
>     <mx:Script>
>         <![CDATA[
>
>         [Bindable]
>         private var blockXML:XML =
>          <blocks>
>            <block id='001'>
>              <point x='0' y='0' />
>              <point x='50' y='0' />
>              <point x='0' y='50' />
>            </block>
>          </blocks>;
>
>         ]]>
>     </mx:Script>
>
>     <mx:TextArea text="{blockXML.block[0]}"
>         height="100%"
>         width="90%"/>
>
> </mx:Application>
>
> hth,
>
> g
>
> On 3/4/07, allenyoungsjtu [EMAIL PROTECTED] wrote:
> >
> > Hi all,
> >
> > I want to process some xml documents using actionscript. The
document
> > is something like this:
> >
> > [code]
> > private var blockXML:XML =
> >   <blocks>
> >     <block id='001'>
> >       <point x='0' y='0' />
> >       <point x='50' y='0' />
> >       <point x='0' y='50' />
> >     </block>
> >   </blocks>;
> > [/code]
> >
> > I thought I could use the statement as follows:
> >
> > [code]
> > blockXML.block[0]
> > [/code]
> >
> > to get the <block id='001' /> node, but it turned out that as cannot
> > recognise block as blockXML's property.
> >
> > Is there something wrong with my approach? Or I just cannot write it
> > in this way? Thanks a lot!
> >
>


Reply via email to