Sathis Jo
Sathis Jo

Reputation: 21

How to create alert popup window in flash CS5.5 Actionscript 3.0?

I am using flash CS5.5. I want create alert popup window in flash. When I publish LMS Meanwhile Google Chrome or Interenet Expoler used so i need to popup message.

This My code:

import flash.external.ExternalInterface; //for invoking JavaScript in 

alert_btn.addEventListener(MouseEvent.CLICK, btnExitHandler);

function btnExitHandler(e:Event):void 
{
    ExternalInterface.call("closeCourseWindow");
}

This is my code.. What am I doing wrong?

Upvotes: 0

Views: 920

Answers (1)

George G
George G

Reputation: 7695

It's hard to guess what's going on without any error message, but I'll give some tips, that may be causing the problem:

First make sure you allow ActionScript to access the javascript by setting allowscriptaccess with value always

<param name="allowscriptaccess" value="always"/>

If that's not the case make sure method exists closeCourseWindow and it does not behave strange.

Always use flash debugger to help you catch and solve the problems easily

To allow ActionScript access the JavaScript interface on file system, goto: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html select Always allow option, and reload the page where your alert box should work.

Upvotes: 1

Related Questions