width="650" height="420" creationComplete="initApp()">
.style{ padding:5;}
Flex Alert!!");
valueFromJavascript.text= s;
}
// Action Script 中调用 Javascript
private function sendToJavascript():void
{
ExternalInterface.call("getFromFlex", valueFromJavascript.text);
}
//回调函数
private function setupCallbacks():void
{
ExternalInterface.addCallback("callFromJavascript" ,callFromJavascript);
}
]]>
width="350" height="200">
Flex" />
width", "650",
"height", "420",
"align", "middle",
"id", "FlexJavascript",
"quality", "high",
"bgcolor", "#869ca7",
"name", "FlexJavascript",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "FlexJavascript",
"width", "650",
"height", "420",
"align", "middle",
"id", "FlexJavascript",
"quality", "high",
"bgcolor", "#869ca7",
"name", "FlexJavascript",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ 'Get Flash';
document.write(alternateContent); // insert non-flash content
}
// -->
width="650" height="420"
codebase="http://fpdownload.macromedia.com/get/fla shplayer/current/swflash.cab">
width="650" height="420" name="FlexJavascript"
align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplaye r">
function getFromFlex(s)
{
alert(s.toString());
}
//发送到Flex
function sendToFlex()
{
thisMovie("FlexJavascript").callFromJavascript
(document.form1.valueForFlex.value);
}
function thisMovie(movieName)
{
if(navigator.appName.indexOf("Microsoft")!=-1)
{
return window[movieName];
}
else
{
return document[movieName];
}
}