Using Multiple Event Listeners

Hi,
I have a movielcip (A) class in which I have used a Tween class effect on a child movieclip (B) scrollRect. The (B) Movieclip in turn has several movieclips whose have tween class effect being executed on thier child movieclips.
the tweens are all unique to each movieclip
and the event listeners are taken off once completed.
This works all well and good in FLASH IDE...
My problem arises when I try to view this in a browser on a Windows XP
it doesnt work in
Opera Version 9.63
Firefox 2.0
and Google Chrome 2.0
The only browser it works fluently in is
Internet Explorer 7.0.5
What is happening in most cases it that the animation appears to "stick" but i think what may be happening is the listening or removal of the event listeners. The animations are left incompleted.
Is there any rule of thumb when using multiple event listeners?
here is a snippet of some of my code
on click event from movieclip (A)
private function scrollToSlidePrev(e:MouseEvent) {
               if (((slideIndex - 1) >= 0)) {
                    nextButton.mouseEnabled = nextButton.enabled = previousButton.enabled = previousButton.mouseEnabled = false;
                    var position:Number = 0-SLIDEAREA.width;
                    var slide1:TileListSlide = slides[slideIndex] as TileListSlide;
                    var slide2:TileListSlide = slides[--slideIndex] as TileListSlide;
                    scrollSlide(position,slide1,slide2);
tween animation in movieclip (A) on (B)
private function scrollSlide(pos:int,slide1:TileListSlide,slide2:TileListSlide) {
               slide1.resizeSlideTo(0.6); // execute tween on child movie clips in B
               slide2.resizeSlideTo(1); // same as above;
               var rect:Rectangle = sliderMc.scrollRect;
               var tween1:Tween = new Tween(rect,"x",Regular.easeOut,rect.x,rect.x + pos,3,true);
               tween1.addEventListener(TweenEvent.MOTION_CHANGE,setSliderScroll,false,4);
               tween1.addEventListener(TweenEvent.MOTION_FINISH,toggleButtonEnabled,false,3);
tween animation in movieclip (B) children
public function resizeSlideTo(sc) {
               var m:Matrix = tileList.transform.matrix as Matrix;
               var p:Point = new Point (m.a, 0);
               var tween2:Tween = new Tween(p,"x",Regular.easeOut,p.x,sc,3,true);
               if (numericStepper != null) {
                    if (sc != 1) {
                         numericStepper.visible = false;
                         tween2.removeEventListener(TweenEvent.MOTION_FINISH,showStepper);
                    if (sc === 1) {
                         tween2.addEventListener(TweenEvent.MOTION_FINISH,showStepper,false,2);
               tween2.addEventListener(TweenEvent.MOTION_CHANGE,setScaleOnScroll,false,3);
here is the link
http://visual_admin.web.aplus.net/ticker/ticker_widget.html
the effect disables and re-enables the buttons when its done.... then the listeners are removed.
each one with the exception cretes its own unique tween (obviously this is a custom class built as each clip)
i really don't know what to make of it guys         

apparantly making the tween a property of the class rather than a random variable in a function worked.....go figure

Similar Messages

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • Multiple Event Listeners

    Is it possible to have event listeners apply to multiple objects, instead of creating multiple functions?
    I'm just wondering if there is an easier way than making a new function for the same event listeners for each object I want to apply it to.  Here's my code thus far, just to clarify what I'm talking about:
    import gs.*;
    var mc_homeX:Number = mc_home.x;
    var mc_productsX:Number = mc_products.x;
    var mc_msdsX:Number = mc_msds.x;
    var mc_environmentX:Number = mc_environment.x;
    mc_home.addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
    mc_home.addEventListener(MouseEvent.MOUSE_OUT, onOut, false, 0, true);
    function onOver(e:MouseEvent):void
         TweenLite.to(e.target, .2, {x:mc_homeX-10});
    function onOut(e:MouseEvent):void
         TweenLite.to(e.target, .2, {x:mc_homeX});
    I've only starting adding the listeners to mc_home, but I'd like to apply them to all.  Any help would be appreciated.  Thanks.

    import gs.*;
    var mc_homeX:Number = mc_home.x;
    var mc_productsX:Number = mc_products.x;
    var mc_msdsX:Number = mc_msds.x;
    var mc_environmentX:Number = mc_environment.x;
    var mcA:Array=[mc_homeX,mc_productsX,etc];
    for(var i:uint=0;i<mcA.length;i++){
    mcA[i].addEventListener(MouseEvent.MOUSE_OVER, onOver, false, 0, true);
    mcA[i].addEventListener(MouseEvent.MOUSE_OUT, onOut, false, 0, true);
    function onOver(e:MouseEvent):void
         TweenLite.to(e.target, .2, {x:mc_homeX-10});
    function onOut(e:MouseEvent):void
         TweenLite.to(e.target, .2, {x:mc_homeX});
    I've only starting adding the listeners to mc_home, but I'd like to apply them to all.  Any help would be appreciated.  Thanks.

  • How to use multiple events on one project?

    I want to make a show reel, this obviously involves using various events.
    I'm worried if I do this the whole file system will be a mess. Surely I should be sopying any files I want to use into the new showreel folder?
    How can i do this?
    Or is using various events ok?
    Hope someone ca recomend the best way forward

    You can edit from any event into the project. There is no need to copy the clips into a new event. When you're done you can archive the used clips into a new event.

  • Multiple Event Listeners on same property?

    I have assigned two event listeners to the same property:
    full_loader1.contentLoaderInfo.addEventListener (Event.COMPLETE, fullLoaded1);
    full_loader1.contentLoaderInfo.addEventListener (Event.COMPLETE, tweenOut2);
    So far it works fine. I am just wondering if there is a hidden penalty that I am eventually to learn about.

    Thanks for the answer.
    ...  but i would call tweenOut2() from fullLoaded1().
    I had that first, but got a dialog telling me that "tweenOut2" needs to be called from its original caller. That's why I came up with the double Event Listener solution.

  • How Do I create a Modular Function for use with Event Listeners

    OK I'm very new to AS3 and I'm curious as to how to get
    modular functions to work in AS3.
    for instance if I have this code:
    function snowfall(snowflake:MovieClip, movement:Number):void
    snowflake.y = movement;
    snowfall(snowflake1_mc, 10);
    snowfall(snowflake2_mc, 20);
    snowfall(snowflake3_mc, 30);
    Now on the stage I place 3 instances of a snowflake movie
    clip. Each time I call the "snowfall" function I refer to a new
    instance of the snowflake movie clip and a different amount of
    movement along the y axis.
    This is great but what if I want to use a button to control
    these snowflake movie clips and I want to maintain that modular
    nature? I don't really get how to do this. I created a button with
    an instance name of "myButton" and I've tried this code but it is
    throwing an error I don't really understand:
    myButton.addEventListener(MouseEvent.CLICK,
    snowfall(snowflake3_mc, 30));
    Can I not pass information to a function using an
    EventListener?

    Hi --
    What you want to do on your button is this..
    myButton.addEventListener(MouseEvent.CLICK,snowfall)
    Then in the function you can check which button called the
    function using
    properties of the event..
    function snowfall(event:MouseEvent) {
    trace(event)
    I am not sure off the top of my head of the data available in
    the "event"
    but the trace will show you all the variables you can access.
    As far as the amount of movement -- how is this information
    set? You can
    keep this in a global variable and then read it from inside
    the event
    handler rather than needing to pass it to the event.
    Rich
    "HalcyonCollective" <[email protected]>
    wrote in message
    news:fl695r$l95$[email protected]..
    > OK I'm very new to AS3 and I'm curious as to how to get
    modular functions
    > to
    > work in AS3.
    >
    > for instance if I have this code:
    >
    >
    function snowfall(snowflake:MovieClip, movement:Number):void
    > {
    > snowflake.y = movement;
    > }
    >
    > snowfall(snowflake1_mc, 10);
    > snowfall(snowflake2_mc, 20);
    > snowfall(snowflake3_mc, 30);
    >
    > Now on the stage I place 3 instances of a snowflake
    movie clip. Each time
    > I
    > call the "snowfall" function I refer to a new instance
    of the snowflake
    > movie
    > clip and a different amount of movement along the y
    axis.
    >
    > This is great but what if I want to use a button to
    control these
    > snowflake
    > movie clips and I want to maintain that modular nature?
    I don't really get
    > how
    > to do this. I created a button with an instance name of
    "myButton" and
    > I've
    > tried this code but it is throwing an error I don't
    really understand:
    >
    >
    myButton.addEventListener(MouseEvent.CLICK,
    snowfall(snowflake3_mc,
    > 30));
    >
    > Can I not pass information to a function using an
    EventListener?
    >

  • Hlep in deleting Componantes using Key event listeners.

    Hi All,
    I am tring to write a GUI program. I am dragging componets from the left side of the panel to the right side of the panel. Everything works well as of now. But i am tring to delete the componets which i placed on the right side of the paenl using key stroke events. Can anyone tell how this can be done. I have like labels and textfield componeets.
    Please help
    Smitha

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.Border;
    public class KeyDeletion extends JPanel {
        JComponent selectedComponent;
        public KeyDeletion(JFrame f) {
            setLayout(null);
            Dimension d = new Dimension(65,25);
            for(int j = 0; j < 4; j++) {
                JLabel label = new JLabel("label " + (j+1),
                                           JLabel.CENTER);
                label.setBorder(BorderFactory.createEtchedBorder());
                int x = 20 + j*(d.width + 25);
                int y = 20 + j*(d.height + 75);
                label.setBounds(x, y, d.width, d.height);
                add(label);
            addMouseListener(ma);
            registerKey(f);
        /** Press the "x" key to delete selected label. */
        private void registerKey(JFrame f) {
            JRootPane jrp = f.getRootPane();
            int c = JComponent.WHEN_IN_FOCUSED_WINDOW;
            jrp.getInputMap(c).put(KeyStroke.getKeyStroke("X"), "DELETE");
            jrp.getActionMap().put("DELETE", deleteAction);
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            KeyDeletion panel = new KeyDeletion(f);
            f.add(panel);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
        private MouseAdapter ma = new MouseAdapter() {
            Border etched = BorderFactory.createEtchedBorder();
            Border select = BorderFactory.createLineBorder(Color.red);
            JComponent lastSelection;
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                Component[] c = getComponents();
                boolean haveSelection = false;
                for(int j = 0; j < c.length; j++) {
                    Rectangle r = c[j].getBounds();
                    if(r.contains(p)) {
                        setSelection(c[j]);
                        haveSelection = true;
                        break;
                if(!haveSelection && selectedComponent != null) {
                    setSelection(null);
            private void setSelection(Component c) {
                selectedComponent = (JComponent)c;
                if(c != null)
                    selectedComponent.setBorder(select);
                if(lastSelection != null)
                    lastSelection.setBorder(etched);
                lastSelection = selectedComponent;
        private Action deleteAction = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                if(selectedComponent != null) {
                    remove(selectedComponent);
                    selectedComponent = null;
                    repaint();
    }

  • Help on Multiple Event Listeners

    Hi:
    How do you implement both ItemListener and ListSelectionListener in the same interface? In another word, how do I put JRadioButton, JList, JComboBox...etc,each one with its own listener in init() method? I came up with the following program. Anyone have any idea fixing the problem?
    import javax.swing.*;
    import java.awt.*; //for border layout
    import javax.swing.event.*; //for ListSelectionListener
    import java.awt.event.*;
    public class TextFormatter03 extends JApplet implements ActionListener
    private Container masterPane, slavePane, bottomPane;
    private JTextArea textPanel;
    private JScrollPane textScrollPane;
    private JRadioButton courierButton, serifButton, arialButton;
    private JList sizeList;
    private JCheckBox boldStyle,italicStyle;
    private JComboBox fontColor;
    private String colorItems[]={"Cyan","Green","Red","Blue","Magenta"};
    private String sizeItems[]={"30","28","26","24","22"};
    private String custFont;
    private int custStyle, custSize;
    public void init()
    //get the content pane to add component on to
    masterPane = this.getContentPane();
    //deal with font
    serifButton = new JRadioButton("Serif");
    serifButton.setSelected(true);
    courierButton = new JRadioButton("Courier");
    courierButton.setSelected(false);
    arialButton = new JRadioButton("Arial");
    arialButton.setSelected(false);
    //group the radio buttons
    ButtonGroup group= new ButtonGroup();
    group.add(serifButton);
    group.add(courierButton);
    group.add(arialButton);
    //register a listener for the radio buttons
    serifButton.addActionListener(this);
    courierButton.addActionListener(this);
    arialButton.addActionListener(this);
    masterPane.add(group, BorderLayout.NORTH);
    //deal with font size
    sizeList = new JList (sizeItems);
    sizeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    sizeList.addListSelectionListener(this);
    slavePane = new JScrollPane(sizeList,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    masterPane.add(slavePane, BorderLayout.WEST);
    //display text
    textPanel= new JTextArea();
    textPanel.setText("Select options to modify this text.");
    textPanel.setBackground(Color.WHITE);
    textPanel.setLineWrap(true);
    textScrollPane = new JScrollPane(textPanel);
    masterPane.add(textScrollPane, BorderLayout.CENTER);
    textPanel.setFont(new Font("Serif",3,15));
    //deal with font color
    fontColor= new JComboBox(colorItems);
    masterPane.add(fontColor);
    //deal with font style
    boldStyle = new JCheckBox("Bold");
    boldStyle.setSelected(false);
    boldStyle.addItemListener(this);
    bottomPane.add(boldStyle);
    italicStyle = new JCheckBox("Italic");
    italicStyle.setSelected(false);
    italicStyle.addItemListener(this);
    bottomPane.add(italicStyle);
    add(bottomPane, BorderLayout.SOUTH);      
    public void actionPerformed(ActionEvent e)
         String Selected = "result";
         //set the font
         if(serifButton.isSelected())
              custFont="Serif";
         if(arialButton.isSelected())
              custFont="Arial";
         if(courierButton.isSelected())
              custFont="Courier";
         //set font style
         if(boldStyle.isSelected())
              custStyle = Font.BOLD;
         if(italicStyle.isSelected())
              custStyle = Font.ITALIC;
         if(boldStyle.isSelected()&&italicStyle.isSelected())
              custStyle = Font.BOLD + Font.ITALIC;
    public void valueChanged(ListSelectionEvent event)
         String response = "";
         //set the font size
         if(sizeList.getSelectedIndex()!=-1)
              switch (sizeList.getSelectedIndex())
                   case 0:
                        custSize = 30;
                        break;
                   case 1:
                        custSize = 28;
                        break;
                   case 2:
                   custSize = 26;
                   break;     
                   case 3:
                   custSize = 24;
                   break;     
                   case 4:
                   custSize = 22;
                   break;     
                   textPanel.setFont(new Font (custFont, custStyle,custSize));
         //set font color
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Green")
              textPanel.setForeground(Color.GREEN);
         if(fontColor.getSelectedItem()=="Red")
              textPanel.setForeground(Color.RED);
         if(fontColor.getSelectedItem()=="Blue")
              textPanel.setForeground(Color.BLUE);
         if(fontColor.getSelectedItem()=="Magenta")
              textPanel.setForeground(Color.MAGENTA);
    }

    Help. The program didn't compile. I followed what you suggested. Here are the program and the error message.
    import javax.swing.*;
    import java.awt.*; //for border layout
    import javax.swing.event.*; //for ListSelectionListener
    import java.awt.event.*;
    public class TextFormatter03 extends JApplet implements ActionListener, ItemListener,ListSelectionListener
    private Container masterPane, slavePane, bottomPane;
    private JTextArea textPanel;
    private JScrollPane textScrollPane;
    private JRadioButton courierButton, serifButton, arialButton;
    private JList sizeList;
    private JCheckBox boldStyle,italicStyle;
    private JComboBox fontColor;
    private String colorItems[]={"Cyan","Green","Red","Blue","Magenta"};
    private String sizeItems[]={"30","28","26","24","22"};
    private String custFont;
    private int custStyle, custSize;
    public void init()
    //get the content pane to add component on to
    masterPane = this.getContentPane();
    //deal with font
    serifButton = new JRadioButton("Serif");
    serifButton.setSelected(true);
    courierButton = new JRadioButton("Courier");
    courierButton.setSelected(false);
    arialButton = new JRadioButton("Arial");
    arialButton.setSelected(false);
    //group the radio buttons
    ButtonGroup group= new ButtonGroup();
    group.add(serifButton);
    group.add(courierButton);
    group.add(arialButton);
    //register a listener for the radio buttons
    serifButton.addActionListener(this);
    courierButton.addActionListener(this);
    arialButton.addActionListener(this);
    masterPane.add(group, BorderLayout.NORTH);
    //deal with font size
    sizeList = new JList (sizeItems);
    sizeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    sizeList.addListSelectionListener(this);
    slavePane = new JScrollPane(sizeList,
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    masterPane.add(slavePane, BorderLayout.WEST);
    //display text
    textPanel= new JTextArea();
    textPanel.setText("Select options to modify this text.");
    textPanel.setBackground(Color.WHITE);
    textPanel.setLineWrap(true);
    textScrollPane = new JScrollPane(textPanel);
    masterPane.add(textScrollPane, BorderLayout.CENTER);
    textPanel.setFont(new Font("Serif",3,15));
    //deal with font color
    fontColor= new JComboBox(colorItems);
    masterPane.add(fontColor);
    //deal with font style
    boldStyle = new JCheckBox("Bold");
    boldStyle.setSelected(false);
    boldStyle.addItemListener(this);
    bottomPane.add(boldStyle);
    italicStyle = new JCheckBox("Italic");
    italicStyle.setSelected(false);
    italicStyle.addItemListener(this);
    bottomPane.add(italicStyle);
    add(bottomPane, BorderLayout.SOUTH);      
    public void actionPerformed(ActionEvent e)
         String Selected = "result";
         //set the font
         if(serifButton.isSelected())
              custFont="Serif";
         if(arialButton.isSelected())
              custFont="Arial";
         if(courierButton.isSelected())
              custFont="Courier";
         //set font style
         if(boldStyle.isSelected())
              custStyle = Font.BOLD;
         if(italicStyle.isSelected())
              custStyle = Font.ITALIC;
         if(boldStyle.isSelected()&&italicStyle.isSelected())
              custStyle = Font.BOLD + Font.ITALIC;
    public void valueChanged(ListSelectionEvent event)
         String response = "";
         //set the font size
         if(sizeList.getSelectedIndex()!=-1)
              switch (sizeList.getSelectedIndex())
                   case 0:
                        custSize = 30;
                        break;
                   case 1:
                        custSize = 28;
                        break;
                   case 2:
                   custSize = 26;
                   break;     
                   case 3:
                   custSize = 24;
                   break;     
                   case 4:
                   custSize = 22;
                   break;     
                   textPanel.setFont(new Font (custFont, custStyle,custSize));
         //set font color
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Cyan")
              textPanel.setForeground(Color.CYAN);
         if(fontColor.getSelectedItem()=="Green")
              textPanel.setForeground(Color.GREEN);
         if(fontColor.getSelectedItem()=="Red")
              textPanel.setForeground(Color.RED);
         if(fontColor.getSelectedItem()=="Blue")
              textPanel.setForeground(Color.BLUE);
         if(fontColor.getSelectedItem()=="Magenta")
              textPanel.setForeground(Color.MAGENTA);
    TextFormatter03.java:6: TextFormatter03 should be declared abstract; it does not define itemStateChanged(java.awt.event.ItemEvent) in TextFormatter03
    public class TextFormatter03 extends JApplet implements ActionListener, ItemListener,ListSelectionListener
    ^
    java:44: cannot resolve symbol
    symbol : method add (javax.swing.ButtonGroup,java.lang.String)
    location: class java.awt.Container
    masterPane.add(group, BorderLayout.NORTH);
    ^
    2 errors
    Process completed.

  • Removing All Event Listeners

    If you have multiple event listeners running, is there any way to remove all of them at once rather than one at a time?
    Thanks,
    Jeff

    Near the end of the article linked below is one approach that someone has used involving an array:
    http://www.almogdesign.net/blog/actionscript-3-event-listeners-tips-tricks/

  • Multiple event cases ?

    I hear people saying do not use multiple event cases.
    is this in reference to multiple event cases in the same loop?
    is it ok to use 1 event structure per parallel loop?
    what happens if you have two parallel loops reacting to the same event?
    - James
    Using LV 2012 on Windows 7 64 bit

    James R wrote:
    I hear people saying do not use multiple event cases.
    Who are these people??! There is nothing wrong with an event structure containing multiple event cases.
    James R wrote:
    is this in reference to multiple event cases in the same loop?
    Yes, you should only have one event structure per loop, but that event structure can have multiple cases.
    James R wrote:
    is it ok to use 1 event structure per parallel loop?
    Yes. What makes you think otherwise?
    James R wrote:
    what happens if you have two parallel loops reacting to the same event?
    Nothing unusual. They will both fire whenever that associated event occurs. No problem!
    LabVIEW Champion . Do more with less code and in less time .

  • Is it possible to handle multiple events using Jscript for a button in Apex

    Hi,
    I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
    2. display a set of values on 'mouse over' that button.
    I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
    Thanks in advance,
    gsachidh

    Hi Gsachidh,
    well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
    A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
    Target set to => URL
    URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
    Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
    Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
    Simon
    Message was edited by:
    S1M0N

  • Multiple Listeners - Multiple Event Handlers

    According to the tutorial, event handling code executes in a single event dispatching thread to ensure that each event handler finishes execution before the next executes. I'm also aware that I can add multiple action listeners to a single component, like JButton. But if I add mutliple listeners to a component, is there any way to determine in what order the event handling code will execute? Is there an order to which the listeners listen..
    Thanks in advance.

    Thanks to both of you for your responses and suggestions.
    camickr...
    I don't think its good style to add multiple listeners
    and write code dependent on the order of execution.I appreciate your candor here and I'm inclined to agree. So I've reorganized things a bit and I don't need to have the listeners in any particular order. But thank you for taking a look at the source code. It didn't occur to me to do that. That is interesting.
    Deudeu..
    If you require a specific sequential order you should create cascading eventsThis would be a way to resolve the issue of sequential response. When I changed my design a bit however, I didn't need to perform anything sequentially.

  • Displaying the selected multiple records from node using onleadselect event

    Hi all,
    How to display the selected multiple records from node to node using onleadselect event.
    i came to know tht to fulfill this requirement i need to use the method get_selected_elements,
    how to use this method in my event??
    sree

    Hi Sree,
    Try below code..
    DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,             // This is first node
                 lo_el_it_lips TYPE REF TO if_wd_context_element,
                 ls_it_lips TYPE wd_this->Element_it_lips,
                 lt_it_lips TYPE wd_this->Elements_it_lips.
               DATA: wa_temp TYPE REF TO if_wd_context_element,
                lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <IT_LIPS> via lead selection
          lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
          CALL METHOD lo_nd_it_lips->get_selected_elements
            EXPORTING
                INCLUDING_LEAD_SELECTION = ABAP_true
            RECEIVING
              set = lt_temp.
          DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.          //Second Node
          DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
          DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
          DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
    * navigate from <CONTEXT> to <PACK_MAT> via lead selection
          lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
          lo_nd_pack_mat->get_static_attributes_table( importing table = lt_pack_mat ).
          LOOP AT lt_temp INTO wa_temp.
            CALL METHOD wa_temp->get_static_attributes
              IMPORTING
                static_attributes = ls_it_lips.
                  ls_pack_mat-vbeln = ls_it_lips-vbeln.
                  ls_pack_mat-material = ls_it_lips-matnr.
                  ls_pack_mat-vgbel = ls_it_lips-vgbel.
                    append ls_it_lips to lt_unpack.
                  CLEAR ls_pack_mat.
           ENDLOOP.
    Cheers,
    Kris.

  • Remove Event Listeners (at the right time)

    I have a app which loads multiple flv's, I also have a timer
    (digial) which shows how long the movie has been played for. The
    problem is that whenever i load and new move (through the same
    "loadVideos()" function, the timer variables ("lagTime", "endTime")
    are not reset (even though the correct variables are being passed.
    I believe it has something to do with the event listeners which are
    being used to load the movies. How can i clear all the listerner
    before reloading the movies?
    Here is a code snippet:
    Thanks in advance

    Thanks, kglad
    Yes it traces 'endTime' but what happens is that when i play
    the first movie is will display for example ("40,40,40,40" etc...)
    until the video stops playing. If i load another movie it will then
    trace ("40, 20, 40, 20, 40" etc...) so i need to kill the
    listereners and reload the variables.
    Jake

  • DAC Form: Using rowsetPopulated event (NullPointerException raised!!)

    Hi,
    I am using rowsetPopulated event to display the total
    of my column field.I have a textfield for this purpose
    All goes well as far as showing the total is concerned
    in the textField.
    But, when I click the total textfield (although I donot require to do this!!) I get a NullPointerException.
    This is the output in the console :
    java.lang.NullPointerException
    oracle.dacf.dataset.InfoObject oracle.dacf.dataset.ValidationManager._findProducer(java.lang.String)
    oracle.dacf.dataset.InfoObject oracle.dacf.dataset.ValidationManager.getInfoObject(java.lang.String)
    void oracle.dacf.control.NavigationManager.displayLOV(java.lang.String)
    boolean oracle.dacf.control.NavigationManager._changeFocus(java.lang.String, java.lang.String, boolean)
    boolean oracle.dacf.control.NavigationManager.validateFocusChange(oracle.dacf.control.Control)
    void oracle.dacf.control.swing.TextFieldControl.focusGained(java.awt.event.FocusEvent)
    void java.awt.AWTEventMulticaster.focusGained(java.awt.event.FocusEvent)
    void java.awt.Component.processFocusEvent(java.awt.event.FocusEvent)
    void javax.swing.JComponent.processFocusEvent(java.awt.event.FocusEvent)
    void java.awt.Component.processEvent(java.awt.AWTEvent)
    void java.awt.Container.processEvent(java.awt.AWTEvent)
    void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    boolean java.awt.LightweightDispatcher.setFocusRequest(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Container.proxyRequestFocus(java.awt.Component)
    void java.awt.Component.requestFocus()
    void javax.swing.JComponent.requestFocus()
    void javax.swing.text.DefaultCaret.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.AWTEventMulticaster.mousePressed(java.awt.event.MouseEvent)
    void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
    void java.awt.Component.processEvent(java.awt.AWTEvent)
    void java.awt.Container.processEvent(java.awt.AWTEvent)
    void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
    boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
    boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
    void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
    void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
    void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
    boolean java.awt.EventDispatchThread.pumpOneEvent()
    void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
    void java.awt.EventDispatchThread.run()
    How do I go about it?
    TIA
    Sandeep
    null

    As many of the recent posts on this forum indicate, we have done extensive work on improving the documentation for JDeveloper 3.2. Here is an excerpt from one of the sections which describes Validation and Change events. I'll post a description of the Navigation events in another message due to size limitations.
    About InfoProducer Change Events
    Calculated fields display values that depend on the values of other fields. For instance, the value of a Total field may be calculated at the level of the row or the rowset. The AttributeInfo or RowSetInfo components provide a set of events that you can use to assess when column data has changed and perform updates of calculated fields on the Java client. When one of these events fires, the application can perform an automatic calculation to update the contents of the calculated field.
    The following table provides a high-level description of these InfoProducer-change events:
    Event Type
    Triggering Action
    attributeChanged
    Occurs when an attribute's value is changed.
    rowAdded
    Occurs when a row is added to a rowset.
    rowUpdated
    Occurs when a row is updated in a rowset.
    rowToBeRemoved
    Occurs when a row is about to be removed from a rowset. This event fires when a user presses the Delete key, but before the row is actually deleted from the rowset.
    rowsetCleared
    Occurs when all rows are deleted and the rowset is cleared.
    rowsetPopulated
    Occurs when the rowset is populated, for example, when a user navigates to the next item in the master table or when a new query is executed (for example, by submitting a parameterized query using the Find Panel).
    In summary, data form events let you update a calculated field when a user:
    Updates a field value
    Adds and removes rows
    Displays a new detail
    About InfoProducer Validation Events
    In those situations where you need to perform validation in the data form, the InfoProducer components provide a rich set of UI-validation events that you can exploit. For example, you might use an InfoProducer-validation event:
    To enable the Commission field when a user adds a new employee to either the Sales or Consulting department.
    To automatically calculate a new running total whenever the quantity or price of a line item is changed on an order entry form.
    You can define InfoProducer-validation events for:
    SessionInfo data item objects, which can receive the following events:
    validateRowSet
    validateRow
    validateAttribute
    RowSetInfo data item objects, which can receive the following events:
    validateRowSet
    validateRow
    validateAttribute
    AttributeInfo data item objects, which can receive the following event:
    validateAttribute
    The following table highlights the differences between these various InfoProducer-validation levels:
    Event Type
    Triggering Action
    Use when you want to:
    validateRowSet
    Occurs when focus changes from one modified RowSet to another RowSet in the same session.
    Note: Currently there is no session-level event support.
    Perform a calculation over all the rows in a RowSet
    For example, when the sum of the order items cannot exceed a prescribed customer order limit.
    Perform a validation across multiple rows
    For example, to verify that only one person is the head of a department.
    validateRow
    Occurs when focus changes from one row to another row in the same RowSet.
    Perform a validation across multiple columns
    For example, when the sum of the salary plus commission plus a sign-on bonus cannot exceed a maximum, and you want to defer validation until the user has finished entering or updating all fields.
    validateAttribute
    Occurs when focus changes from one modified Attribute (column) to another Attribute in the same Row.
    Ensure the validity of data at an atomic level
    For example, to check the state of an order states: pending, backordered, or awaiting_confirmation.
    Provide feedback to the user as quickly as possible
    For example, when a credit card number is invalid.
    How Data Forms Propogate InfoProducer Validation Events
    When a user's data form interaction generates a validation, the data form typically propagates the event to more than one bound InfoProducer object. For example, the simple action of selecting a field in a new row of a InfoSwing grid will trigger these events:
    validateAttribute on the bound AttributeInfo object
    validateAttribute on the bound RowSetInfo object
    validateAttribute on the bound SessionInfo object
    validateRow on the bound RowSetInfo object
    validateRow on the bound SessionInfo object
    validateRowSet on the bound RowSetInfo object
    validateRowSet on the bound SessionInfo object
    Because user interactions can trigger events across multiple bound InfoProducer objects, data forms follow an event hierarchy that determines the sequence by which the system seeks to handle the event. InfoProducer events propagate up a tree structure that is based on the heirarchy of attributes, rows, and rowsets.
    The hierarchy of InfoProducer events is represented by this tree:
    RS1
    R1 R2
    A1 A2 A3 A4
    where the attribute events fire first (at the bottom of the tree), followed by the row events, and finally the rowset events.
    When the user generates a validation event for a bound InfoProducer object, the data form generates the corresponding events depending on where in the tree the action takes place. For example:
    Moving between two rows in the same rowset (from R1 to R2), would generate these validation events (assuming the user moved the focus from the field for A1):
    validateAttribute event delivered at A1, R1, RS1
    validateRow event delivered at R1, RS1, and the session
    validateRowSet event delivered at RS1 and the session
    Moving between two attributes in the same row (from A1 to A2), would generate these validation events:
    validateAttribute event delivered at A1, R1, RS1, and the session
    The following table describes the complete sequence in which InfoProducer validation events are first fired and then delivered to listeners:
    Events are fired in this order:
    Events are delivered in this order:
    1. attribute events
    At the attribute level
    At the row level
    At the rowset level
    At the session level
    2. row events
    At the row level
    At the rowset level
    At the session level
    3. rowset events
    At the rowset level
    At the session level
    Handling InfoProducer Events at the Desired Level
    The InfoProducer object you choose to handle the attribute, row, or rowset event, will be based on:
    The nature of the event
    The response required by the event
    For instance, to write more efficient code, you may choose not to handle attribute events at the level of the AttributeInfo object. Instead, you could write a single event handler for the RowSetInfo object to perform validation for all the fields.
    Thus, the further up the hierarchy you position your event handler, the more generic the response will be.
    null

Maybe you are looking for

  • Office 2013 Product Activation License Management

    Office 2013 Home and Business does not list my Product Keys for me to easily manage and install. As the IT Manager of over 200 PC's - I need to see Product Keys and their machine association...... 

  • Need help with output for D5

    Hi, I need some help getting my film in sync to a D5. The film was shot on MiniDV and edited drop frame (29.97). What we did first is output on miniDV and dubbed that to a D5 for color correction. Everything was in sync with the timeline. Then my fri

  • Ciscoworks LMS 3.2 compliance mgmt negation problem 2

    Sorry one more question, If I also wanted to remove all SNMP traps bar: - snmp-server host 10.10.10.x (where x is any ip in the last octet) From a device, would I use - [#snmp-server host (!#10\.10\.10\..*#).#] Any help appreciated

  • Who selected the default list of product forums, and why?

    I am struck by the odd list of product forums listed at the entry point to the new forums (http://forums.adobe.com/index.jspa). There are one-click icons that jump to the Flash Player, Acrobat, Flash, Photoshop Elements, Dreamweaver, Livecycle, Photo

  • Setting up and running iPhoto and Aperture together.

    I'm trying to figure out if it's possible to use iPhoto as my main image library. I want to be able to import pictures from my camera straight to iPhoto. But i would like to also have it set up to be able to edit pictures in Aperture but save them ba