Passing variable to flash

what i’m trying to do is to pass a value to a flash from html page…
(from html to __nameSWFVariable)
following is my code :

in html :

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,28,0" width="600" height="710">
            <param name="movie" value="lightning.swf?name=John" />
            <param name="quality" value="high" />
            <embed src="lightning.swf?name=John" quality="high" pluginspage="" type="application/x-shockwave-flash" width="600" height="710"></embed>

in flash(lightning.swf) :

var __nameSWFVariable:String;
__nameSWFVariable = ‘name’;

[Inspectable(type=“String”, defaultValue="")]
public function set nameSWFVariable(nameSWFVariable:String):void {
__nameSWFVariable = nameSWFVariable;

public function get nameSWFVariable():String {
return __nameSWFVariable;

am i doing the right thing ?