Alert.Show WEIRDNESS

OK, riddle me this, Batman:
I've got a function (example attached) with a number of items
running in it (alot of setting of variables, and outputting them to
text areas and such). When I have an Alert.show call, all is well
and the variables get set and output just fine.
But when I remove or comment out the Alert.show call, the
whole thing comes to a grinding halt and variables are not set.
And here's the weird part (like the stuff above wasn't weird
enough): the Alert.show can't be a hard-coded string, it has to be
the value that one of the variables is being set to (in other
words, the original value that was saved as a variable, not he
variable itself).
I've hit this now both in Flex 3 and Flex 3 AIR
applications...
HELP! (and thanks)

I was having trouble with Alert.show and thought it was a
problem with the function, too. But it was something I was doing.
You don't say how myGameText is declared, but it seems pretty
obvious. You might want to try enclosing variables in String() when
you are passing them to functions that require strings. Like
gmDate.text=String(myGame.@date);

Similar Messages

  • Alert.show() interesting behaviour

    I use multiple SWFs loaded in one main SWF. Each SWF is form
    and its form is linked to a class that extends the form class.
    Most of the forms use a base class. The base class includes a
    prompt function that calls Alert.show(). The form class calls the
    prompt function and when used within the SWF itself it works as
    expected but when the SWF is loaded in a movieclip of the main SWF
    then the message becomes the title and the title becomes the
    message and everything else seems to be find.
    I cannot figure out what the fuddle doddle is going on.
    I know that some V2 components don't behaves as expected when
    used in a SWF loaded into another SWF such as the ComboBox
    component that requires a _lockroot to expand its list when clicked
    if it's SWF is loaded into another SWF.
    I suspect the same type of weirdness is going on with the
    Alert component. I do have the _lockroot set but no cigars.
    I also imported the mx.controls.Alert class in both, the base
    class and the form class with no success.
    Does anyone know how to make this work?
    Also, dos anyone knows of a list of SWF loaded into another
    SWF V2 component quirks and their solutions if any?

    I should add that if I use Alert.show() directly from the
    form class the it is working fine. It is only when I use it in a
    base class function such as 'prompt' called from the form class
    that it flips the message and title.

  • Help with Alert.show()

    I need help with Alert.show(). My goal is to display a message box when a button is pressed.
    My program header:
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    actionBarVisible="true" fontWeight="normal" overlayControls="false"
    tabBarVisible="true" textAlign="right" title="tipCalc">
    //// start of script section:
    <fx:Script>
            <![CDATA[
            import mx.controls.Alert;
            import mx.events.CloseEvent;
    // show a message box when button pressed
    protected function about_clickHandler(event:MouseEvent):void
                Alert.show( "This is a message!", "Dialog Title" );    }
    This results in the errors below:
    Access of undefined property Alert.
    Definition mx.controls:Alert could not be found.  

    Well, me and my three days of Flash Builder are lost in the woods. I have no idea how to do what you suggest. The code Google's showing me seems to call for scrapping my working functional program and starting from scratch. For a message box.
    Can I add a message box to my existing code?
    Here's the header...
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    actionBarVisible="true" fontWeight="normal" overlayControls="false"
    tabBarVisible="true" textAlign="right" title="tipCalc">
    And here's theclickHandler that should call the popup.
        protected function about_clickHandler(event:MouseEvent):void
                    //  Call a message box.

  • Alert showing in invisible mode?

    Hello,
    I've created a popupmanager to display a panel,
    The thing is, that when i activate the pop up, and then activate an Alert.show, the alert is invisible.
    If for example I activate the alert first, the alert is visible. I dont know how is this happening.
    Any ideas?

    Does anyone has clue to this problem. Since system defined alert also not working in update mode, hence I need urgent attention from all users pls.
    Thanks
    OP Sharma

  • Trying to use Alert.show in module- possible?

    I have some user data that I have to validate before
    submitting it to a db and so I was planning on popping up an
    Alert.show to ask them if they are sure in the usual fashion.
    Button click event points to function that should show the Alert.
    debug shows that function gets entered, but Alert does not show. no
    error, just no Alert. code and controls are in a module that's
    loaded into main application based on user input. Is this the
    problem? Should I be using a popup window instead of Alert? Thanks
    in advance.
    Andy C.(never #)

    First, thanks for the reply:
    I can't browse outside from my windows box( well I can but
    they can see what I'm doing), so I can paraphrase.
    <mx:Button label="Add Button" id="btnAddUser"
    click="doAddUser(event)" />
    <mx:Script>
    <![CDATA[
    import mx.everything and its brother;
    private function doAddUser(event:Event):void
    var alrtmsg:String="Are you sure you want to add this data
    to the database?";
    var alrtttl:String="Confirm User Add";
    Alert.show(alrtmsg,alrtttl, Alert.YES | Alert.NO, this,
    alertClickHandler);
    private function alertClickHandler(event:CloseEvent):void
    if(event.detail==Alert.YES)
    rest of code does validation
    ]]>
    </mx:Script>
    This is pretty much straight out of the help screens. Now
    this is in a module that's loaded into the main application.
    Everything else works as I expect it to, but I can't get the Alert
    to popup. And obviously, since I'm validating user input I have to
    have a way to show them when they forgot to put something in.
    Thanks

  • How to autoclick/run a button after Alert.Show() Event?

    Hey Guys
    So I have a alert.show happening for something like
    public function test(evt:ResultEvent):void
    if (evt.result.success == "yes")
         mx.controls.Alert.Show("Yay!!!")
    if (evt.result.success == "no")
        mx.controls.Alert.Show("Nay")
    Now I have another button called
    <mx:Button label="Reload" id="Reload" />
    I want that if the sucess == yes scenario is run.. After the popup box comes and a person click OK.. the reload button is run..
    Please tell me how to do so??
    Regards

    You need to set up an event listener on the closeEvent.
    Here is a quick example (untested):
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.CloseEvent;
    import mx.controls.Alert;
    private function init():void {
    Alert.show("myText", "myTitle", Alert.OK | Alert.CANCEL, this, onClose);
    private function onClose(event:CloseEvent):void {
    if (event.detail == Alert.OK) {
    trace("ok pressed");
    } else {
    trace("cancel pressed");
    ]]>
    </mx:Script>
    </mx:Application>

  • Monitoring Active Alerts shows critical heartbeat failure while server is working

    details of the alert shows the reason is the computer can't be reached through an ICMP ping
    if do a 
    ping servname
    it uses the IPV6  and fails
    Why isn't it using IPv4?
    thanks
    N
    NM

    Hi,
    In the Tasks pane, under Health Service Watcher Tasks, click
    Ping Computer. The task opens a dialog box to display its progress.
    In addition, more details, please read the article below to troubleshoot heartbeat failure issue:
    Resolving Heartbeat Alerts
    https://technet.microsoft.com/en-us/library/hh212891.aspx
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to center align Alert.show() in flex

    Hello All,
    I have a tall Flex application that uses Alert.show( ) to display error/warning messages. This created problems when the error messages were centered on the screen, but not visible when the screen was at an extreme scroll position (top or bottom). is there any way that i can display the Alert in the center of the user's viewable page. I've tried the following, but didn't work.
    var errorMsg:Alert = Alert.show("Error message"); PopUpManager.centerPopUp(errorMsg);
    Thanks in advance.

    Thanks for your help, yes by using some javascript calls i'm now able center align the Alert.
    Here is the solutions for my problem.
    var viewPoint:Number = ExternalInterface.call("eval", "window.pageYOffset"); var browserHeight:Number = ExternalInterface.call("eval", "window.innerHeight"); //the following calculation finds the center y coordinate in user's viewable page. var viewableY : Number = ((browserHeight/2)+viewPoint-50); var alert : Alert = Alert.show("Error Msg"); PopUpManager.centerPopUp(alert); alert.move(400,viewableY);
    I hope this helps someone...

  • Does Alert.show put a message on the screen, or not?

                            var year:int;
                            var days:int;
                            days = 0;
                            year = 2010;
                            if (year > 2099)
                                  Alert.show("Unable to calculate day number for years beyond 2099.");  // Because, for example, 2100/2/29 will not exist
                            var T0:int;
                            T0 = days + ((year - 1964) / 4) * (3 * 365 + 366);  // This oomplex expression is evaluated incorrectly, so I have broken it down to help the compiler out
                            var T1:int;
                            var T2:int;
                            var T3:int;
                            var T4:int;
                            T1 = year - 1964;
                            T2 = T1 / 4;
                            T3 = 3 * 365 + 366;
                            T4 = T2 * T3;
                            days = days + T4;
                            if (T0 != days)
                                  Alert.show("Fault in evaluation because " + T0.toString() + " does not equal " + days.toString());

    Yes, and http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_11.html reports that the int data type was added to Adobe Flex to improve performance when the programmer knows only integers shall be dealt with.   The livedocs page, to which you refer, was written before there even was an integer data type.  There is definitely something wrong with the way Adobe's software handles complicated integer expressions.    I did try changing all int data types to Number data types.   The complicated expression is handled properly in that case.
    The int data type is stored internally as a 32-bit integer and comprises the set of integers from
    -2,147,483,648 (-231) to 2,147,483,647 (231 - 1), inclusive. Previous versions of ActionScript offered only the Number data type, which was used for both integers and floating-point numbers. In ActionScript 3.0, you now have access to low-level machine types for 32-bit signed and unsigned integers. If your variable will not use floating-point numbers, using the int data type instead of the Number data type should be faster and more efficient.

  • When i try to update my iPhone 3G software, the message alert showing (The iPhone ''iPhone'' could not be restored. An unknown error occurred). now my iPhone 3G blank display. how can i do then please?

    when i try to update my iPhone 3G software, the message alert showing (The iPhone ''iPhone'' could not be restored. An unknown error occurred). now my iPhone 3G blank display. how can i do then please?

    I was not sure about the ''jailbroken''. now my iPhone cannot use, on the showing (connect to iTunes logo). so if i just want my iPhone process in normal, what can i do? i mean i want it back to the previous software version?

  • How to pass parameter to function when confirm(Alert.show) closed?

    <![CDATA[
    import mx.controls.*;
    import mx.events.*;
    private function deleteItem(guid:String):void
    Alert.show("Are sure you want to delete?", "Confirm Delete", Alert.YES|Alert.NO, this, alertClicked);
    private function alertClicked(event:CloseEvent) {
    if(event.detail == Alert.YES) {
      Alert.show("yes "+guid); //<-- here I want to get guid
    else if (event.detail == Alert.NO){
      Alert.show("no ");
      return;
    ]]>
    Thanks.

    Hi Itambs,
    You can do the following:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="deleteItem('Dummy GUID VALUE')">
    <mx:Script>
      <![CDATA[
       import mx.controls.*;
       import mx.events.*;
       private var myAlert:Alert;
       private function deleteItem(guid:String):void
        myAlert = Alert.show("Are sure you want to delete?", "Confirm Delete", Alert.YES|Alert.NO, this, alertClicked);
        myAlert.data = guid;
        myAlert.height = 150;
                    myAlert.width = 300;
       private function alertClicked(event:CloseEvent):void{
        if(event.detail == Alert.YES) {
           //Alert.show("yes "+guid); //<-- here I want to get guid
           Alert.show("yes "+ myAlert.data);
        else if (event.detail == Alert.NO){
           Alert.show("no ");
           return;
      ]]>
    </mx:Script>
    </mx:Application>
    Note: you can also do this in another way by decalring a global variable guid as ...... private var _guid:String="";
    set _guid = guid; in deleteItem() function and then in alertClicked() function you can access the value as _guid again...which holds the saved value...
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Crashing whenever using mx.controls.Alert.show

    Flex Project: Desktop (AIR)
    Flex SDK: 4.1
    Flash Builder 4
    Problem: Whenever I use Alert.show even with the simplest strings passed it crashes showing the following error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at mx.controls::Alert$/show()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\Alert.as:566]
    And it is pointing at Alert.as line:
    var sm:ISystemManager = ISystemManager(FlexGlobals.topLevelApplication.systemManager);
    How do I use this? What's wrong? Any fix?

    It sounds like you're referencing a NULL object somewhere.  Any chance you could provide us with some sample code?  I just successfully tried the following out:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                applicationComplete="init()">
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   public function init():void
                        Alert.show("This is a test", "My Alert");
              ]]>
         </fx:Script>
    </s:WindowedApplication>
    Thanks,
    Chris

  • How to suspend the script be executed before Alert.show() completed?

    how to suspend the script be executed before Alert.show()
    completed?
    In a window, when users want query and display new data, they
    should be asked whether to save the old data. The
    queryAndDispleyNewData script should not be executed untile the old
    data is saved or be gived up.
    queryNewData(){
    if (Alert.show(askSaveOrNot)==YES) doSave();
    queryAndDisplyNewDate_Script;
    however, the face if the queryAndDisplyNewDate_Script is
    always executed before doSave(). how could I do?
    Any suggestion will be appreciated.

    You cannot suspend the script. Flex/ActionScript is
    event-driven. When you post a dialog box - modal or not - you
    assign event listeners to it. It is in the event listeners that you
    do whatever it is the dialog is asking - saving data back to the
    server, for example.
    Requesting and posting data to the server is event-driven
    too. If you request data from the server you must process it in an
    event handler (which includes data binding).
    If you are going to develop Flex applications you will need
    to understand event-driven programming.

  • Alert.show and popups not displaying text in flex4 compatibility

    I'm using the Fx4 SDK in compatiblity mode to compile my Fx3 applications; everything seems ok, but for popups.  No text is being displayed by any popup, not my custom titleWindow popped up with PopUpManager.createPopUp() nor my Alert.show boxes... Why could this be happening?
    thanks,
    gtb

    To fix this I did the following:
    1. remove the compatibility directive:
    -compatibility-version=3.0
    2. add as an additional compiler option the following directive
    -theme PATH_TO_FX4SDK/frameworks/themes/Halo/halo.swc
    3. change the namespace on my css file.
    for the standard flex components:
    @namespace "library://ns.adobe.com/flex/mx";
    and for my custom components
    @namespace "*";
    finally make your application's framework conform to Flex4SDK.
    gtb

  • Alert.show on Air application

    Dear Flexer,
    I made an transparent Air application with no chrome.
    With those configuration, I have a problem with alert window.
    Indeed, if i try to use an alert.show anything appear on screen.
    I thinks that this problem appear because on my application only menubar appear.
    So as I work on Flex 4 with Macintosh system, I try to do Alert.show("Souhaitez-vous quitter MonAppli?", "Quitter     l'application", Alert.OK | Alert.
                    CANCEL, Sprite(FlexGlobals.topLevelApplication);
    But no alert on screen
    Is anyone have a solution to solve that mistake?
    Thanks for your help.

    Post a 20-line test case.

Maybe you are looking for

  • SharePoint 2013 allows downloaded even for users with "view only" permissions

    I have a new on premises SharePoint 2013 server and assigned a single user "view only" rights to a document library. In the "permission levels" window, this permission is described as "Can view pages, list items, and documents. Document types with se

  • Google Chrome CPU usage almost 100%

    Hey guys, so I recently updated from Snow Leopard directly to Mountain Lion and now I have a issue I can't fix by myself. I'm using a Macbook Pro Mid 2010, 4gig Ram, 2,4 Intel Dualcore, GT 320M - now running OSX 10.8.3 I've got a 27" secondary displa

  • PDFs Crashing Acrobat 9.3.4 for seemingly no reason

    We're having a big problem with commented PDFs (made in Indesign) crashing at seemingly random points. Have tried re-saving the PDFs, opening in different locations (both local and network drives), changing view options, etc... The crashes occur on o

  • How to connect macintosh LC to LCD monitor?

    Hello, I'm trying to connect a Macintosh LC to a VGA LCD monitor.  I'm not sure if that is possible, if so, what is the name of the adaptor that I need to get for it? Ebay has tons of such adaptors when I tried looking for them, but I didnt know whic

  • New Time Machine keeps forgetting Wi-Fi Password

    I have reset the brand new Time Machine about 10 times. I reset it to factory, put in passwords, and it might work for a day, but then will not take the password I set. Sometimes, it quits working as fast as a few minutes after I set it up. I've even