Please file a bug with a simplified test case.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Whitelock
Sent: Saturday, May 10, 2008 12:54 PM
To: [email protected]
Subject: [flexcoders] [Fixed] Flex Weirdness: Verify Errors and E4X

 

Actually, it's more of a surrender than a fix :-)

I finally removed the E4X code and used the old XMLDocument object to
process the XML and the verify errors went away.

I guess that E4X is not quite mature enough to be dependable in all
cases, though it's a bit surprising that the compiler chokes on fairly
simple E4X expressions.

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Paul Whitelock" <[EMAIL PROTECTED]> wrote:
>
> > Verify errors generally mean that you fooled the compiler somehow.
> > Sometimes, name collisions can fool the compiler.
> 
> Hmmm, odd. I wasn't doing anything out of the ordinary. What I did to
> fix the problem in two of the cases was to move the code that creates
> the new event outside of the dispatchEvent method (can't remember
> exactly what I did for the other three or four instances to fix
things).
> 
> > As far as E4x goes, the code you showed may mean that XMLDataItem3 
> > may not be in the default namespace.
> 
> The root tag has a xmlns declaration, but all of the children are just
> simple tags (not even any attributes). The structure is similar to
this:
> 
> <?xml version="1.0"?>
> 
> <Root xmlns:"http://mynamespace";>
> 
> <Result>
> <XMLDataItem3>String1</XMLDataItem3>
> <XMLDataItem3>String2</XMLDataItem3>
> <XMLDataItem3>String3</XMLDataItem3>
> </Result>
> 
> <MetaData>
> <XMLDataItem1>String</XMLDataItem1>
> <XMLDataItem2>2</XMLDataItem2>
> </MetaData>
> 
> </Root>
> 
> 
> 
> --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote:
> >
> > Verify errors generally mean that you fooled the compiler somehow.
> > Sometimes, name collisions can fool the compiler.
> > 
> > 
> > 
> > As far as E4x goes, the code you showed may mean that XMLDataItem3
may
> > not be in the default namespace.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected]
<mailto:flexcoders%40yahoogroups.com> 
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> > Behalf Of Paul Whitelock
> > Sent: Sunday, May 04, 2008 2:49 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>

> > Subject: [flexcoders] Flex Weirdness: Verify Errors and E4X
> > 
> > 
> > 
> > For some reason I've been seeing a lot of verify errors on a project
> > I'm working on. The error always seems to be:
> > 
> > VerifyError: Error #1025: An invalid register 5 was accessed.
> > 
> > It seems to be related to constructing an event within a
> > dispatchEvent call, but I've done this countless times and have
> > never seen a VerifyError. So far I've been able to restructure
> > the code a bit and it goes away, but this doesn't seem normal.
Anyone
> > know what might be going on?
> > 
> > The other bit of strangeness is related to E4X. I have something
> > similar to the following:
> > 
> > var returnedXML:String = event.result.content as String;
> > var myXML:XML = new XML(returnedXML); 
> > var xmlNS:Namespace = myXML.namespace();
> > default xml namespace = xmlNS;
> > 
> > var dataItem1:String = myXML..XMLDataItem1;
> > var dataItem2:Number = Number(myXML..XMLDataItem2);
> > 
> > if (event.result.header.code == someValue) {
> > switch (switchVar) {
> > case 1:
> > var dataItem3:XMLList = myXML..XMLDataItem3;
> > break;
> > }
> > }
> > 
> > The problem is that dataItem3 is always set to null UNLESS I
> > recreate the XML object just before the dataItem3 statement, like
so:
> > 
> > myXML = new XML(returnedXML);
> > var dataItem3:XMLList = myXML..XMLDataItem3;
> > 
> > Any idea why E4X returns null if I don't recreate the XML object?
> >
>

 

Reply via email to