Menu/submenu managing and Event Listening problem

Hi guys,
I'm creating a flashwebsite and I've got a problem with submenu appearing/disappering.
What is extremely easy in html/jquery is taking me overburned in actiuonscript: make appear a submenu only when the mouse cursor is over its button and not over itself.
Indeed I've my button/MC, that contains its submenu (which is a vertical list of MC), and when I go over it, submenu appears, when I leave, sub menu becomes invisible.
BUT, when I go over the space under the button (where my invisible submenu is), submenu become visible another time. I know that cause is the listener associated to the main button is linked to all its nested MC.
My question is: there is a way to declare a listener only to a MC and not for all is nested elements?
If not, what shopuld I do for my pourpose?
function createNav(lang:String = 'it') {
    var nav:Array = new Array({label: "CHI SIAMO", url: "../chi-siamo/index.php"},
                              {label: "PRODUZIONE ESECUTIVA", url: "../produzione-esecutiva/index.php"},
                              {label: "FILMOGRAFIA", url: "../filmografia/index.php"},
                              {label: "CAMPILOTS", url: ""},
                              {label: "PROGETTI", url: ""},
                              {label: "NEWS", url: ""},
                              {label: "CONTATTI", url: ""},
                              {label: "LINGUE", url: "", submenu:new Array({label:"ITALIANO", url:""},
                                                                           {label:"INGLESE", url:""},
                                                                           {label:"TEDESCO", url:""},
                                                                           {label:"FRANCESE", url:""}
    var navHeight:Number = 25;//single element height
   //BUTTON CREATION
    for (var i = 0;i < nav.length;i++) {
        var item:MovieClip = new NavLink();
        item.label.text = nav[i].label;
        item.href = nav[i].url;
        if(nav[i].submenu != null){    //SUBMENU CREATION
            for(var j:int = 0; j < nav[i].submenu.length; j++){
                var subLabel = new SubLabel();
                subLabel.x = subLabel.y = 18 * (j + 1);
                subLabel.tfMC.text = nav[i].submenu[j].label;
                item.addChild(subLabel);               
        item.buttonMode = true;
        item.mouseChildren = false;
        item.addEventListener(MouseEvent.CLICK, function(e) {
            href = e.target.href;
            gotoAndPlay('page2page');
        var subMenuAnim:Array = new Array();
        item.addEventListener(MouseEvent.MOUSE_OVER, function(e) {
            var iconCocc:MovieClip = e.target.coccinella;
            var iconRotTween:Tween = new Tween(iconCocc, "rotation", Back.easeOut, iconCocc.rotation, (iconCocc.rotation + ((Math.random() * 200) + 200)), 2, true);
            //APPREAING ANIMATION
        item.addEventListener(MouseEvent.MOUSE_OUT, function(e) {
            for(var i:int = 0; i < subMenuAnim.length; i++){
               //DISAPPREAING ANIMATION
            subMenuAnim = new Array();
        item.y = navHeight * i;
        item.visible = false;
        item.coccinella.rotation = (Math.random() * 200);
        nav_container.addChild(item);

What are you doing to make the submenu invisible?  If you set its visible property to false it should not interact with the mouse, but if you are changing its alpha property to 0, it will react.

Similar Messages

  • Flash player on the new mac sarafi can't use keyboard and event listener

    flash player on the new mac sarafi can't use keyboard and event listener
    cn:英文有些差不好意思,附上中文说明:在flash player web 开发时,我在最新版本的sarafi上,目前出现不能响应键盘事件bug,为了验证是不是我本地问题,我也用在多款别的网页游戏上进行测试,全有这个bug,另外,有时还有那个fp弹出本地 缓存提示设置窗口也点不了“允许或拒绝“那些按钮

    Now after 5 weeks, you have always not resolved this very important and urgent issue. It seems that Adobe has realy abandonned the actionscript / flash player projects. Why not simply discontinue flash player on desktops too ? Or even better remove or block "automaticaly" all flash players with the final update. That could create a serious issue on the Internet for few weeks but at least that will be honorable end like a Samurai's Seppuku...

  • URGENT : EVENT Listener Problem

    Hi All,
    Thanks for your time. I am facing a Small issue with Event
    dispatcher and Add Event listener. Well i will explain the problem.
    I am having one MovieClip named BUTTON_SET and i gave
    "ButtonSet.as" as linkage Class.
    Inside that BUTTON_SET i am having some Buttons and they are
    also having "UIButton.as" as linkage class
    UIButton Dispatching press and release events, But unable to
    capture it using ButtonSet Class. Here with i have attached the
    Code and i gave the Source URL Too.
    upto my Knowledge : UIButton class is not initiated When the
    ButtonSet is ready to addListener.
    Please Help me to fix this.
    if i don't find a solution i need to change all my class
    structures.
    CLICK HERE FOR SOURCE
    CODE

    According to your Code, When you are calling the InitHandler
    Functionction the Buttons may/may not be Initiated. So use the
    Enterframe to check whether its loaded or not.
    Write down this in the ButtonSet to replace the init Handler
    Call.
    this.onEnterFrame = Delegate.create(this, initHandler);
    inside the initHandler remove the function This will help you
    if you are not using any Enterframe for any other manipulation)
    delete this.onEnterFrame;

  • App-V 5 sp2, Citrix user profile manager and Event IDs 19104

    Hi,
    the environment:
    Full Infrastructure, Appv 5 sp2 Client on server 2008r2, xenapp 6.5 and Citrix user profile manager.
    We get the event error 19104 on published packages. But not on all users. %APPDATA%\Microsoft\AppV\Client\VFS and %LOCALAPPDATA%\Microsoft\AppV\Client\VFS are excluded per
    http://blogs.technet.com/b/appv/archive/2013/10/01/support-tip-event-ids-19104-and-19105-are-logged-when-publishing-and-unpublishing-app-v-5-0-packages.aspx from my test GPO:
    List of directories to exclude:
    AppData\Local\Microsoft\AppV
    AppData\Roaming\Microsoft\AppV\Client
    Appdata\local
    appdata\locallow
    Still some users get app-v Applications, but some that are copies of the ones working does not get the Applications. I have tried to delete the profile. but still no closer to a solution. Anyone got this working?

    Thanks Nicke, I should have tried harder to get you to come and work with me in Oslo earlier this year ;)
    That thread does point on the Profile managment, and redirection of %appdata% and %localappdata% . Those to folders are not redirected. But when i run Procmon, i can see that a working user creates the c:\users\<username>\appdata\local\temp but non
    working does not even try.Non working users also does not query the registry as much as working. Ofcourse this all work in my lab so the settings should be sound. but i cannot find the smoking environment variable or setting that causes it.

  • Spacing of Spry Menu submenu items, and inserting background images

    Hiya, need a bit of help, could someone possibly guide me with this?
    I've created a Spry Menu in DW CS5 - so far, so good.. However I'm pretty new to CSS Styles so need pointers at what to change to get the result I need. I've created the spry menu, however the submenu dropdown items are not flush to the ones above, theres a 1px horz gap between each item and while it looks okay, its particularly visible in Firefox and Chrome and would prefer no spacing at all..
    The live site is at http://www.ebm.co.uk/2011site/indexnavbar2.html
    if you take a look at the drop down menu bar you'll see what i mean - what do I need to do to remove the spacing?
    I also want to replace the solid colour with images, where do I specify the images for 1) top menu item 2) submenu item and 3) 'hover' item, and do I need to make any areas transparent?
    Any advice would be much appreciated.. thanks!
    Chris

    This is a good place to start http://www.dwcourse.com/dreamweaver/ten-commandments-spry-menubars.php.
    Also this might help http://labs.adobe.com/technologies/spry/samples/menubar/CenteringHorizontalMenuBarSample.h tml
    Gramps

  • JList event listener problem

    I'm trying to define an event listener for a JList component. The code is shown below. The problem i'm having is that when elements are added to the JList none of the functions (callFunctionHere()) are being called. Can anyone tell me what i'm doing wrong? (elements are being added to the list using DefaultListModel.addElement())
            pnlWhere.lstCond.getModel().addListDataListener(new javax.swing.event.ListDataListener() {
                public void contentsChanged(ListDataEvent e) {
                    callFunctionHere();
                public void intervalRemoved(ListDataEvent e) {
                    callFunctionHere();
                public void intervalAdded(ListDataEvent e) {
                    callFunctionHere();
            });Thanks,
    Danny.

    Check out the KeyListener interface. You can create an implementation that searches for a string starting with the character of the key that was pressed.

  • Alarm and event related problem

    hi dear all
    again my problem needs u
    On upgrading my project from labview 6.1 to labview 7.1 version i have problem in generating alarm related .ALR file which i further use in my software. for this i m using "legacy_hist_alarms_&_event_Query_to_spreadsheet_file.vi" this vi but in labview 7.1 i replaces it with
    "Alarms and event query to spreadsheet file.vi" but its number of display format and filter elements are changed i also changed these.
    but how i order the elements so i correctly connect with vi . i tried acc. to error list but it gives error every time so pls give the example or any suggestion regarding the order of elements .
    i m thankful to u all in advance
    regards,
    Dhanwanti

    Dhanwanti,
    What error are you receiving when you try to connect to the VI?  What do you mean by "order the elements"? Are you talking about the inputs to the VI? If so, the easiest way to connect to these are to right click on the terminal and select "Create -> Control", which will make a cluster that connects to the VI.
    Let me know if this helps.
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • [CS3][JS] beforeClose event listener problem

    Hi all,
    I want my script to do the following: every time when a user closes a document, I wish for "Check Spelling..." dialog box to show up and after the user finishes spell-checking, the document should be closed.
    But instead, if I have one document open, I get an error: Error Number: 53762, Error String: Action is not enabled, and if more than one document open, the dialog opens in the wrong document.
    As far as I understand, the problem is that the menu action is invoked AFTER the document has already been closed – it is quite clear that opening the dialog with no documents open makes no sense – that’s why the error occurs.
    Does anybody know how to solve this? Why beforeClose event type doesn’t correspond to its name? The scripting guide states: “beforeClose – Appears after a close-document request is made but before the document is closed.”
    Here is the script:
    #targetengine "session"
    main();
    function main(){
       var myEventListener = app.addEventListener("beforeClose", myCheckSpelling, false);
    function myCheckSpelling(myEvent){
       app.menuActions.item("Check Spelling...").invoke();
    Kasyan

    Thank you Ole.
    I've been at it for about 6 months.
    I am providing 3 modules. All modules are in 1 folder. That's why the ScriptPath & Department variables.
    FYI: app.pdfPlacePreferences.pageNumber was used solved issues with InEvenScript plugin for CS2. That plugin was NOT handling a loop call. To solve it, I've used a variable to turn ON & OFF the handler. "Import" is used in the OPEN script, and that will execute the event!
    1) Startup. I trimmed it for you but I kept the orignal OPEN-Event disabled. See PrePressEVENT.
    2) PrePressTEST. It's a trimmed version of the actual PrePressOPEN. But it makes InDesign crash. FYI: PrePressOPEN works perfectly when triggered manualy (Script Panel).
    3) PrepressEVENT. Disabled in Startup, I am using this one so I can debug the EVENT and do actual work at the same time. Until it crashed of course.
    The window.add() is what makes it crash. Without it, fine. But if removed myDoc = app.activeDocument points to the wrong one!
    Thank you in advance. Hope this is clear enough.
    Module STARTUP
    =====================
    #target indesign
    #targetengine "session"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    var myScriptName = app.activeScript.fsName;
    var myScriptPath = app.activeScript.path;
    var myErrorStyle = "*****Error while Updating!"
    var myMsgStyle = "*****No UpDate! (Delete to Reset)";
    var myDept = "PrePress";
    //*** Initialize SCRIPT Variables
    app.scriptArgs.clear();
    app.scriptArgs.set("Department", "PrePress");
    app.scriptArgs.set("ErrorStyle", "*****Error while Updating!");
    app.scriptArgs.set("MsgStyle", "*****No UpDate! (Delete to Reset)");
    app.scriptArgs.set("Event_Path", myScriptPath); //***Path to InEventScript Plug-In
    app.scriptArgs.set("Event_Test", myScriptPath + "/"+myDept+"TEST.jsx"); //*** Debugging MODULE
    app.scriptArgs.set("Event_Open", myScriptPath + "/"+myDept+"OPEN.jsx");
    app.scriptArgs.set("Event_Close", myScriptPath + "/"+myDept+"CLOSE.jsx");
    app.scriptArgs.set("Event_Copy", myScriptPath + "/"+myDept+"COPY.jsx");
    app.scriptArgs.set("Event_Clean", myScriptPath + "/"+myDept+"CLEAN.jsx");
    app.scriptArgs.set("Event_Print", myScriptPath + "/"+myDept+"PRINT.jsx");
    app.scriptArgs.set("Event_App", myScriptPath + "/"+myDept+"APPPreferences.jsx");
    app.scriptArgs.set("Event_Doc", myScriptPath + "/"+myDept+"DOCPreferences.jsx");
    //*** Initialize GLOBAL Variables
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    SkipWRDS = new Array;
    //*** REMOVE all EVENTS
    app.eventListeners.everyItem().remove();
    //******************** EVENTS ********************
    //app.addEventListener("afterOpen", EventOpen, false); //STILL INDESIGN CRASH with OPEN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    var tmp = "List of Events loaded\n----------------------\n";
    var myEvents = app.eventListeners;
    for (var cpt = 0; cpt < myEvents.length; cpt++)
    tmp += "Event : " + myEvents[cpt].parent.name + "\tType: " + myEvents[cpt].eventType + "\n";
    //alert ("\tPREPRESS Area\n\t\==========\n\n"+tmp);
    alert ("\tTEST Area\n\t=======\n\n"+tmp);
    //******************** END Main ********************
    //****************** FUNCTIONS Definitions ********************
    function EventOpen (itsEvent)
    var myExeSrcFile = new File (app.scriptArgs.get("Event_Open"));
    if (myExeSrcFile.exists)
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    else
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    // itsEvent.preventDefault();
    // itsEvent.stopPropagation();
    itsEvent.parent.windows.add(); //*** Doc. has no Window!!!
    myExeSrcFile.open ('r:(read)');
    app.doScript(myExeSrcFile, ScriptLanguage.javascript);
    myExeSrcFile.close();
    else
    alert ("Error! Missing File:\n\n" + myExeSrcFile.fsName);
    return;
    Module PrePressTEST
    =====================
    #target indesign
    //#include "PrePressLIBRARY.jsxinc"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    if (app.modalState) //*** Alert already displayed
    exit();
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    exit();
    if (app.documents.length == 0)
    exit();
    var myDoc = app.activeDocument;
    //*** ALL DOCUMENTS PREFERENCE
    myDoc.textPreferences.showInvisibles = true;
    myDoc.viewPreferences.showRulers = true;
    myDoc.layoutWindows[0].transformReferencePoint = AnchorPoint.centerAnchor;
    alert (myDoc.name);
    //******************** END Main ********************
    Module PrePressEVENT
    =====================
    #target indesign
    #targetengine "session"
    app.scriptPreferences.version = 5.0;
    //******************** BEGIN Main ********************
    var myEvents = app.eventListeners;
    var tmp = "\nList of Events removed\n------------------------\n";
    for (var cpt = myEvents.length-1 ; cpt >= 0 ; cpt--)
    if (myEvents[cpt].eventType == "afterOpen")
    tmp += "Event #" + cpt + "\tType: " + myEvents[cpt].eventType + "\n";
    myEvents[cpt].remove(); //*** There MAY be MORE than 1 instance.
    //******************** EVENTS ********************
    app.addEventListener("afterOpen", EventOpen, false);
    tmp += "\nList of Events loaded\n----------------------\n";
    var myEvents = app.eventListeners;
    for (var cpt = 0; cpt < myEvents.length; cpt++)
    tmp += "Event : " + myEvents[cpt].parent.name + "\tType: " + myEvents[cpt].eventType + "\n";
    alert ("\tTEST Area\n\t=======\n\n"+tmp);
    //******************** END Main ********************
    //****************** FUNCTIONS Definitions ********************
    function EventOpen (itsEvent)
    // app.scriptArgs.set("Event_Listener", itsEvent.parent.toSource()); //*** PASS Argument
    var myExeSrcFile = new File (app.scriptArgs.get("Event_Test"));
    if (myExeSrcFile.exists)
    if (app.pdfPlacePreferences.pageNumber == 99999)
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    else
    app.pdfPlacePreferences.pageNumber = 1; //***Flag to PREVENT InEventScript Plug-In RECURSIVE (Loop)
    EventInfo (itsEvent);
    itsEvent.preventDefault();
    itsEvent.stopPropagation();
    itsEvent.parent.windows.add(); //*** Doc. has no Window!!!
    myExeSrcFile.open ('r:(read)');
    app.doScript(myExeSrcFile, ScriptLanguage.javascript);
    myExeSrcFile.close();
    alert ("Executed...");
    else
    alert ("Error! Missing File:\n\n" + myExeSrcFile.fsName);
    return;
    function EventInfo (itsEvent)
    var myString = "Handling Event: " +itsEvent.eventType;
    myString += "\r\rTarget: " + itsEvent.target + " " +itsEvent.target.name;
    myString += "\rCurrent: " +itsEvent.currentTarget + " " + itsEvent.currentTarget.name;
    myString += "\r\rPhase: " + GetPhaseName(itsEvent.eventPhase );
    myString += "\rCaptures: " +itsEvent.captures;
    myString += "\rBubbles: " + itsEvent.bubbles;
    myString += "\r\rCancelable: " +itsEvent.cancelable;
    myString += "\rStopped: " +itsEvent.propagationStopped;
    myString += "\rCanceled: " +itsEvent.defaultPrevented;
    myString += "\r\rTime: " +itsEvent.timeStamp;
    alert(myString);
    function GetPhaseName(myPhase)
    switch(myPhase){
    case EventPhases.atTarget:
    myPhaseName = "At Target";
    break;
    case EventPhases.bubblingPhase:
    myPhaseName = "Bubbling";
    break;
    case EventPhases.capturingPhase:
    myPhaseName = "Capturing";
    break;
    case EventPhases.done:
    myPhaseName = "Done";
    break;
    case EventPhases.notDispatching:
    myPhaseName = "Not Dispatching";
    break;
    return myPhaseName;

  • Table View MULTI SELECT option and Event handling problems

    Hello All,
    I am facing problem while giving miltselect option in a table view. When i mention multiselect attribute in Select option in table view, i am unable to select all the rows which i want to select,because i have an event onRowSelection event activated so when i select a row then it will automatically go to the event and i am unable to do multiple select.
    Can you guys pl tell me is there any way thtat i can put check boxes in a table column and by that i can get values of row seelct and can perform my subsequent SQL operation.
    Also i am not able to navigate in table view through BYPAGE or BYLINE option. When I click on navigate button then page got refreshed and i lost data.
    One more query guys , can you pl tell me how can i store my internal table values from one event for the another event. I have used EXport/Import but internal table values get refreshed as page got refreshed on event switching/selection.
    Please respond.

    hye rahul.
      as i told you my second solution, will help you . the values remain in the corresponding UI elements.
    For example , you have a drop down and table view. both will trigger events. bind the data of the table at drop down event and bind the dat of the drop down at table event.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    CASE event->id.
    when 'dd1'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    when 'tbv_id'.                   drop down event is fired.
    bind data for drop down
    dd ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'dropdown'
                                          id      = dd_id'           " name of the drop down id
    along with drop down bind data for table view
        tbv ?= cl_htmlb_manager=>get_data(
                                          request = runtime->server->request
                                          name    = 'tableView'
                                          id      = 'tbv_id'           " name of the table view
    This is how data should be binded in case of Stateless application. All the UI elemets must b binded again.. as the global data is refresed again.
    Hope this helps.
    Regards,
    Imran.

  • Does workgroup manager and OSX have problems?

    I am a classroom teacher using Adobe CS2 on 24 IMac G5's and 3 IMac G5's with the intel processor. I have had problems with Photoshop and Illustrator saving empty files and files disappearing. So my Tech people want to redo the server.
    They tell me that I can have only one group of users, because more groups causes many problems. At the present time I have four groups set up according to the different classes I teach. The groups are Desktop Publishing, Digital Photography, IWP Students and Night school. Each group has different programs and template files that they need for assignments.
    I have been told this using of two or more groups is what's causing saving problems with Adobe CS2 programs.
    They want to make one group for all students and I don't see why if workgroup manager sets preferences for each group (about 75 students in each group) that 2 or 4 groups is all that many. Right now each student is assigned to a group and only sees programs or files that are used in that group.
    If this new an improved setup is done then all students see everything and have access to all programs for all classes instead of just the group assigned to the class they are in.
    Am I missing something or isn't the server and workgroup manager supposed to be able to set up different groups so you can limit access.
    I want to limit access but the tech people want something easy and less limited. Are they right that the saving problems of Adobe CS2 programs is due to too many groups(4 total) with different preferences? Does Workgroup manager have problems with this type of setup? Are the Tech people just taking the easy way out to save on the new setup? Is my theory of limiting access wrong?
    I am from the days of At Ease with panels. I never had problems no file sharing no extra files or programs to use.
    Any opinions on the server setup with Workgroup Manager?
    Dennis

    Sorry I placed this in the wrong OS area and I don't know how to move it to the correct OS area. Can anyone help with that?
    Dennis

  • FocusListener and other listener problem

    I don't know why i can't catch Deactivated and LostFocus and other relevant event.
    I try to make a simplepanel as Popup because Jpopupmenu have some problem.
    please take a look.
    regards thanks
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ComponentEvent;
    import java.awt.event.ComponentListener;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowFocusListener;
    import java.awt.event.WindowListener;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JWindow;
    * Created on Jun 1, 2006
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author varamthanapon
    * TODO To change the template for this generated type comment go to Window -
    * Preferences - Java - Code Style - Code Templates
    public class SampleMain extends JApplet implements ActionListener,
              WindowFocusListener, ComponentListener, WindowListener {
         private JButton m_objJButton = null;
         private PopupPanel m_objPopupPanel = null;
         public SampleMain() {
              this.getContentPane().setLayout(new BorderLayout());
              JPanel mainPanel = new JPanel();
              mainPanel.setSize(500, 500);
              mainPanel.setLocation(500, 500);
              mainPanel.add(new JLabel("XXX"), BorderLayout.NORTH);
              this.getContentPane().add(mainPanel);
              JButton xbutton = new JButton("xxx");
              this.getContentPane().add(xbutton, BorderLayout.WEST);
              xbutton.addActionListener(this);
              m_objPopupPanel = new PopupPanel(this);
              this.addFocusListener(m_objPopupPanel);
              this.show();
         public class PopupPanel extends JWindow implements FocusListener {
              public PopupPanel(SampleMain obj) {
                   this.addWindowFocusListener(obj);
                   this.addComponentListener(obj);
                   this.addWindowListener(obj);
              * (non-Javadoc)
              * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
              public void focusGained(FocusEvent e) {
                   // TODO Auto-generated method stub
                   JOptionPane.showMessageDialog(new JPanel(), "XXX");
              * (non-Javadoc)
              * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
              public void focusLost(FocusEvent e) {
                   // TODO Auto-generated method stub
                   JOptionPane.showMessageDialog(new JPanel(), "XXX");
         * (non-Javadoc)
         * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
         public void actionPerformed(ActionEvent e) {
              // TODO Auto-generated method stub
              m_objPopupPanel.setSize(200, 50);
              m_objPopupPanel.setLocation(200, 50);
              m_objPopupPanel.show();
         * (non-Javadoc)
         * @see java.awt.event.WindowFocusListener#windowGainedFocus(java.awt.event.WindowEvent)
         public void windowGainedFocus(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowGainedFocus");
         * (non-Javadoc)
         * @see java.awt.event.WindowFocusListener#windowLostFocus(java.awt.event.WindowEvent)
         public void windowLostFocus(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowLostFocus");
         * (non-Javadoc)
         * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
         public void componentResized(ComponentEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "componentResized");
         * (non-Javadoc)
         * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
         public void componentMoved(ComponentEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "componentMoved");
         * (non-Javadoc)
         * @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent)
         public void componentShown(ComponentEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "componentShown");
         * (non-Javadoc)
         * @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent)
         public void componentHidden(ComponentEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "componentHidden");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowOpened(java.awt.event.WindowEvent)
         public void windowOpened(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowOpened");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
         public void windowClosing(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowClosing");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowClosed(java.awt.event.WindowEvent)
         public void windowClosed(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowClosed");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowIconified(java.awt.event.WindowEvent)
         public void windowIconified(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowIconified");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowDeiconified(java.awt.event.WindowEvent)
         public void windowDeiconified(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowDeiconified");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowActivated(java.awt.event.WindowEvent)
         public void windowActivated(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowActivated");
         * (non-Javadoc)
         * @see java.awt.event.WindowListener#windowDeactivated(java.awt.event.WindowEvent)
         public void windowDeactivated(WindowEvent e) {
              // TODO Auto-generated method stub
              JOptionPane.showMessageDialog(new JPanel(), "windowDeactivated");
    }

    I believe it's because Windows which don't have a visible parent frame are, by default, not focusable. Therefore they're never activated or focused.
    For the window to become focusable it needs a visible parent. Have a look at Window.isFocusableWindow method's Javadoc for information about how this works.
    There's also no point trying to force the window to be focusable using setFocusableWindowState - it still won't work without the visible parent frame.
    What's the problem with JPopupMenu? It seems unlikely that you'll write something better than that.
    Alternatively, you could try using an undecorated JDialog. Personally, I'd try resolving your differences with JPopupMenu!
    Hope this helps.

  • Simple Event Listener Problem

    Hi,
    I am new to EventListeners so this might seem very simple to some of you.
    Basically, I got a Frame (extending JFrame) into which I place several "Mini-JPanels". These panels are a separate class. In each of them there are a JCheckBox, a JLabel and some more unimportant elements.
    I would like to add an ItemListener to each JCheckBox but place the itemStateChanged method into my JFrame. Is this possible or do I have to put the itemStateChanged method into the panels... but then how would my Frame know that a checkbox in a panel has been checked?
    Thanks for your help,
    Frank

    hi, to use a Listener you call MyCeckbox.addItemListener( instancename of class where the events are computed). this class can be your Frame class. the class must implement the Methods of the Item Listener (itemStateCahanged for Example). In that Method the Event tells You what Component is the Source of the Event.

  • Bitmap Event Listener Problem :(

    Hey,
    I have encountered a bitmap problem while embeding my image into my project.
    Since event listeners don't work on Bitmaps I am having troubles on what to do next so I can use event listeners on my image.
    Main Class - The section that adds the image in the class:
    var playImage:Bitmap = new Assets.play();
    playImage.x = 190;
    playImage.y = 165;
    playImage.name = "play";
    addChild(playImage);
    playImage.addEventListener(MouseEvent.CLICK, playClick);
    playImage.addEventListener(MouseEvent.ROLL_OVER, playRollOver);
    playImage.addEventListener(MouseEvent.ROLL_OVER, moregamesRollOut, false, 0, true);
    // ^^ Those EventListeners don't function because the image is Bitmap and it won't allow me to add the photo as a MovieClip
    Assets Class - How I embedded the image in the class:
    [Embed(source="../images/play.png")]
    public static var play:Class;
    What method do you suggest I do to get event listeners working on my embedded image?
    I am working with pure as3 in Flash Builder.
    Thanks,
    McbainGames11

    I don't work in Flash Builder but...
    I usually create a Sprite, add that to the stage and then add the bitmap to the sprite. For instance:
    var playImageHolder:Sprite = new Sprite();
    addChild(playImageHolder);
    var playImage:Bitmap = new Assets.play();
    playImageHolder.addChild(playImage);
    playImageHolder.x = 190;
    playImageHolder.y = 165;
    // etc...

  • 10g and 11g  listener problems

    i've set up 11g on a Windows Xp machine that had 10gR2 previously installed.i created an 11g listener but i can not start it
    lsnrctl start LISTENER11g
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Starting tnslsnr: please wait...
    TNS-12560: TNS:protocol adapter error
    the 10g listener starts normally.
    almost forgot, my listener.ora file looks like this
    # listener.ora Network Configuration File: C:\oracle\product\product\11.1.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER11g =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1523))
    TRACE_FILE_LISTENER11g = LISTSNER11g
    TRACE_DIRECTORY_LISTENER11g = C:\oracle\product\product\11.1.0\db_1\NETWORK\trace
    i can't find any further logs/messages anywhere else

    no actually not together. i'm planning to keep the 11g listener (though i heard that problems may arise) but i'm curious to know what the problem is in fact.
    i found the log in
    C:\oracle\product\diag\tnslsnr\<PC_NAME>\listener11g\trace
    seems it's still considering it a setup stage, well the log simply says
    Tue Jan 22 13:24:38 2008
    System parameter file is c:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    Log messages written to c:\oracle\product\diag\tnslsnr\<PC_NAME>\listener11g\alert\log.xml
    Trace information written to c:\oracle\product\diag\tnslsnr\<PC_NAME>\listener11g\trace\ora_2968_3416.trc
    Trace level is currently 0
    the file ora_2968_3416.trc is not found
    i've set the TRACE_LEVEL_LISTENER11G to ADMIN and now i get
    Failed to start service,error 0
    Message was edited by:
    u_steven

  • Event Listener problems in browsers

    Hello,
    I'm having trouble with my List component. I'm trying to make
    an MP3 previewer, where users can select the song they wish to
    preview from a List (component). The problem is that it works just
    fine when I preview it locally, but it doesn't work properly in
    Firefox and sometimes in IE too. I've researched it on Google but
    it doesn't seem like anyone's had a similar problem. The Flash
    documentation also doesn't seem to present a solution.
    The structure of my design is as follows (in Actionscript):
    1. Read song names from a text file.
    2. Read the artist's name from a text file.
    3. Create a List component using song names as options.
    4. Create a class called Playback, which controls the
    playback of the selected song from the List.
    5. Create a class called Display, which displays the name of
    the selected song (this is irrelevant to the problem i think, but
    just listing it for the sake of completeness).
    6. Use addEventListener with List component to detect change
    in selection, and on change, call "playSong" and
    "displayNowPlaying" methods of Playback and Display classes.
    You can see what the previewer looks like and download all
    the files of it
    here.
    Please see if you can help me; I'm totally confused!
    Attached is the code on frame 1.
    Thanks,
    Mukul

    Nope that doesn't seem to solve the problem. I tried putting
    the listListener function and all the variable definitions outside
    of the onData, but still have the same problem! Is there a thing
    with the List component that you have to click into them before
    they're activated or something? Or might it be something with
    Firefox? It works almost all the time in IE.
    Thanks,
    Mukul

Maybe you are looking for

  • The Favorite Content Portlet could not be populated.Error Message

    Hi all, I am new in PORTAL, I made an Instant portlet which was working fine. But then started an error occuring when I view the Portal Page: "The Favorite Content Portlet could not be populated.Error Message." This error is show in a dialog box when

  • Hp officejet 4620 all in one

    I recently replaced my old modem & router with a new Gateway AGT784WNV Wireless Router.  I have a iMac running OS 10.7.5.  I could not use the wi fi to connect to printer as I could not locate the Network.  So I bought a 2.0 USB and connected it and

  • What does it take to complete a contract?

    Hello Gurus, I would like you to use a Sales Contract. Change the completion rule of the according Item Category to 'Not relevant for completion'. When you reference a sales order to this contract item, the contract status will stay open. What does i

  • Object type for multiple/text/unrestricted property

              Hi,           Does anybody know what's the object type for multiple/text/unrestricted property.           I tried to use um:setproperty tag to set the value of a multiple/text/unrestricted           type property in jsp. I got the following

  • Logic Pro X compatibility with mbox 2 mini and 2009 core duo macbook

    I currently have Pro Tools LE 8.0.3 and an Mbox2 Mini, both of which amazingly still work on Mountain Lion 10.8.4.  I'm interested in learning Logic and am trying to confirm compatitility with the Mbox2 Mini on a first generation core duo Aluminum Ma