Alert on top of Window component

Hello my dear friends:
I Ihav a Window COmponent which I programmatically created on
stage.
When I hit the close button I manage to close the Window
component
But I actually need to caLL an Alert box to let the user
choose if he
wishes to close the Window.
I manage to call the Alert box but it appears behind the
Window .
Obviously I need it in front. Any help?
This is my code:
stop();
import mx.managers.PopUpManager;
import mx.containers.Window;
import mx.controls.Alert;
var mi_manejador = function (evta) {
if (evta.detail == Alert.OK) {
trace("La acción se ejecutó");
} else {
trace("La acción se canceló");
Alert.okLabel = "Si";
Alert.cancelLabel = "No";
var miAlerta = Alert.show("¿Deseas abandonar la
prueba?", "Alert",
Alert.OK | Alert.CANCEL, null,
mi_manejador, null, Alert.OK);
var ventanaa:MovieClip = PopUpManager.createPopUp(this,
Window, true,
{contentPath:"preguntas",closeButton:true, title:"Prueba
Corta 1"});
ventanaa.setSize(550,350);
ventanaa._x = 25;
ventanaa._y = 25;
var winListener:Object = new Object();
winListener.click = function() {
miAlerta();
ventanaa.addEventListener("click", winListener);
THANKS!!

Notably, that you have a inner class referencing
image variables defined in the class it's nested in.Inner classes can access all members of the declaring class,
even private members. In fact, the inner class itself is said to be
a member of the class; therefore, following the rules of
object-oriented engineering, it should have access to all
members of the class.
The inner class does nothing to set it's own size,
, since as far as that JLabel instance knows, it
contains nothing.
But this is not corrected, it's
only relying on the BorderLayout to fill the frame
with the label.
While your sample works fine as is, it's not very
portable. As the OP posted after, he attempted to
use your code adding a JPanel in between the content
pane and the label, and it wouldn't work because of
the layout issues. To solve that, one might tend
towards defining a null layout and setting the bounds
explicitly, or one might add a setMinimumSize or
setPreferredSize call to get a size.
But that's adding more code to fix a problem that has
a much simpler solution. Which is to just give the
label the image directly, let the label size itself
automatically based on that image, let the label draw
the image itself and only override paint to get the
custom drawing done on top.
Myself, I understand what you were saying in your
code. But clearly the OP did not, and I suspect was
heading to starting patching what wasn't working by
applying more code when one could more cleanly use
less code and take advantage of what JLabel will
already do for you.Agreed. But this problem can also be easily solved with "setPreferredSize(new Dimension(200,200));" in the constructor of "Picture".

Similar Messages

  • Problem loading window component more than once

    I have a swf with a button that opens a window component
    (from my library). it loads fine and also closes fine when I click
    the close button in the window. but when I try to open the window
    again, it actually loads again, but it stalls and locks up
    immediatley. can anybody tell me what is wrong with my code? I also
    was going to have different buttons to open different windows (each
    swf playing a song and has written lyrics). it does the same thing
    when i load the first window, close it, then try to open a second
    window. it stalls and locks up.
    please, I really need some help!

    Ok it sort of works... here is my code:
    on (release) {
    trace("button works");
    win.title = "Yellow Birthday Package";
    win.closeButton = true;
    win.contentPath = "yellowPack";
    win.setSize(550,500);
    var listener:Object = new Object();
    listener.click = function(){
    win._visible = false;
    win.addEventListener("click",listener);
    It order to make it work, the window component has to be on the stage but i want it to popup only when the user clicks on the button. So the window should be hidden/invisible when the page first loads. I tried changing win._visible = true; but that did nothing.
    The other problem is that the movie clip inside the window, isnt aligning center. i can only see a corner of the movie clip. in the top left. I havent tested the whole thing live though!

  • Loading Window Component with Button!

    Hello! I found two tutorials that both contain pieces of what i am looking for but i cant seem to figure them out and get exactly what i want. Here is the first one:
    http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveD ocs_Parts&file=00004289.html
    In the first one, the general idea is what i am looking for. Except that i want to load a movieclip and not an image. My problem in this one is the button component that is used. I have no clue how to skin or customize the button, and i cant find a good tutorial to help me so i figured it might be easier to just change the actionscript for this. I want to be able to create my own button (instance button) and use that so that when people release that button, the movie clip pops up!
    Now in this second tutorial that i found:
    http://www.getw3help.com/2008/07/window-component.html
    Its pretty much exactly what i want and it loads a movieclip. Problem is, when i add the code to a button, it doesnt work!
    Can anyone help me? Hope i am clear in my explanation!
    Thanks!

    Ok it sort of works... here is my code:
    on (release) {
    trace("button works");
    win.title = "Yellow Birthday Package";
    win.closeButton = true;
    win.contentPath = "yellowPack";
    win.setSize(550,500);
    var listener:Object = new Object();
    listener.click = function(){
    win._visible = false;
    win.addEventListener("click",listener);
    It order to make it work, the window component has to be on the stage but i want it to popup only when the user clicks on the button. So the window should be hidden/invisible when the page first loads. I tried changing win._visible = true; but that did nothing.
    The other problem is that the movie clip inside the window, isnt aligning center. i can only see a corner of the movie clip. in the top left. I havent tested the whole thing live though!

  • Window Component Properties

    Hi, I'v inserted a Window Component to my movie and got it
    all to work perfectly. Now the problem I am having is that I want
    to insert another windows component but it will not let me change
    the Linkage Identifier...I can't even see the properties of the
    component. Every time I dbl-click on it, it says; "Create an
    instance of this SWF symbol and edit its properties using the
    Parameters panel...".
    Can anyne help me? What I want is to have different window
    components in my movie that each get executed by the click of
    corresponding button.
    Thank you

    You are seeing that alert when you double click on the
    component in the Library. That is your "master" component. To set
    or change the properties of a component instance by selecting the
    instance on the stage and then opening the Parameters tab of the
    Properties window.
    If you want a second Window component in your movie, just
    drag a new instance of the component from the Library window, give
    it an instance name and set unique property values for that new
    instance.

  • Window Component in Loaded Movie

    I have a window component inside a "main" movie that is
    loaded into a loader movie.
    When the main movie is run on its own, the window displays
    correctly. However, when the loader movie is run, the window shows
    at a 5-pixel size. I'm using the alert component as well-- could
    this possibly interfere with it?
    What I've tried:
    - adding the window component to the loader movie library
    - removing the window component from the loader movie library
    - adding the window component to the loader movie stage
    - removing the window component from the loader movie stage
    - adding the alert component to the loader movie library
    - removing the alert component from the loader movie library
    - adding the window and alert components to the loader movie
    library
    - removing the window and alert components from the loader
    movie library

    Components don't work when loaded into a parent. The only
    real solution
    would be to create your own combo box.
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "maskims" <[email protected]> wrote in
    message
    news:eccn00$p7v$[email protected]..
    >I have one main swf movie which calls (loadmovie in a
    target) a child swf
    > movie. The child swf contains a combobox component which
    works perfectly
    > fine
    > when this child swf is run on its own. However when
    called within the main
    > swf,
    > the combobox no longer reacts, showing a yellow frame
    around it when it
    > should
    > drop as it is clicked...
    >
    > Does anyone know what this is due to and how I could
    solve it ?
    > Thanks
    >

  • The touch screen on my nearly brand new Pavillion lap top running windows 8 no longer works.

    The touch screen on my nearly brand new Pavillion lap top running windows 8 no longer works.  Cant use calibration tools as there's no response to touch.  No option in control panal to turn on or off touch capability.  I have no computer background so cant really get to technical.  Is something simple turned on or off located in some mysterious place?  F key or something?   Bad machine?  Thanks for any input.  Sarah

    http://www8.hp.com/au/en/drivers.html
    I found the driver at the above link.  I installed the driver, disabled my graphics card and rebooted.  The touchscreen worked.  Then I enabled the graphics card.  So far so good.  Hope I dont have to do this routine too often.
    Good luck with it.

  • Itunes is on my desk top on windows 7 and I can not open it I have just loaded it up for the first time

    Itunes is on my desk top on windows 7 and I can not open it, I have just downloaded it again and hit repair to see if this helps as well but it still won't open

    Okay, launch iTunes... does it work?
    If so, in Edit > Preferences > Advanced is the option to "prevent syncing of iDevices" selected?
    Another possibility, in Control Panel > Default Programs > Change Auto Play Settings > what is the system set to do when an iPhone is connected?

  • [CS5/JS/ScriptUI]: All contents is removed from tabbedpanel when showing alert box or other Window.

    When I open a new window (an alert box, another scriptUI window, or an old style InDesign dialog) from my non modal ScriptUI interface, the contents inside all tabs on the tabbedpanel of the window disappear completely, and the last tab is selected.
    Other controls, outside the tabbed panel (but in the same window) are left untouched.
    I suspect the error has to do with the tab control. I have been able to recreate the error in an extremely simple window, and I attach the code below.
    #targetengine 'test'
    var Window1 = new Window('palette','Test',undefined);
    buildWindow();
    Window1.show();
    function buildWindow(){
        Window1.tabMain = Window1.add('tabbedpanel',undefined,undefined);
        Window1.tabMain.minimumSize= [450,170];
        Window1.tabMain.Tab1 = Window1.tabMain.add('tab',undefined,"Tab 1");
        Window1.tabMain.Tab1.Static1 = Window1.tabMain.Tab1.add('staticText',undefined,"Text on tab 1");
        Window1.tabMain.Tab2 = Window1.tabMain.add('tab',undefined,"Tab 2");
        Window1.tabMain.Tab2.Static1 = Window1.tabMain.Tab2.add('staticText',undefined,"Text on tab 2");
        Window1.tabMain.Tab1.btnTest = Window1.tabMain.Tab1.add('button',undefined,"Test");
        Window1.tabMain.Tab1.btnTest.onClick = function(){alert('btnTest_onClick')};
        // Trying with calls to layout . (This button is not affected by the alert showing - only controls inside the tabbed panel)
        Window1.btnLayout = Window1.add('button', undefined, 'Window1.layout.layout()');
        Window1.btnLayout.onClick = function(){Window1.layout.layout()};
    The interface works well in CS4, and also if I make the window modal (by creating it as a "dialog").
    In CS5, the result is this:
    Calling layout.layout() or layout.resize() doesn't do anything.
    If someone else would like to try my code, do you get the same effect?
    Is the behaviour known?
    Is there a way to prevent this from happening for non modal ScriptUI windows?
    Best regards,
    Andreas Jansson

    Thanks Marijan, for testing and letting me know!
    I filed a bug report now. We would perhaps have to "force" a couple of our clients to an upgrade from CS5 to CS5.5 in order to beat this bug and get it working, unless Adobe acknowledges it quickly, which I don't count on.
    No good news then... I took for granted that the interface would work in CS5 if I made it in CS4.
    (The thing that I was mostly concerned about was a tree view which I tested in Mac/PC and on CS4/CS5. Not the "tabbed panel"...)
    Andreas
    Adding this answer I got from Adobe:
    Monday, November 21, 2011 2:21:03 AM PST
    Hello Andreas,
    I was able to replicate this problem with InDesign CS5. This bug seems
    to have already been fixed as a side effect of some code change within
    InDesign CS5.5.
    I have logged this under bug # 3050997. This will now be worked upon by
    InDesign engineering and should be fixed soon.
    I'll keep you informed about updates on this bug.
    Message was edited by: Andreas Jansson. Response from Adobe added.

  • Window component / external swf - plz help :( !!

    Hi,
    any clues here would be appreciated, its kept me up lately.
    My flash app consists of a main swf, a button on the stage
    which when clicked creates a Popup and loads an external swf like
    so
    myWindow = mx.managers.PopUpManager.createPopup(_root,
    mx.containers.Window, true, (title:"My Title",
    contentPath:"Status.swf"});
    so far so good...
    After I create the window and load the external swf I use
    LocalConnection to pass values between the swfs eg.
    sendingLC = new LocalConnection();
    sendingLC.send("lc_name", "myMethod", txtUniqueID);
    now i can pass values between swfs fine if I run the swfs in
    separate players (or debugging both swfs in flash mx), but I cannot
    pass in a value to a swf that is loaded in a window component into
    the main swf
    Would be really grateful if someone could post a sample fla
    of the Window component loading external swfs and passing values
    between the swfs or some ideas about how to achieve the same thing.
    Thanks
    Mike

    Skip the hub and use one of the rear ports on the computer.

  • Window component drag issue

    Hi all,
    I've got a problem with a Flash application I'm developing.
    I'm creating an application with multiple nested screens, each of
    these screens is a Window component. The problem that I'm having is
    that if I move a Window by dragging it then set its "_visible"
    property to false then set it back to true, any other components
    inside it appear empty (for example text areas lose the text
    within, data grids lose the data within etc), sometimes you'll also
    get two copies of the Window!
    It's really easy to recreate!
    If anyone knows any way around this, I'd greatly appreciate
    it...
    Thanks,
    Lee.

    Bump :-)
    Anyone?
    Thanks in advance!
    Lee.

  • How switch-off the message "your plagins are very old" on the top of window ?

    How delete (switch-off reminder) the message "your plagins are very old" on the top of window ?

    Is there a reason you don't want to update your plugins? Specifically your Adobe Flash and Adobe Reader are VERY old and leaving gaping security holes in your computer. Updating them is fast and easy and will not just remove the message but will leave you more secure.
    [http://www.mozilla.org/plugincheck/ http://www.mozilla.org/plugincheck/]

  • Steps to create a custom Window component?

    What steps do I need to take to create a custom Window component? My approach now results in the component being uneditable in design view. What I do is simply select "New > MXML component", base it on spark.components.Window and supply a filename. I tried with a Panel component and that works fine.

    Hi,
    Step by Step creation of SAP Payroll Funcitons:
    1) Follow the menu path
       Human Resources>>Time Management>>Administration>>Tools>>Funtions/Operations
       or transaction PE04. Enter a four digit name for e.g ZIABC, and press the create
       button, enter the description. On creation the system proposes the name of
       the routine use it, or enter a name of your choice by selecting the option 'Self-defined'.
    2) During the execution of payroll some tables are filled with wage types and there amounts
       to make these tables available to your routine enter the name of the table for e.g (RT or
       CRT) in the input parameters, and to make the changes done to the data in the tables
       avaiable to the payroll enter the name of the table in the Output parameters as well.
       Input Parameters
       Ctry                                         Num     Object Name
       99                                           1       RT
       99                                           2       CRT
      and same shall be done in the Output Paramters if required.
    3) Create an include in the program PCBURZ990 (using Transaction:
    SE38), in which create a subroutine with the name supplied by SAP or the
    name selected by you during Funtion creation,
    in our case, it is FUZIABC.
    Note: The program PCBURZ990 is in SAP Namespace, so an Access Key
    will be required before you can proceed. But it will not be overwritten during any upgrade.
    *Example of the subroutine
       FORM FUZIABC.
    *enter the code
       ENDFORM.
    4) After this activate the program the Funtion and add it in the schema used for payroll processing.
    Reward points if helpful.
    Regards,
    Manoj.

  • How To Use a Custom Close Button In Window Component

    Hello,
    I have a window component, with the default close button
    turned off, and a new custom close button added to the movie clip
    that is displayed inside the window component. How do I get a click
    on the close button to close the window?
    This is the code I currently have to create the window (and
    the listeners to close the window using the default close button):

    basicalyyou have to use
    myWindow.deletePopUp();
    if my memory serves the content mc is loaded into a mc called
    contentHolder, inside the window component, so
    if you are referencing the window from the scope of your
    loaded mc it will be
    this._parent._parent.deletePopUp();
    or if from the button's scope
    this._parent._parent._parent.deletePopUp();
    try traceing the parantage down til you hit the window.

  • Boot Camp Question .... I just bought a 2013 late model Mac Book Pro Retina and am wondering if it is worth installing windows through boot camp. If I install the windows component in order to run an exe file and its component "Declans Korean Flash Cards"

    I just bought a 2013 late model Mac Book Pro Retina and am wondering if it is worth installing windows through boot camp.
    If I install the windows component in order to run an exe file and its component "Declans Korean Flash Cards"... will it make my mac suseptible to viruses overall due to having a windows component? also will it make my mac slower as well

    If you are only going to use one or two window only programs then I wouldn't waste the space.  Try WinonX it allows you to install exe. Files on Mac without installing windows.

  • Don't know how to close UI-Window Component

    I don't know how to write a close function for UI windows
    component.
    This is what i did.
    1) Dragged windows UI component to the library.
    2) Dragged button from UI to stage
    3) Gave instance name to the button as my_button
    4) For frame 1, i added this actionscript

    that will create the pop up.. you will need another button if
    you want to close it and make a call to the window.deletePopUp()
    method

Maybe you are looking for

  • Can't print on wireless network

    HI, I've bought this printer new. I've installed and configured the printer from cd. Have done several checks from the website and it does print the report ok. The printer appears connected to the net but when I send to print from another application

  • Mac OSX 10.5.8 Leopard & HP Photosmart 3180

    I have a HP photosmart 3180 and recently upgraded to 10.5.8 "still leopard". I recently looked to install this printer again on network, so I went to hp site and downloaded latest driver (marked 10.4, 10.5) downloaded and installed. Hooked printer up

  • Windows 8.1 apps freeze and minimise to tray

    Hi! I have a problem with my win 8.1 machine. All the windows 8.1 apps like the store, weather freeze on their splash screen when I start them and then they minimise to tray. If I try to maximise them again they minimise back again after a few second

  • Client says can't see Flash images

    Let me request your patience in advance - I don't have many details to provide so I know the possibilities are wide open and therefore difficult to pinpoint. Here goes. We created an HTML website with some flash content and some static jpeg images. M

  • Why do I have "local disks" on my ipod?

    When I look at my music or photos folder I find several "local disks."  What are these and how do get rid of them?