I am calling my Main.swf from localhost Xampp which contains a prompt button upon click of that button promptclick function is called
AS3 code
function promptClick(event:MouseEvent):void
{
var desiredURL:URLRequest = new URLRequest("javascript:NewWindow=window.open('save.html','newWin','width=600,height=400,left =0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");
navigateToURL(desiredURL, "_self");
}
this window (newwin) has a button “Accept” defined in “save.html” , upon click of Accept button the data should be send to calling Main.swf.
I am not able to make a call from javascript window to my Main.swf function
through externalInterface callback in AS3
I have found that when i embed Main.swf on the same window which contains my editor it works(externalInterface call to Actionscript), but i don’t want to embed swf on editor page
Is there any way i can make call to from javascript window to swf directly without embedding?
Your code should be calling a javascript function which is defined outside. Example:
Javascript file:
Now change UrlRequest source to something like
"javascript: getFormWindow();"or
"javascript: getFormWindow('save.html', 'saveWin');"and it is all handled from there simplifying your actionscript and javascript code and making it more dynamic.