I have the following code and it does not print the value which I want to pass from javascript. I appreciate if some one can point out the error I have made.
HTML I edited the code in the template.html as follows to include the IP=test and IP=192.168.11.2 as follows
<param name="flashvars" value="IP=Test" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}" flashVars="IP=192.168.11.2">
<param name="quality" value="high" />
<param name="bgcolor" value="${bgcolor}" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name='flashVars' value='IP=192.168.11.2'/>
My flex code is as follows
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
layout="absolute" viewSourceURL="srcview/index.html" creationComplete="{init();}">
<mx:Script><![CDATA[
[Bindable] private var ip_string:String;
private function init():void {
ip_string = Application.application.parameters.IP;
iplabel.text = ip_string;
}
]]>
</mx:Script>
<mx:Panel id="namePanel" width="1257" height="168" layout="absolute" alpha="1" roundedBottomCorners="true" borderStyle="none" cornerRadius="4" horizontalAlign="center" verticalAlign="middle" backgroundColor="#001e2a18" horizontalCenter="-136" verticalCenter="-411" fontSize="15" backgroundAlpha="0" color="#003e1e1e" themeColor="16316412">
<mx:Label x="21" y="5" text="UBI-Collage Gallery" width="1197" height="67.95" alpha="1" styleName="MyTextStyle" fontFamily="woodcut" fontSize="60" color="#00090908" textAlign="center" fontWeight="normal"/>
<mx:Label id="iplabel" x="90" y="85" styleName="codeStyle" textAlign="center" color="#00000000" fontFamily="woodcut" fontSize="32" text="IP"/>
</mx:Panel>
</mx:Application>
Changing the embedding code as follows did the trick.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="index" width="1550" height="1030"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"
align="middle">
<param name="movie" value="UbiPictureViewer.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="UbiCollage.swf" quality="high" bgcolor="#869ca7"
width="1550" height="1030" name="index" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
flashVars="IP=<%=IP %>"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>