calling Javascript in Flex
hi
have mxml file has button control
<mx:button id="toggle" label="test" click="togglebutton()" />
when click on button want call javascript function. in mxml script have
public function togglebutton(): void
{
var f:string = "jstogglebutton";
var m:string = "this works";
var check:string;
if(externalinterface.available)
{
externalinterface.call(f,m);
check = "true"
}
else
{
check="false";
}
trace(check);
}
]]>
now created text file rightclicking on assets(the folder created) folder in project , new-->file.
i have written javascript in file , named javascripttoggle.html
this file has following code
<script language="javascript">
function jstogglebutton(m)
{
alert(m);
}
</script>
it not seem show alert box trace shows true externalinterface.available.
am missing important?????
i new flex. might simple of them. please bear me.
have mxml file has button control
<mx:button id="toggle" label="test" click="togglebutton()" />
when click on button want call javascript function. in mxml script have
public function togglebutton(): void
{
var f:string = "jstogglebutton";
var m:string = "this works";
var check:string;
if(externalinterface.available)
{
externalinterface.call(f,m);
check = "true"
}
else
{
check="false";
}
trace(check);
}
]]>
now created text file rightclicking on assets(the folder created) folder in project , new-->file.
i have written javascript in file , named javascripttoggle.html
this file has following code
<script language="javascript">
function jstogglebutton(m)
{
alert(m);
}
</script>
it not seem show alert box trace shows true externalinterface.available.
am missing important?????
i new flex. might simple of them. please bear me.
is javascript file included same html document swf embedded into?
if using flex builder might mean changing index.template.html file javascript function somewhere wihtin file
if using flex builder might mean changing index.template.html file javascript function somewhere wihtin file
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment