actionscript 3 - Getting swf boolean parameters -



actionscript 3 - Getting swf boolean parameters -

i have swf phone call as

/swfuploader/upload.swf?single=true

then in actionscript 3 read in value. it's not working. here's test code (the first block taken http://blogs.adobe.com/pdehaan/2006/07/using_flashvars_with_actionscr.html ):

var keystr:string; var valuestr:string; var paramobj:object = loaderinfo(this.root.loaderinfo).parameters; (keystr in paramobj) { valuestr = string(paramobj[keystr]); trace(keystr + " = " + valuestr); } var issingle:boolean = this.loaderinfo.parameters.single boolean; var issingle1:boolean = this.loaderinfo.parameters['single'] boolean; var issingle2:boolean = loaderinfo(this.root.loaderinfo).parameters['single'] boolean; var issingle3:boolean = loaderinfo(this.root.loaderinfo).parameters.single boolean; trace(issingle + ", " + issingle1 + ", " + issingle2 + ", " + issingle3);

and frustratingly resulting 2 lines traced:

single = true false, false, false, false

what doing wrong?

in actionscript not empty , not null string casted boolean true.

var singlestr:string = this.loaderinfo.parameters.single; var singlebool:boolean = singlestr == "true";

actionscript-3 actionscript parameters loaderinfo

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -