Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-27 Thread Ktu
I know this is a few days old, but I have some input.

I have seen something similar to this with AS2. Using the WebServices class,
when you make a method call on a web service object, you create a pending
call object, and one of the properties of the pendingCall class was
doLazyDecoding. What this variable specified was whether the player should
convert the XML data to native Flash objects right away, or only when
needed.

I had multiple issues with trying to access information from the return of a
WebService call, and the only way to fix it was to set doLazyDecoding to
false.

Since WebServices send data as XML, it could be, that the same type of issue
is occuring here in AS3 with the new XML object. FP is probably doing
something in the background with the xml just loaded, and hasn't finished
yet when you don't put the trace in.

That's just my wacky theory.

Ktu

On Fri, Apr 17, 2009 at 8:38 PM, Taka Kojima t...@gigafied.com wrote:

 Hey Tim,

 I have run into this before as well, with both ActionScript and using
 alert() in JavaScript.

 What I concluded was that the trace/alert basically adds a small pause
 or causes something to happen (i.e. skip a frame or something of the
 sort) so that the code below it works.

 I may be totally wrong and this may sound crazy and stupid, but
 whenever I did something like take the trace out and put the rest of
 the code into a COMPLETE event for a timer, or had the code run on the
 next frame with an onEnterFrame, it started working.

 I know you say you don't think its a timing issue, but instead of the
 loop try doing a Timer and see if that solves it.




 On Fri, Apr 17, 2009 at 9:09 AM, Tim Hawkins tim...@googlemail.com
 wrote:
  Well, it becomes a null - so if I do select1.toString() in the trace I
 just
  get a runtime error.. And I don't want to turn the results of my query
 into
  a string, because I need it as an XML ref.
 
  2009/4/17 Glen Pike g...@engineeredarts.co.uk
 
  Have you tried the toString or toXMLString for this - check the XML
 class
  for the proper function name...
  Glen
 
 
  Tim Hawkins wrote:
 
  Hi Matt,
  No, afraid not.. I actually use the select1 variable elsewhere, so it's
  not
  just that trace which is the problem.
 
  Thanks for the suggestion though!
 
 
 
  2009/4/17 Matt S. mattsp...@gmail.com
 
 
 
  Does it make a difference if you write the trace as :
 
  trace(formData=+formData);
  trace(select1:+ select1);
 
 
  On 4/17/09, Tim Hawkins tim...@googlemail.com wrote:
 
 
  Hi,
  I've come across this a few times in my own code, but haven't seen it
  mentioned online - though it's a difficult thing to google for.
 
  In the following function, if the trace at the top is present,
 formData
  traces a load of XML and select1 also traces a load of XML.
 
  If I comment out the top trace, formData still traces the same pile
 of
 
 
  XML
 
 
  but select1 traces null!
 
  public function testMakeModelFilterWorks():void {
 
   trace();
   default xml namespace  = NAMESPACE;
 
  var select1:XML = formData..select1[2];
  trace(formData=, formData);
   trace(select1:, select1);
 
  // etc
  default xml namespace = null;
  }
 
  Any ideas? I'm getting fed up of leaving 'trace();//don't delete
 me'
  at
  the top of functions.
  (I don't think it's a timing thing, if I put a 10-item
  increment-a-variable loop in there instead of a trace the E4X still
 
 
  fails.)
 
 
  t.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
 
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-17 Thread Matt S.
Does it make a difference if you write the trace as :

trace(formData=+formData);
trace(select1:+ select1);


On 4/17/09, Tim Hawkins tim...@googlemail.com wrote:
 Hi,
 I've come across this a few times in my own code, but haven't seen it
 mentioned online - though it's a difficult thing to google for.

 In the following function, if the trace at the top is present, formData
 traces a load of XML and select1 also traces a load of XML.

 If I comment out the top trace, formData still traces the same pile of XML
 but select1 traces null!

 public function testMakeModelFilterWorks():void {

  trace();
  default xml namespace  = NAMESPACE;

 var select1:XML = formData..select1[2];
 trace(formData=, formData);
  trace(select1:, select1);

 // etc
 default xml namespace = null;
 }

 Any ideas? I'm getting fed up of leaving 'trace();//don't delete me' at
 the top of functions.
 (I don't think it's a timing thing, if I put a 10-item
 increment-a-variable loop in there instead of a trace the E4X still fails.)

 t.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-17 Thread Glen Pike
Have you tried the toString or toXMLString for this - check the XML 
class for the proper function name...

Glen

Tim Hawkins wrote:

Hi Matt,
No, afraid not.. I actually use the select1 variable elsewhere, so it's not
just that trace which is the problem.

Thanks for the suggestion though!



2009/4/17 Matt S. mattsp...@gmail.com

  

Does it make a difference if you write the trace as :

trace(formData=+formData);
trace(select1:+ select1);


On 4/17/09, Tim Hawkins tim...@googlemail.com wrote:


Hi,
I've come across this a few times in my own code, but haven't seen it
mentioned online - though it's a difficult thing to google for.

In the following function, if the trace at the top is present, formData
traces a load of XML and select1 also traces a load of XML.

If I comment out the top trace, formData still traces the same pile of
  

XML


but select1 traces null!

public function testMakeModelFilterWorks():void {

 trace();
 default xml namespace  = NAMESPACE;

var select1:XML = formData..select1[2];
trace(formData=, formData);
 trace(select1:, select1);

// etc
default xml namespace = null;
}

Any ideas? I'm getting fed up of leaving 'trace();//don't delete me' at
the top of functions.
(I don't think it's a timing thing, if I put a 10-item
increment-a-variable loop in there instead of a trace the E4X still
  

fails.)


t.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-17 Thread Tim Hawkins
Well, it becomes a null - so if I do select1.toString() in the trace I just
get a runtime error.. And I don't want to turn the results of my query into
a string, because I need it as an XML ref.

2009/4/17 Glen Pike g...@engineeredarts.co.uk

 Have you tried the toString or toXMLString for this - check the XML class
 for the proper function name...
 Glen


 Tim Hawkins wrote:

 Hi Matt,
 No, afraid not.. I actually use the select1 variable elsewhere, so it's
 not
 just that trace which is the problem.

 Thanks for the suggestion though!



 2009/4/17 Matt S. mattsp...@gmail.com



 Does it make a difference if you write the trace as :

 trace(formData=+formData);
 trace(select1:+ select1);


 On 4/17/09, Tim Hawkins tim...@googlemail.com wrote:


 Hi,
 I've come across this a few times in my own code, but haven't seen it
 mentioned online - though it's a difficult thing to google for.

 In the following function, if the trace at the top is present, formData
 traces a load of XML and select1 also traces a load of XML.

 If I comment out the top trace, formData still traces the same pile of


 XML


 but select1 traces null!

 public function testMakeModelFilterWorks():void {

  trace();
  default xml namespace  = NAMESPACE;

 var select1:XML = formData..select1[2];
 trace(formData=, formData);
  trace(select1:, select1);

 // etc
 default xml namespace = null;
 }

 Any ideas? I'm getting fed up of leaving 'trace();//don't delete me'
 at
 the top of functions.
 (I don't think it's a timing thing, if I put a 10-item
 increment-a-variable loop in there instead of a trace the E4X still


 fails.)


 t.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Interesting problem - doesn't work without call to trace.

2009-04-17 Thread Taka Kojima
Hey Tim,

I have run into this before as well, with both ActionScript and using
alert() in JavaScript.

What I concluded was that the trace/alert basically adds a small pause
or causes something to happen (i.e. skip a frame or something of the
sort) so that the code below it works.

I may be totally wrong and this may sound crazy and stupid, but
whenever I did something like take the trace out and put the rest of
the code into a COMPLETE event for a timer, or had the code run on the
next frame with an onEnterFrame, it started working.

I know you say you don't think its a timing issue, but instead of the
loop try doing a Timer and see if that solves it.




On Fri, Apr 17, 2009 at 9:09 AM, Tim Hawkins tim...@googlemail.com wrote:
 Well, it becomes a null - so if I do select1.toString() in the trace I just
 get a runtime error.. And I don't want to turn the results of my query into
 a string, because I need it as an XML ref.

 2009/4/17 Glen Pike g...@engineeredarts.co.uk

 Have you tried the toString or toXMLString for this - check the XML class
 for the proper function name...
 Glen


 Tim Hawkins wrote:

 Hi Matt,
 No, afraid not.. I actually use the select1 variable elsewhere, so it's
 not
 just that trace which is the problem.

 Thanks for the suggestion though!



 2009/4/17 Matt S. mattsp...@gmail.com



 Does it make a difference if you write the trace as :

 trace(formData=+formData);
 trace(select1:+ select1);


 On 4/17/09, Tim Hawkins tim...@googlemail.com wrote:


 Hi,
 I've come across this a few times in my own code, but haven't seen it
 mentioned online - though it's a difficult thing to google for.

 In the following function, if the trace at the top is present, formData
 traces a load of XML and select1 also traces a load of XML.

 If I comment out the top trace, formData still traces the same pile of


 XML


 but select1 traces null!

 public function testMakeModelFilterWorks():void {

  trace();
  default xml namespace  = NAMESPACE;

 var select1:XML = formData..select1[2];
 trace(formData=, formData);
  trace(select1:, select1);

 // etc
 default xml namespace = null;
 }

 Any ideas? I'm getting fed up of leaving 'trace();//don't delete me'
 at
 the top of functions.
 (I don't think it's a timing thing, if I put a 10-item
 increment-a-variable loop in there instead of a trace the E4X still


 fails.)


 t.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders