A
A
Alex Mustdie2015-06-09 16:23:01
Adobe Flash
Alex Mustdie, 2015-06-09 16:23:01

Does Alert exist in AS3?

Good day.
The question seems to be quite simple: is it possible to show some kind of alert box in AS3? I googled it and didn't find anything worthwhile.
Seeing a large piece of code on such an empty question (after alert('hello world') in js) is unusual for me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
copal, 2015-06-09
@alexmustdie

The ExternalInterface serves as a bridge between flash and js . Only works in the browser, since there is no window object locally whose method is allert .
And I know that you write in frames, and that is why I emphasize that you should only be interested in the code in the constructor. I don't write in frames.

package
{
  import flash.display.Sprite;
  import flash.external.ExternalInterface;
  
  public class Main extends Sprite 
  {
    public function Main() 
    {
      if (ExternalInterface.available) 
      {
        ExternalInterface.call('alert', 'HelloWorld');
      }
    }
  }
  
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question