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...

Similar Messages

  • How to center align preview page

    When I preview my webpage (which I am creating in fireworks) in the browser it is to the left of the page, How do I center align it?? Thank you in advance for your help

    You shouldn't be creating your total web page in Fireworks, only the graphics  :-)
    You should slice up the images you need and then export those and use them in your HTML or via the stylesheet as background images.  A web page that is full of images will only slow down the loading plus not be indexed by search engines...
    To then center the page, you need to use CSS to to align the page in the center of the browser window regardless of window size.  This again, is done when you move over to the HTML editor, not in FWs.
    A good tutorial that may help the transition from taking a FWs comp to HTML
    http://www.adobe.com/devnet/dreamweaver/articles/dw_fw_css_pt1.html
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    Book: Ultimate CSS Reference
    http://www.sitepoint.com/launch/005dfd4/3/133
    http://twitter.com/nadiap

  • How to center align request Title

    The deafult for the request title is left. Is there a way to center align? The only way I was able to achieve this was to indent left and right padding under additional formatting options. Cell Horizontal alignment does not do anything

    BISP wrote:
    The deafult for the request title is left. Is there a way to center align? The only way I was able to achieve this was to indent left and right padding under additional formatting options. Cell Horizontal alignment does not do anythingThe "A" that you need to click on is NOT the one that is in the Title section when viewing the report in the Compound Layout.
    What you have to do is, while in the Compound Layout view, click on the middle icon, the one that looks like a pencil. In other words, you have to go to the design editor of the Title View.
    Here is where you find another "A" to the right of where the title field is. Click it and change the horizontsl alignment there. That will center your title.

  • How to Center Align SWF in Browser

    I used the publish feature of flash but it does not seem to center the SWF in the browser. Why is there a centering feature on the publish settings under HTML tab if it does not center the SWF? It only works if you set Dimensions to Percent but that exposes the area beyond the stage and i don't want it to be seen. In addition that causes some movieclips to be improperly positioned. The Flash Alignment should have been disabled if the Dimensions is not set to Percent. Does anybody disagree? Can somebody help me solve this issue? Perhaps a simple script that centers my swf file in a browser... Any help highly appreciated.

    Thanks a many for your help! I tried not using the swfobject.js and tried commenting out the object instantiation in the html file and it still works, why? Is it really needed? What exactly is the purpose of the swfobject.js. I remember i read something about Geoff Stearns creating that .js file to solve a particular problem but i forgot what exactly that was.

  • Still cannot center align panel !!  can it be done in JSC2????

    Hi,
    I have trawled trhough posts and cannot find how to center align a panel on a page. I have tried setting width=100% and setting vertical align to center for components.
    Main problem is when I resize page all the content is fixed. I would like this to move to center based on page size.
    Is there a way to wrap all of page in a div and set width=100%?
    Can i wrap all the page in a one cell html table and set width=100%?
    any help much appreciated.
    loti.

    Search for Tob Norbye's Weblog... He has quite some work on it. As far as I remember, he set "position: absolute" and set the left margin = 1/2 of the width of the layer you want to center-align. also, he set "left: 50%". This worked for me, but it has one catch, you have to key in the half of absolute width, besides that the solution seemed good enough to me.

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

  • How to put a tab space in a center aligned paragraph and have it remained centered?

    I am trying to put a tab spacing within a paragraph that is center aligned but when I press the tab button it pushes the paragraph to the left. How do I solve the problem? I have several lines I need to do this for so adjusting it one but one is a bit tedious.

    I don't use Captchas because they are not web friendly.  Humans have a hard time reading them which often leads to form submission failures and frustration.  I much prefer the Honeypot (hidden input field) method.  It traps spam bots who cannot resist filling in fields because they don't use CSS or JavaScript.  If the hidden field contains any characters, your form processing script can be set-up to flag that as spam and abort the submission.  Humans never see the hidden field, so it works seamlessly behind the scenes.   There's no limit on how many hidden form fields you can have on a page.
    Nancy O.

  • I just installed Yosemite.  Notifications Center will not show ICal entries that were on my ICal at time of installation.  How do I get events to show in Notification Center?

    I just installed Yosemite.  Notifications Center will not show ICal entries that were on my ICal at time of installation.  How do I get events to show in Notification Center?

    Submit your feedback requesting this feature directly to Apple using the appropriate link on the Feedback page:
    http://www.apple.com/feedback

  • How to get my_text in the CENTER aligned on my_form?

    Hello
    I put  a text field (say, its name is 'my_field' 80 characters length) WITH OUT caption and NONE appearence (not Solid box, no Sunken box).
    And i am populating/filling this field with some value PROGRAMATICALLY. Pre-Populating value is vary in its lenght.
    For example in 1st case,  i am pre-populating this my_field with 'AAAAAAAAAAAAA'
    In some other case,  i am pre-populating this my_field with 'AAAA'
    In some other case,  i am pre-populating this my_field with 'AAAAAAAAAAAAAAAAAAAAAAAAAAA'
    Fine.
    But i want print this text/value IN THE CENTER all the time / all cases, no matter How much lenghts's value i am populating, i mean, it shuld come CENTER in the micro soft word
    Pls. let me know how to get this formatting as CENTER ALIGNMENT
    Thank you

    You probably need to set the Align property of the Text field at design time..
    Select the Text Field and then in the Text formatting toolbar, choose the Align Center option to have the text displayed always in the center.
    Thanks
    Srini

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

  • How to center site in browsers.  Currently aligned left.

    Please tell me how to center my website in the browser windows.  It is currently lining up completely to the left with a lot of white space on the right.
    What code do I add and where.  Thanks a lot.

    Go to Code View in DW.
    On line 240, delete
    <div align="center">
    Around line 25
    change
    <body>
    <table width="760" border="0" cellspacing="0" cellpadding="0">
    to
    <body>
    <div align="center">
    <table width="760" border="0" cellspacing="0" cellpadding="0">

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

  • Photoshop Elements 7 - How do I align/center a layer?

    I'm using Photoshop Elements 7. How do I align/center a layer vertically or horizontally on a page?

    Are you adding objects to a blank layer? If so bring up the ruler then drag and drop guides to your center and any additional points. You can also set so that objects automatically snap to the guide lines.
    If you want to align visually similar images on top of each other, there is no auto-align like in CS5. The only work around is to lower the opacity of the top layer and then use the move tool to align by eye.
     

  • How do you center align a Text Field box?

    The center align tool is grayed out.

    Hi,
    Sorry, formsCentral currently does not support alignment of the actual field box.  You can select the different alignment choices for the text label of the field.
    Thanks,
    Lucia

  • 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

Maybe you are looking for

  • HT3847 how do you determine a file is "empty"?

    I have somehow duplicated all my iTunes files... thereby taking up valuable space on my harddrive. This was caused by moving my iTunes "music, etc" back to the harddrive after using an external HD for a long time. I have read the article saying somet

  • Using CTS+ from CE 7.2

    Dear SAP Gurus, We are using CE 7.2 and i are in the process of integrating it with our CTS+ setup for importing the JAVA transports. As SDM is not available on the CE system, we have used the instructions in the following link and configured port 5X

  • Number of downloads for my podcast?

    I can track numbers on our web page, but how can we see the number of subscribers and downloads via itunes? http://dryshave.podbean.com

  • Cannot create database on 10g

    Hi, I get this error when I try to create the database on 10g Total System Global Area  239075328 bytes Fixed Size                  2005472 bytes Variable Size             184550944 bytes Database Buffers           50331648 bytes Redo Buffers        

  • Charset Encoding Problem

    Hello all, I have the problem that umlaut like ä, ü,ö are didn´t shown in the Browser. In the JSP Page I included the charset=iso-8859-1. I used the Web Application Server 6.4 SP12. If I used this charset ín a normal HTML Site it works fine. Could an