Welcome, Guest
  • Author Topic: Centering a Alert window!!!  (Read 1960 times)

    Aldo Herrera

    • Jr. Programmer
    • **
    • Posts: 96
      • View Profile
      • Universidad Latina de Panama - HomePage
    Centering a Alert window!!!
    « on: 12/20/04, 13:52 »
    When i use the alert.show(), the window shows in the upper right corner!!!

    how do i center it in my movie??

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Centering a Alert window!!!
    « Reply #1 on: 12/20/04, 14:34 »
    You can pass an init object. Remeber that _x and _y positions are relative to the MovieClip you pas as parent:

    The command is:
    PopUpManager.createPopUp(parent, class, modal [, initobj, outsideEvents])


    An example:
    win = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true,{_name: "myWin", _x:5, _y:125, _width:300, _height:250, closeButton:true, title:"Details", contentPath:"details"});

    Jorge

    Aldo Herrera

    • Jr. Programmer
    • **
    • Posts: 96
      • View Profile
      • Universidad Latina de Panama - HomePage
    Re:Centering a Alert window!!!
    « Reply #2 on: 12/20/04, 14:45 »
    thanks jorge?

    but, im talking, about the alert component?? does it works same than the window component??

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Centering a Alert window!!!
    « Reply #3 on: 12/20/04, 14:59 »
    Both use popup manager, pass mx.controls.Alert as the class

    Jorge

    Al D.

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:Centering a Alert window!!!
    « Reply #4 on: 12/21/04, 11:44 »
    Hi Jorge,

    Could you give us an example using the Alert class please.  I am having a similar problem.  Here is my Alert window.

       //This is the listener to check if user really wants to upload project to services
       var theSubmitListener:Object = new Object();
       theSubmitListener.click = function(oEvent:Object):Void{
          switch (oEvent.detail){
             case Alert.YES:
             //uploadData();
             trace("YES");
             break;
             case Alert.NO:
             trace("NO");
             break;
          }
       }//End of theSubmitListener
       
    Alert.show("Do you want to Submit Project to Services?", "   Question   ", Alert.YES|Alert.NO, this, theSubmitListener, {_x:300, _y:625});

    Thanks,

    Al D.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Centering a Alert window!!!
    « Reply #5 on: 12/21/04, 11:58 »
    What's the problem? Seems that you're trinh to manage a click event, post a new thread.

    Jorge
    « Last Edit: 12/21/04, 11:59 by Jorge Solis »

    Al D.

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • Email
    Re:Centering a Alert window!!!
    « Reply #6 on: 12/21/04, 12:17 »
    I just found my problem.

    I am using the Alert window to do a check before submitting a form.  It appears that the this keyword in the Alert class is what is messing it up.  I have 2 different movie clips on the _root timeline., so it was taking it to the _root timeline.  I added the name of the moveclip to the this keyword. I also reoved the _x and _y positioning.  Now the Alert box shows in the center of the window.

    Alert.show("Do you want to Submit Project to Services?", "   Question   ", Alert.YES|Alert.NO, this.ProjectModelingForm_mc, theSubmitListener);

    Al D.