Welcome

how would you rate The Holy Qura'an - Arabic ver?

Saturday, March 12, 2011

Passing parameters from HTML to swf(Flash Builder) AS3

I spent countless hours to get this done. Pulled my hair broke my glasses and kicked out my cat all because of lack of finding the right directions on how to get it done.

simple as this:

your flex file is ready! OK



private var in1:String;
private function initHandler():void {
var obj:Object = this.parameters;
in1= obj.name;
Alert.show("OK " + in1);
}


There goes the flex file
Now, when you publish your project using the project>Export Release Build... you need to edit the exported html file (it should be under the same name as your project). So go and edit it


Find the line



//within the 3rd [script] and after (REPLACE [ WITH < )
var xiSwfUrlStr = "playerProductInstall.swf";
//add this line
flashvars.in1= "WELCOME"; // don't forget ;
var ver= {};
var params = {};

//then you will have [nonscript][object]
//add


//then another[object]
//add



THAT'S IT :D

2 comments:

  1. Assalaam-u-Alaikum,

    I saw your app on my friend's android phone. Do you have it ready for iPhone as well ? how can I get it on my iPhone?

    Thanks
    Abuarqam

    ReplyDelete
  2. Assalaam-u-Alaikum,

    I saw your app on my friend's android phone. Do you have it ready for iPhone as well ? how can I get it on my iPhone?

    Thanks
    Abuarqam

    ReplyDelete