I am trying to figure out how to pass a string value (url) from an html form to an inline flex object. the only method I have found so far is the "addCallback" method described in http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_5.html
In the example, I used the flex function " myFunc (s: String) "is registered in" ExternalInterface "and called later from javascript
---> mySwf.mxml:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()">
<mx:Script>
import flash.external.*;
import mx.controls.Alert;
public function initApp():void {
ExternalInterface.addCallback("myFlexFunction",myFunc);
}
public function myFunc(s:String):void {
Alert.show(s, 'Alert Box', mx.controls.Alert.OK);
}
</mx:Script>
<mx:Button id="myButton"
label="FLEX BUTTON"
click="Alert.show('FLEX LOADED!', 'Alert Box', mx.controls.Alert.OK);"/>
<mx:Label id="l1"/>
</mx:Application>
external.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<SCRIPT LANGUAGE="JavaScript">
function callApp() {
mySwf.myFlexFunction("show me something");
}
</SCRIPT>
<form id="f1">
<button onClick="callApp()">HTML BUTTON</button>
</form>
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
WIDTH="850"
HEIGHT="610"
CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
<EMBED SRC="mySwf.swf"
WIDTH="850"
HEIGHT="610"
PLAY="true"
LOOP="true"
QUALITY="high"
scale="noborder"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</html>
, , . Flex, Flex. HTML, myFunc Flex ExternalInterface -
... ?
,