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.

Similar Messages

  • 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

  • Possibility of query showing deviated behaviour

    I have a strange problem which I am facing, I would explain that after giving the background. I have a front-end application web application with Oracle 11g as the database, in one of the screen of our GUI we have filters based on different criteria. I would simulate the problem faced with a simple example, say we have a GUI screen showing details of employee table and we put a search for a particular employee Id, the problem here is that details of all the employees are shown sometimes but rarely and not always. Is it possible that the "where" clause running in the background could be causing this deviated behaviour in a random fashion but not always. Could it be dependent on that some browsers do not support some things?
    I hope my query is clear that the web-based front-end application with Oracle database as the back-end is showing erratic behaviour on rare occasions of showing all results in a search condition whereas it should show a filtered set of records.
    Please revert with the reply to my query.
    Regards

    You haven't given us much to work on but I will go out on a limb and guess that your GUI front end is constructing the SQL dynamically and under some conditions are causing the variance in results. Did you instrument your application? Can you see the SQL query that is being passed to the backend database to verify that it is correct?

  • 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]

  • Show Hide Behaviour

    I am trying to assign a show hide behavior to my portfolio. I already have an image rollover in place on 15 individual images in a grid, basically a brighter version of the thumbnail when on hover.
    What I also want to do is assign a show/hide behaviour to each individual thumbnail as well as the rollover which will show a paragraph about each piece of artwork when hovering over the thumbnail. I can implement the rollover easily enough but when the show hide is added the div I am trying to show just flickers briefly on hover then dissapears...
    Any info would get greatly appreciated?
    Heggie

    I already have an image rollover in place on 15 individual images in a grid, basically a brighter version of the thumbnail when on hover.
    FYI: You could do this with much less code and only one set of images using CSS opacity.
    CSS:
    #thumbnail img {opacity: 0.5 }
    #thumbnail img:hover {opacity: 1.0}
    HTML:
    <div id="thumbnail">
    <img src="image1.jpg">
    <img src="image2.jpg">
    <img src="image3.jpg">
    <img src="image4.jpg">
    </div>
    Anyway, to answer your original question. IMO Show/Hide behaviors work best with onClick event triggers.   onMouseover triggers are squirrely especially for touch screen devices.
    See demo below, view source to see the code.
    http://alt-web.com/DEMOS/Show-Hide-Layers.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • 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

Maybe you are looking for