Flex side
Public Function Initapp (): void
{
Externalinterface.addcallback ("Function1", callback1);
}
Public Function Callback1 (): void
{
Alert.show ("Hello word");
}
JS End
function JavaScript ()
{
document.getElementById ("Dome1"). Function1 ();
}
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"//html-template has this ID number.
Id= "Dome1" width= "100%" height= "500"
codebase= "Http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" >
<param name= "movie" value= "swf/bin-debug/index.swf"/>//in ASP. NET project folder and copy all the files in the Bindebug
<param name= "Quality" value= "High"/>
<param name= "bgcolor" value= "#869ca7"/>
<param name= "Menu" value= "false"/>
<param name= "allowscriptaccess" value= "Samedomain"/>
</object>
<button id = "testswf" name = "ceshiswf" onclick = "javaScript ()"/>
Note: If you call external images or video files inside a flex program, be sure to unify the path with the path called in Flex
Flex Learning (method of calling Flex in JS)