Hello,
I need to pass a PHP variable valye($username) as flashvars to my swf. I have already referred to an earlier post in the forum and coded accordingly. But I have problems:-
My TestFlashVars.php file is:-
PHP Code:
<?php
$username="Harshada";
print "
<html>
<head>
<title>Test Flashvars</title>
</head>
<body scroll='no'>
<table width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td valign='top'>
<h1>Simplest FlashVarTest Wrapper</h1>
<object id='mySwf' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' height='100%' width='100%'>
<param name='src' value='UseFlashVars.swf'/>
<param name='flashVars' value=\"$username\"/>
<embed name='mySwf' src='UseFlashVars.swf' pluginspage='http://www.adobe.com/go/getflashplayer' height='100%' width='100%' FlashVars=\"$username\"/>
</object>
</td></tr></table>
</body>
</html>"
?>
This file gets loaded but I am not able to get the value in my swf.. My swf code is:-
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initVars()">
<mx:Text x="45" y="52" text="Text" width="208" height="39" id="txt1"/>
<mx:Script>
<![CDATA[
[Bindable]
public var userName:String;
private function initVars():void {
userName = Application.application.parameters.username;
txt1.text = userName;
}
]]>
</mx:Script>
</mx:Application>
What am I missing?
