Re: [Flashcoders] can't get e.target.data
You're welcome ;-) w/ On 8 okt 2011, at 10:20, Cor wrote: Yes, THANKS TO WILLEM !!! :-) Best regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 10:18 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Ah ok, I see. Nice! Best, Karl On Oct 8, 2011, at 3:09 AM, Cor wrote: I do it like this: (Thanks to Willem!) /* //usage var myPHP_Loader = new PHP_Loader(myPhpFile.php, [val1, Value 1], [val2, Value 2]); myPHP_Loader.addEventListener(loaded, myPHP_LoaderLoadedHandler); function myPHP_LoaderLoadedHandler(e:Event):void { trace(e.target.loader.data[a]); } //myPhpFile.php ?php $val1= $_POST['val1']; $val2= $_POST['val2']; //... do something with these values. echo 'a='; echo $val1+$val2; ? */ package { import flash.display.*; import flash.net.*; import flash.events.*; public class PHP_Loader extends Loader { public var loader:URLLoader = new URLLoader(); public function PHP_Loader(url:String, ...args){ loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); var request:URLRequest = new URLRequest(url); if(args.length0){ var variables:URLVariables = new URLVariables(); for (var i:int = 0; i args.length; i++) { variables[args[i][0]] = args[i][1]; } request.method = URLRequestMethod.POST; request.data = variables; loader.dataFormat = URLLoaderDataFormat.VARIABLES; } try{ loader.load(request); } catch (error:Error) { trace(Unable to load URL); dispatchEvent(new Event(error, true)); } }//end CONSTRUCTOR private function loaderCompleteHandler (e:Event):void { trace( loader.data ); dispatchEvent(new Event(loaded, true)); }//end loaderCompleteHandler }//end class }//end package HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:55 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
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
Re: [Flashcoders] can't get e.target.data
Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
RE: [Flashcoders] can't get e.target.data
yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 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
Re: [Flashcoders] can't get e.target.data
Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] can't get e.target.data
I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] can't get e.target.data
Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py?id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 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 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
Re: [Flashcoders] can't get e.target.data
I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 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 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 Karl DeSaulniers Design Drumm http://designdrumm.com
RE: [Flashcoders] can't get e.target.data
I do it like this: (Thanks to Willem!) /* //usage var myPHP_Loader = new PHP_Loader(myPhpFile.php, [val1, Value 1], [val2, Value 2]); myPHP_Loader.addEventListener(loaded, myPHP_LoaderLoadedHandler); function myPHP_LoaderLoadedHandler(e:Event):void { trace(e.target.loader.data[a]); } //myPhpFile.php ?php $val1= $_POST['val1']; $val2= $_POST['val2']; //... do something with these values. echo 'a='; echo $val1+$val2; ? */ package { import flash.display.*; import flash.net.*; import flash.events.*; public class PHP_Loader extends Loader { public var loader:URLLoader = new URLLoader(); public function PHP_Loader(url:String, ...args){ loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); var request:URLRequest = new URLRequest(url); if(args.length0){ var variables:URLVariables = new URLVariables(); for (var i:int = 0; i args.length; i++) { variables[args[i][0]] = args[i][1]; } request.method = URLRequestMethod.POST; request.data = variables; loader.dataFormat = URLLoaderDataFormat.VARIABLES; } try{ loader.load(request); } catch (error:Error) { trace(Unable to load URL); dispatchEvent(new Event(error, true)); } }//end CONSTRUCTOR private function loaderCompleteHandler (e:Event):void { trace( loader.data ); dispatchEvent(new Event(loaded, true)); }//end loaderCompleteHandler }//end class }//end package HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:55 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
Excuse me if my AS3 is not entirely correct, but wouldn't this be more of what your trying to do? ... var req:URLRequest = new URLRequest(); var post_vars:URLVariables = new URLVariables(id, pkg); loader.dataFormat = URLLoaderDataFormat.VARIABLES; req.method = URLRequestMethod.POST; req.url = + siteUrl + store/flash_store2.py; post_vars.id = id; post_vars.pkg = pkgID; req.data = post_vars; loader.send(req.url, req.method, req.data); 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(); str = e.target.data; return str; } Best, Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders
Re: [Flashcoders] can't get e.target.data
Ah ok, I see. Nice! Best, Karl On Oct 8, 2011, at 3:09 AM, Cor wrote: I do it like this: (Thanks to Willem!) /* //usage var myPHP_Loader = new PHP_Loader(myPhpFile.php, [val1, Value 1], [val2, Value 2]); myPHP_Loader.addEventListener(loaded, myPHP_LoaderLoadedHandler); function myPHP_LoaderLoadedHandler(e:Event):void { trace(e.target.loader.data[a]); } //myPhpFile.php ?php $val1= $_POST['val1']; $val2= $_POST['val2']; //... do something with these values. echo 'a='; echo $val1+$val2; ? */ package { import flash.display.*; import flash.net.*; import flash.events.*; public class PHP_Loader extends Loader { public var loader:URLLoader = new URLLoader(); public function PHP_Loader(url:String, ...args){ loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); var request:URLRequest = new URLRequest(url); if(args.length0){ var variables:URLVariables = new URLVariables(); for (var i:int = 0; i args.length; i++) { variables[args[i][0]] = args[i][1]; } request.method = URLRequestMethod.POST; request.data = variables; loader.dataFormat = URLLoaderDataFormat.VARIABLES; } try{ loader.load(request); } catch (error:Error) { trace(Unable to load URL); dispatchEvent(new Event(error, true)); } }//end CONSTRUCTOR private function loaderCompleteHandler (e:Event):void { trace( loader.data ); dispatchEvent(new Event(loaded, true)); }//end loaderCompleteHandler }//end class }//end package HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:55 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
RE: [Flashcoders] can't get e.target.data
Yes, THANKS TO WILLEM !!! :-) Best regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 10:18 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Ah ok, I see. Nice! Best, Karl On Oct 8, 2011, at 3:09 AM, Cor wrote: I do it like this: (Thanks to Willem!) /* //usage var myPHP_Loader = new PHP_Loader(myPhpFile.php, [val1, Value 1], [val2, Value 2]); myPHP_Loader.addEventListener(loaded, myPHP_LoaderLoadedHandler); function myPHP_LoaderLoadedHandler(e:Event):void { trace(e.target.loader.data[a]); } //myPhpFile.php ?php $val1= $_POST['val1']; $val2= $_POST['val2']; //... do something with these values. echo 'a='; echo $val1+$val2; ? */ package { import flash.display.*; import flash.net.*; import flash.events.*; public class PHP_Loader extends Loader { public var loader:URLLoader = new URLLoader(); public function PHP_Loader(url:String, ...args){ loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); var request:URLRequest = new URLRequest(url); if(args.length0){ var variables:URLVariables = new URLVariables(); for (var i:int = 0; i args.length; i++) { variables[args[i][0]] = args[i][1]; } request.method = URLRequestMethod.POST; request.data = variables; loader.dataFormat = URLLoaderDataFormat.VARIABLES; } try{ loader.load(request); } catch (error:Error) { trace(Unable to load URL); dispatchEvent(new Event(error, true)); } }//end CONSTRUCTOR private function loaderCompleteHandler (e:Event):void { trace( loader.data ); dispatchEvent(new Event(loaded, true)); }//end loaderCompleteHandler }//end class }//end package HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:55 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
Yes, thank you Willem! Karl On Oct 8, 2011, at 3:20 AM, Cor wrote: Yes, THANKS TO WILLEM !!! :-) Best regards, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 10:18 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Ah ok, I see. Nice! Best, Karl On Oct 8, 2011, at 3:09 AM, Cor wrote: I do it like this: (Thanks to Willem!) /* //usage var myPHP_Loader = new PHP_Loader(myPhpFile.php, [val1, Value 1], [val2, Value 2]); myPHP_Loader.addEventListener(loaded, myPHP_LoaderLoadedHandler); function myPHP_LoaderLoadedHandler(e:Event):void { trace(e.target.loader.data[a]); } //myPhpFile.php ?php $val1= $_POST['val1']; $val2= $_POST['val2']; //... do something with these values. echo 'a='; echo $val1+$val2; ? */ package { import flash.display.*; import flash.net.*; import flash.events.*; public class PHP_Loader extends Loader { public var loader:URLLoader = new URLLoader(); public function PHP_Loader(url:String, ...args){ loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); var request:URLRequest = new URLRequest(url); if(args.length0){ var variables:URLVariables = new URLVariables(); for (var i:int = 0; i args.length; i++) { variables[args[i][0]] = args[i][1]; } request.method = URLRequestMethod.POST; request.data = variables; loader.dataFormat = URLLoaderDataFormat.VARIABLES; } try{ loader.load(request); } catch (error:Error) { trace(Unable to load URL); dispatchEvent(new Event(error, true)); } }//end CONSTRUCTOR private function loaderCompleteHandler (e:Event):void { trace( loader.data ); dispatchEvent(new Event(loaded, true)); }//end loaderCompleteHandler }//end class }//end package HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:55 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I'm also not to entirely sure you should use var variables: having a var named variables might be a back-end no-no (I think) The whole reserved names thingy.. Karl On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/ flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
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
Re: [Flashcoders] can't get e.target.data
From: Cor c...@chello.nl To: 'Flash Coders List' flashcoders@chattyfig.figleaf.com Sent: Saturday, October 8, 2011 3:49 AM Subject: RE: [Flashcoders] can't get e.target.data Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py?id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. And I have had a plethora of problems with it. If you had read my original post you would have seen URLVars commented out with my comment that it didn't work yet again. Yes, I tried: var str:String = new String(); str = e.target.data Again, it works just fine **if** the var is called id but **if** the var is called pkg or anything else I came up with it pukes in my face. I just love Flash. John -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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 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 Karl
Re: [Flashcoders] can't get e.target.data
From: Karl DeSaulniers k...@designdrumm.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, October 8, 2011 4:16 AM Subject: Re: [Flashcoders] can't get e.target.data Excuse me if my AS3 is not entirely correct, but wouldn't this be more of what your trying to do? ... var req:URLRequest = new URLRequest(); var post_vars:URLVariables = new URLVariables(id, pkg); loader.dataFormat = URLLoaderDataFormat.VARIABLES; req.method = URLRequestMethod.POST; req.url = + siteUrl + store/flash_store2.py; post_vars.id = id; post_vars.pkg = pkgID; req.data = post_vars; loader.send(req.url, req.method, req.data); loader.addEventListener(Event.COMPLETE, onSendComplete); } I had this: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py); 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); and sometimes it works, and sometimes it doesn't. John On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
Hi John, Well, I see here that your declaring your id and pkg twice. once in the url ?id= + id + pkg= + pkgID and then again in the req.data variables.pkg = pkgID; variables.id = id; req.data = variables; but both are being sent to siteUrl + store/flash_store2.py maybe take out the ?+vars in the url and only declare the id and pkg vars in req.data ?? Not to mention that you declare id first in the url and second in the req.data. I work with php and I know that the order in which my vars are sent makes a difference. And I only declare them once when sending. Otherwise it might get overwritten with a empty string. HTH, Karl On Oct 8, 2011, at 9:40 AM, John Polk wrote: From: Karl DeSaulniers k...@designdrumm.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, October 8, 2011 4:16 AM Subject: Re: [Flashcoders] can't get e.target.data Excuse me if my AS3 is not entirely correct, but wouldn't this be more of what your trying to do? ... var req:URLRequest = new URLRequest(); var post_vars:URLVariables = new URLVariables(id, pkg); loader.dataFormat = URLLoaderDataFormat.VARIABLES; req.method = URLRequestMethod.POST; req.url = + siteUrl + store/flash_store2.py; post_vars.id = id; post_vars.pkg = pkgID; req.data = post_vars; loader.send(req.url, req.method, req.data); loader.addEventListener(Event.COMPLETE, onSendComplete); } I had this: var req:URLRequest = new URLRequest(siteUrl + store/ flash_store2.py); 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); and sometimes it works, and sometimes it doesn't. John On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
Please ignore that last comment about double declaration. I didn't notice the comment marks /**/ On Oct 8, 2011, at 9:40 AM, John Polk wrote: From: Karl DeSaulniers k...@designdrumm.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, October 8, 2011 4:16 AM Subject: Re: [Flashcoders] can't get e.target.data Excuse me if my AS3 is not entirely correct, but wouldn't this be more of what your trying to do? ... var req:URLRequest = new URLRequest(); var post_vars:URLVariables = new URLVariables(id, pkg); loader.dataFormat = URLLoaderDataFormat.VARIABLES; req.method = URLRequestMethod.POST; req.url = + siteUrl + store/flash_store2.py; post_vars.id = id; post_vars.pkg = pkgID; req.data = post_vars; loader.send(req.url, req.method, req.data); loader.addEventListener(Event.COMPLETE, onSendComplete); } I had this: var req:URLRequest = new URLRequest(siteUrl + store/ flash_store2.py); 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); and sometimes it works, and sometimes it doesn't. John On Oct 8, 2011, at 2:49 AM, Cor wrote: Not sure, but by doing: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py? id= + id + pkg= + pkgID); doesn't this overwrite the posting of the URLVariables? I use URLVariables all the time and never have any problem. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:45 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data I think the other way he was doing it is supposed to be like this.. var str:String = new String(); str = e.target.data; Yes? Karl On Oct 8, 2011, at 2:39 AM, Cor wrote: yes -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: zaterdag 8 oktober 2011 9:38 To: Flash Coders List Subject: Re: [Flashcoders] can't get e.target.data Well then wouldn't.. var str:String = e.target.data; work? Karl On Oct 8, 2011, at 2:31 AM, Ross Sclafani wrote: Has to be. Ross P. Sclafani Design | Technology | Creative 347.204.5714 http://ross.sclafani.net http://www.twitter.com/rosssclafani On Oct 8, 2011, at 3:25 AM, Cor c...@chello.nl wrote: 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
Re: [Flashcoders] can't get e.target.data
How do I trouble-shoot this? I suggest adding a trace() to see what the requested URL is, and to check that it's well formed. Change this… var req:URLRequest = new URLRequest(siteUrl + store/ flash_store2.py?id= + id + pkg= + pkgID); …to this: var url:String = siteUrl + store/flash_store2.py?id= + id + pkg= + pkgID; trace(url); var req:URLRequest = new URLRequest(url); For good measure, also trace the url as stored by the URLRequest to ensure it's the same: trace(req.url); 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. What does the URL look like in this case? Is it well formed? And if you simply paste the url into your browser's address bar, does the browser show --? -Gerry ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] can't get e.target.data
I think you may need to look at what your Python script is doing. It may not be set up to handle default values in the case of missing data. jord On Oct 8, 2011, at 10:40 AM, John Polk wrote: I had this: var req:URLRequest = new URLRequest(siteUrl + store/flash_store2.py); 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); and sometimes it works, and sometimes it doesn't. Jordan L. Chilcott Interactivity Unlimited / J J Photography Guelph, Ontario - Tel: (519) 837-1879 Fax: (519) 837-8610 mailto:jchilc...@interactivityunlimited.com http://www.interactivityunlimited.com iChat/AIM: j1chilcott Skype: bear-faced-cow Author: Building Web Sites with Macromedia Studio MX Author: Building Dynamic Web Sites with Macromedia Studio MX Author: Flash Professional 8: Training From the Source Author: Foundation Flash 8 Video ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
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