I tried all sorts of combinations. The point is, it works fine *if* the data 
pertains to var "id" but not if it pertains to var "pkg" (which is why I don't 
think your suggested solutions would have helped). It's absolute idiocy, and 
something I have found pervasive throughout Flash. It's hard enough working 
through my own bugs without having to work through all the bugs in Flash which 
I have found to be plethora. I guess since Adobe has us all by the short hairs 
with a monopoly and since no large corporation could give a rat's a$$ about the 
little guy, they just suck us dry and hang us out to do the same.

What I ended up doing was appending a 0 to the one variable it seemed to want 
to accept--id--if it was to be a package. Then all the data neatly compiled 
just fine for me. How absurd to have to waste a day working around this Flash 
bug.

For the record, I've also found I can't call vars from my Python scripts. I end 
up calling everything like below with e.target.data and writing my own script 
to parse out all the name/value pairs. 


Thank you, Adobe.
John



________________________________
From: Cor <c...@chello.nl>
To: 'Flash Coders List' <flashcoders@chattyfig.figleaf.com>
Sent: Saturday, October 8, 2011 3:25 AM
Subject: RE: [Flashcoders] can't get e.target.data

var str:String = String(e.target.data);

without new?

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: zaterdag 8 oktober 2011 2:44
To: Flash List
Subject: Re: [Flashcoders] can't get e.target.data

Maybe set it to a var first?

var data:String = e.target.data;
var str:String = new String(data);

HTH,

Karl



On Oct 7, 2011, at 2:23 PM, John Polk wrote:

> Here's a code snippet:
>             var req:URLRequest = new URLRequest(siteUrl + "store/ 
> flash_store2.py?id=" + id + "&pkg=" + pkgID);
>             /*
>             var variables:URLVariables = new URLVariables();
>             loader.dataFormat = URLLoaderDataFormat.VARIABLES;
>             req.method = URLRequestMethod.POST;
>             variables.pkg = pkgID;
>            variables.id = id;
>             req.data = variables;
>             */
>             loader.load(req);
>             loader.addEventListener(Event.COMPLETE, onSendComplete);
>         }
>
>         private function onSendComplete(e:Event):void
>         {
>             var txt:TextField = new TextField();
>             var myFormat:TextFormat = new TextFormat();
>             myFormat.font = "Arial";
>             myFormat.size = 5;
>             var str:String = new String(e.target.data);
>
> First up, I find I have to often bypass URLVariables because it simply 
> doesn't work, as is the case here. But the real problem is
> thus:
> 1) When I test this on my Mac, calling the data from my server, 
> everything works fine.
> 2) When I test this on my server, calling the page TTW, everything 
> works fine if "id" has a value and "pkg" does not.
> 3) When I test my python script that generates the data on my server 
> passing a value only for "pkg", everything displays fine; however;
> 4) When I test this on my server, calling the page TTW with no value 
> for "id" and a value for "pkg", e.target.data only serves up this 
> string "->->" which is incomprehensible to me.
> How do I trouble-shoot this?
> TIA,
> John
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Karl DeSaulniers
Design Drumm
http://designdrumm.com

_______________________________________________
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

Reply via email to