JavaScript alert in AS3 or AS2 to debug the external actionscript file

Hi,
Is there any way to debug the external AS file as i dont want to use "trace".
I have an idea to use the input text field the check the variable/function is working right but this is not enough so is there any process in AS2 or AS3.
Thanks in advance..

my mistake ..i have used there dynamic textfiled.
but i got a easy solution by using
getURL ("javascript:alert('Testing');");
but this is not the good solution
is there any way to import the alert contolls in AS2
like i have read somewhere
import mx.controls.Alert;
Please reply..

Similar Messages

  • Load and unload the external swf file using AS3(for window, IOS and android)

    For the external swf file loading, I use this code
    load2.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
    function newvid(event:MouseEvent) {
              trace("you clicked me");
              var loadit = new Loader();
              addChild(loadit);
        var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
        loadit.load(new URLRequest("scene02.swf"), _lc);
    its working great but I don’t know how to unload the loaded swf files (looking: unload one by one and unload all)
    in AS2 we have
    on (release) {
              loadMovieNum("scene2.swf", 1);
              unloadMovieNum(2);
              unloadMovieNum(3);
    but i need in AS3

    Now I use this code and this time I got these compiler errors
    package {
                    import flash.display.SimpleButton;
                    import flash.display.MovieClip;
                    import flash.events.MouseEvent;
                    //import flash.display.URLRequest;
                    //import flash.display.Loader;
                    import flash.events.Event;
                    import flash.system.ApplicationDomain;
                    import flash.net.URLRequest;
                    import flash.system.LoaderContext;            
                                    public class load1 extends SimpleButton {
                                                    var loadit:Loader;              
                                                    public function load1() {
                                                                    this.addEventListener(MouseEvent.MOUSE_DOWN, loadfile);
                                                    private function loadfile(event:MouseEvent):void {
                                                                    trace("you clicked me");
                                                                    loadit = new Loader();
                                                                    this.parent.addChild(loadit);
                                                                    var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                                                                    loadit.load(new URLRequest("s01.swf"), _lc);
                                                    private function unloadfile(event:MouseEvent):void {
                                                                    loadit.unloadAndStop();

  • Is it possible to embed JavaScript functions into a Flash file (AS 3.0) and call within flash itself, without using the external .js file

    Scenario:
    I have a text area in flash. The user will copy paste any JavaScript  function in the text area and click execute button. The JavaScript function pasted in the text area should be executed with in the flash itself and the return value will be shown in another text field.

    yes,
    function testF(s:String):XML{
        var js:XML = <script>
        <![CDATA[
        ]]>
        </script>
        js.appendChild(XML(s));
        return js;
    ExternalInterface.call(testF(your_tf.text));

  • Javascript Alert

    How do I replicate the following AS2 function in AS3 completely in Flash WITHOUT writing any external javascript
    myBtn_btn.onRelease = function(){
    getURL("javascript:alert('you clicked me')");
    I know about the ExternalInterface option, but again I need to do this without creating/changing any external Javascript code.
    Thanks

    A slight tweak on kglads code to make it work with the security restrictions of the newest players.
    myBtn_btn.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void {
         ExternalInterface.call("alert","you clicked me");
    This works without putting any JS code on the HTML page because the alert() function is native to JS.
    Also, if you want to do more elaborate things (custom functions, etc) - here is a tutorial on JS script injection with AS3:
    http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in- ActionScript-3/Page1.html

  • How do i save the source code of a javascript alert in safari?

    I am trying to save the source code of the javascript alert in safari but the menu items blank out.
    Is this even possible?
    dave

    Eventhought it is a usefull function which i did not know about it is not helping me. This is what hapens.
    I request an url and get a javascript alert back from the server. The javascript alert triggers that is i get a popup where I can only press ok. If i do not press ok i can not do anything else. the safari menu's are greyed out. if i do press ok i get redirected and i can not read the javascript page with your suggestion.
    what i want is read the source for that javascript alert so i know what it says (my filemaker database that is) but because that option is greyed out i am stuck.
    here is the link i use to get the javascript popup:
    https://www.login.alex.nl/klanten/portfolio/portefeuille-xls.asp?print=true
    the javascript says i am not loged in.
    if i get this javascript alert in firefox i can ask for the sourcecode, read it and do stuff that is log in. I just do not understand how i can change safari so it does the same thing as firefox.
    thanks again

  • How to show javascript alert popup after commandLink action?

    Hi,
    I'm building an ADF-based .jspx page. I have a commandLink whose action calls a method in my page's backing bean. I want to show a javascript alert popup when the commandLink is clicked and after the backing bean method has been called. The text displayed in the alert popup is dependent on whether the processing in the method was successful or not.
    I couldn't figure out how this could be done though. It doesn't seem I can use the onClick attribute on the commandLink because that gets called before my backing bean method gets called. From my backing bean method, is there some way to launch a javascript alert popup and show certain text in it based on what happened in the method?
    Thanks for any ideas.

    Hello and thank you for your reply,
    I am trying to combine dwr and ADF.
    When I use the following code to grasp the input value from the user
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding expr = fc.getApplication().createValueBinding("#{bindings['LIMARXESPORTCODE_bindVariable2'].inputValue}");
    setLIMARXESPORTCODEbindVariable( expr.getValue(fc).toString() );
    in order to use it as a dynamic bind variable to the where clause of the following query:
    vo.setWhereClause("LIMARXESPORTCODE = :LIMARXESPORTCODE_bindVariable");
    vo.defineNamedWhereClauseParam("LIMARXESPORTCODE_bindVariable", null, null);
    vo.setNamedWhereClauseParam("LIMARXESPORTCODE_bindVariable", LIMARXESPORTCODEbindVariable );
    executeAndShowResults(vo);
    in the backing bean java code. All I get as an output from a javascript alert window is null.
    However, when the bean member variable LIMARXESPORTCODEbindVariable has a
    hard coded, static value i.e. LIMARXESPORTCODEbindVariable = 111; and the first code snippet is commented out, everything works just fine!
    Any hint is welcome,
    T I A.

  • Javascript alert box due to inactivity

    Can anyone give me an example how to use javascript to display an alert box after a certain time of inactivity?

    After drag it is not going to "String name=request.getParameter("fname")".....i
    debugged and confirmed this.
    A similar issue was reported in IE9 also. Please find the link for more details
    https://connect.microsoft.com/IE/feedback/details/793230/javascript-alert-box-duplicated-if-moved-ie-9

  • OBIEE 11g: Dashboard not invoking simple javascript alert

    Hi Experts,
    I'm trying to invoke one simple ALERT command with javascript in obiee 11g dashboard. The purpose is when it loads, it should print one ALERT message and also when we change something in the prompt and clicking Apply button.
    Here is code written in a text item (Checked html markup option) after prompts;
    <script language="Javascript">
    alert ("Hello");
    </script>
    The Javascript alert message is showing when the dashboard page loads, but its not coming when we click the Apply button after changing the prompts.
    Can anyone give helpful hint, how to check it and why its not showing up when we press Apply button?
    Any hint or some useful links will b highly appreciated.
    Thanks in advance.

    You just used code and I would say the default event is onload of the page, thats the reason you are able to see alert.
    Since you didnt ask or written code onClick event to show alert, its not showing.
    You need to tell to browser when to prompt alert message instead of onload.
    Hope you are more confuse about 'how to do'
    if yes, mark :)
    give some more info about your actual req. that helps any other gurus to help.
    Edited by: Srini VEERAVALLI on Mar 27, 2013 8:42 AM

  • Javascript alert boxes are wrapped in Windows 7 with IE 8

    I can't count the number of JavaScript alert boxes I have throughout my systems and they have always made the transition between IE browsers from 6 to 8 without a hitch.  Without a hitch until I setup my first Windows 7 machine.  It is a 64 system that has both 32 & 64 bit IE browsers.
    It doesn't matter which of the two versions I use, the JavaScript messages that I have so carefully crafted with just the proper layout are now wrapped.  The resultant text in the new W7 popups is almost unintelligible because it is so badly scrambled/wrapped on the new white background.
    Since an alert box is simplicty itself, there is no way that I can think of to change the inherent size of the box.
    Has anyone else notice this phenomena???   If so, do you have a way around it short of redoing all of the text in the effected boxes???
    Len
    XP machine's JavaScript Alert popup in IE 8
    W7 machine's JavaScript Alert popup in IE 8 with wrapped text

    HMM I have the same problem. My researches suggest that the Zone.Identifier ADS is still being used for the internet zone, but not the Intranet zone. I too can get an intranet location out of IE, but not by querying Zone.Identifier eg using Powershell. This
    issue is present in XP as well as Win 7. It appears to extend to trusted zone ids.
    One hypothesis is that this is being stored in hidden form to prevent zone ids that decrease security being applied by malware.
    I had thought that maybe the intranet zone id was only present during download - but your experiment suggests otherwise.

  • JavaScript Alert functionality in PL/SQL

    I'm in need of implementing the JavaScript "Alert" functionality (display message and wait for user to acknowledge) in the "before displaying the page" PL/SQL block of portal reports and forms. While I'm at it - How about the JavaScript "history.back" function as well?
    Is this possible? Can you point me in the right direction.

    Hi,
    Where Portal says "before displaying the page" what it means is that it will run this code before it starts to htp.p() out the HTML of the page.
    In WebDB this was actually what happened, in Portal there are some elements of HTML output BEFORE this block of code is run.
    Anyway I don't think that you can have an alert that displays before the page is loaded. The page will still show behind the alert.
    To get around this you would need a blank page to show your alert that forwards you on to the required page.
    The history function can be called by the onclick event of a button or you can access Javascript through an anchor tag:-
    link text
    Regards Michael

  • How to verify JavaScript alert message display on page with C#?

    Hi All,
    I have a question about verify the JavaScript alert message on page. For example, I input the script in browser address like: "javascript:onmouseover=alert('popup windows')" . How to verify there's a alert message displayed on page with C#?
    Thanks

    Are you trying to use some automation or ? What the previous solution is they have put the text in the dom for you to pull out with C# or other languages.
    if you are trying to automate this through a browser maybe look into WebDriver
    WebDriverWait wait = new WebDriverWait(driver, 2);
    wait.until(ExpectedConditions.alertIsPresent());
    Alert alert = driver.switchTo().alert(); var alertText = alert.Text;
    alert.accept();

  • Not able to display javascript alert message from within a pl/sql block

    Hello,
    Can anyone please help me out with this issue. I wanted to display an javascript alert message from within a pl/sql block for an update button. Below is sample code which i am using. P1_ITEM is my hidden item on the report.
    begin
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    and I have made this code to be executed conditionally when request = Expression1
    Expression1: SUBMIT
    The thing is I am not able to display an alert message when the update button is clicked.
    Can anyone please help me with this one.
    Thanks,
    Orton

    varad but I also have an update statement within that block for the update button something like this i want to achieve.
    begin
    if :P1_ITEM IS NULL THEN
    update sample_tbl
    set col1 =:APP_USER,
    col2 = 'Y'
    where pk_col = ---;
    commit;
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Successfully assigned an item!'');');
    HTP.p ('</script>');
    end if;
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    thanks,
    Orton

  • Change font size in Javascript alert.

    Hi All,
    Is there any way to change the font size in a Javascript
    alert box?

    Not that I know of.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "JED" <[email protected]> wrote in message
    news:edec72$ccv$[email protected]..
    > Hi All,
    >
    > Is there any way to change the font size in a Javascript
    alert box?
    >

  • Javascript Alert on download setup

    I just purchased Adobe Elements 6.0 for my IMac and have previously used a trial version. I have successfully downloaded the program, but when I run the setup file I get this error  "Javascript Alert: Critical errors were found in setup. Incompatible payloads already installed. See setup log file for details." I am assuming this error is because I have had a previous trial version on my computer.... I have tried deleting/uninstalling the older programs, but I don't know if I have found all of the old files, or if this is even the problem...also, my serial number is not working...I think this is also related to the old trial version... can anyone help with this???

    Hi,
    There is a known issue with installing retail version of PSE 6 on trial version. Removing files manually doesnt actually remove all the files, there are still some files which we do not directly relate but still need to be removed.
    You can follow the below link to get rid of the issue:
    http://kb2.adobe.com/cps/403/kb403796.html
    Let me know if this helps.
    Cheers,
    Ankush

  • Migrate existing code of AS3 to AS2 - URLRequest, URLLoader

    Hi,
    I have written code to read an XML file by using URLRequest and URLLoader in ActionScript 3.0. Code is pasted below. This runs well in AS3.  Problem I am facing is because I wrote this in AS3, I am not able to use the DateChooser component in another part of the flash module because it seems like DateChooser component is not supported in AS3. So I want to migrate my below AS3 code back to AS2.
    **** Code in AS3 (I need help in writing equivalent code in AS2) :-
    var xmlText:XML ;
    var xmlReq:URLRequest = new URLRequest("myFile.xml");
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(xmlReq);
    xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
    function xmlLoaded(event:Event):void
        xmlText = new XML(xmlLoader.data);  
        info_txt.htmlText = xmlText.someTag ;
    **** I cannot use the above as is because, when I change the publish settings from AS3 to AS2, I get following errors -
    The class or interface 'URLRequest' could not be loaded.
    The class or interface 'URLLoader' could not be loaded.
    The class or interface 'Event' could not be loaded.
    Same works well in AS3. What should I do to make this work in AS2 or can anyone direct me in writing an equivalent in AS2.
    Please assist.
    Thanks in advance.
    MG

    parsing is done using the xmlnode methods and properties.  how you parse an xml file (in as2) depends on its structure.  but generally, you use firstChild, nextSibling, childNodes and nodeValue in the appropriate sequence to extact data.  the flash help files have sample code.  for tutorials, check google.
    if you're trying to load a cross-domain xml file, you'll have a cross-domain security issue to deal with.

Maybe you are looking for