Thanks Dan, now work. :D
--- In [email protected], "Daniel Freiman" <[EMAIL PROTECTED]> wrote:
>
> 'xml.catalog.item[0]' isn't a child of 'xml'. 'xml.catalog.item[0]'
is a
> descendant of of 'xml'. Try ' xml.catalog[0].insertChildAfter(
> xml.catalog.item[0], <saleItem>fries</saleItem>);' Sorry I didn't catch
> that the first time around.
>
> - Dan Freiman
>
> On 9/11/07, danielvlopes <[EMAIL PROTECTED]> wrote:
> >
> > Thanks Dan, i made some teste and look this.
> > When i teste de adobe example on flex documents, everything work:
> > public function xmlTeste():void{
> > var xml:XML =
> > <menu>
> > <item>burger</item>
> > <item>soda</item>
> > </menu>;
> > xml.insertChildAfter(xml.catalog.item[0], <saleItem>fries</saleItem>);
> > Alert.show(xml);
> >
> > But if i put some subnode in xml, nothing work, and this is the
> > problem happening in my app.
> >
> > public function xmlTeste():void{
> > var xml:XML =
> > <menu>
> > <catalog>
> > <item>burger</item>
> > <item>soda</item>
> > </catalog>
> > </menu>;
> > xml.insertChildAfter(xml.catalog.item[0], <saleItem>fries</saleItem>);
> > Alert.show(xml);
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>,
"Daniel
> > Freiman" <FreimanCQ@> wrote:
> > >
> > > I don't think that bug is your problem because bug database reports
> > that as
> > > effecting flash 9 alpha and that the bug is closed. This implies
> > that the
> > > bug was fixed before the beta was even released.
> > >
> > > I think you're running into this (from livedocs): "If child1 is
> > provided,
> > > but it does not exist in the XML object, the XML object is not
> > modified and
> > > undefined is returned."
> > >
> > > 'xmlResult.results.image.toXMLString()' returns a string, which
> > isn't an xml
> > > node. Thus this expression is not a child of xmlResult and thus you
> > get the
> > > above behavior. You want to return a reference to an xml object,
> > which is '
> > > xmlResult.results.image[0]'
> > >
> > > If I'm right, then my question becomes, why does insertChildAfter
> > take type
> > > * instead of type XML?
> > >
> > > - Dan Freiman
> > >
> > > On 9/10/07, danielvlopes <danielvlopes@> wrote:
> > > >
> > > > Hello,
> > > > I having big troubles, when i try do insertchildafter or
> > > > insertchildbefore.
> > > >
> > > > I had this xml:
> > > > <upload>
> > > > <results success="true">
> > > > <image src="/imagens/equipamentos/phpmEdEM6.jpg"
> > > > thumb="/imagens/equipamentos/t_phpmEdEM6.jpg"/>
> > > > </results>
> > > > </upload>
> > > >
> > > > And use this code to inser new lines to this xml:
> > > > var evDataXml:XML = new XML (event.data);
> > > > var imageNode:XML = new XML
(evDataXml.results.image.toXMLString());
> > > >
> > > > xmlResult.insertChildAfter(xmlResult.results.image.toXMLString
> > > > (),imageNode);
> > > >
> > > > But nothing happen,
> > > > I find this link about this problem, but i don't how fix,
> > > > http://bugs.adobe.com/jira/browse/ASC-188
> > > >
> > > > Anyone can help me? Thanks.
> > > >
> > > >
> > > >
> > >
> >
> >
> >
>