문제

function showAlert():void
{
    var alert:URLRequest = new URLRequest("javascript:alert('Please enter your User name')");
    navigateToURL(alert, "");
}

I can't see the alert box (pop-up) after clicking button. What is the source of the problem? Even if I tried 3 different browser it doesn't work.

도움이 되었습니까?

해결책

ExternalInterface is the standard way of communicating between AS3 and JS (see documentation):

import flash.external.ExternalInterface;

function showAlert() 
{
    // Check ExternalInterface is available
    if (ExternalInterface.available) 
    {
        ExternalInterface.call("alert", "Please enter your User name");
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top