I have been grappling with this problem for days now. I want
to set two variables in a SWF and have them passed to FlashVars PHP
page. I can get it to work when I just send one variable with this
code:
function loaderComplete(myEvent:Event)
{
var flashVars=this.loaderInfo.parameters;
UserNameTextField.text=flashVars.UserName;
}
this.loaderInfo.addEventListener(Event.COMPLETE,
loaderComplete)
And FlashVars passes the variable correctly to the PHP page.
When I add another variable to the ActionScript like this:
function loaderComplete(myEvent:Event)
{
var flashVars=this.loaderInfo.parameters;
CompanyNameTextField.text=flashVars.CompanyName;
UserNameTextField.text=flashVars.UserName;
}
this.loaderInfo.addEventListener(Event.COMPLETE,
loaderComplete)
I get the following error:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at swf_fla::MainTimeline/loaderComplete()
I have no idea of how to correct this being a novice at
Flash.
If some kind soul would correct the above code, I would be
very grateful.
Thanks in advance for your help - Sam