Link to home
Start Free TrialLog in
Avatar of tia_kamakshi
tia_kamakshiFlag for United Arab Emirates

asked on

Message Box in flash file

Hi,

How do we show messagebox or alert in flash action scripting 3.0 likewise in javascript alert("hi");

Message box will help me debugging my code when checking my code on website , if there is any issue else it is hard to debug my .swf file where error is coming

Please suggest

Many Thanks
ASKER CERTIFIED SOLUTION
Avatar of Carnou
Carnou
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tia_kamakshi

ASKER

trace will work only when I am running my swf file within flash debugging mode. I can see trace results in output window

But trace will not work when I copy my .swf file to my website, then identifying the problem is real tuff.

so, I wanted to place alert one by one to see where my code is failing when moved to server.

Please suggest better way of debugging to the server

Many Thanks

My suggestions still hold. Just google "as3 alert" and you'll see lots of ways to do what you want. From experience, I can tell you that the easiest thing is to put a text box on the stage and write to that. It can look ugly. Just take it out when you're done debugging.

Also, if you search enough, you will find there is a way, using the Flag debug plug-in, to actually get IE to log all trace statements that a swf emit.
MonsterDebugger is a great tool to have when it comes to debugging Flash content.  You should check it out.  ;)
   http://www.monsterdebugger.com/

The simplest but less obtrusive way would be calling JavaScript's console.log(msg) from ActionScript via ExternalInterface and check it in Firebug or something.

CyanBlue
if you just want to call a javascript function with an alert you can call the function from as3 with
an external interface call

ExternalInterface.call("javascript_function");
»also if you use an external interface call make sure you have the import - forgot to mention that

import flash.external.ExternalInterface;


here is the adobe link on external interface
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6