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.

Similar Messages

  • 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

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

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

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

  • Help me I'm trying to create event listeners

    I am trying to create event listeners
    Whenever any keyboard event occurs the string s gets appended by a,c
    or p.At the end of the program its supposed to print value of s
    But s always happens to null.Please tell me how to correct it....so
    that detection is possible for any case
    import java.io.*;
    import java.awt.event.*;
    public class trial {
    int x;
    public static String s;
    //OutputStream f1=new FileOutputStream("file2.txt");
    public static void keyReleased(KeyEvent e)
    s=s+"a";
    public static void keyPressed(KeyEvent e)
    s=s+"c";
    public static void keyTyped(KeyEvent e)
    s=s+"p";
    public static void main(String args[])
    throws IOException
    char c;
    BufferedReader br =new BufferedReader(new
    InputStreamReader(System.in));
    System.out.println("Entercharactes,'q' to quit.");
    do
    c=(char)br.read();
    System.out.println(c);
    while(c!='q');
    // for(int i=0;i<s.length();++i)
    System.out.println(s);

    I suggest looking at the java tutorial. Your code completely misses the mark and you need to see examples.

  • How do I split a single event with many clips into multiples events, one event per date?

    I archived the video from my AVCHD camera into a Final Cut video archive. Later I imported this into iMovie. All the clips from this archive (spanning several months) are dumped into a single event. If I recall, older versions of iMovie would import video into separate events for each day. Then I would go through and give each event a meaningful name (e.g., "Mary's Birthday").
    This is what I would like. Is there a way to split this very long event into multiple events, one for each day that is present in the event?

    Not automatically but with imovie 10 you can create new events with any name you like then move clips into them from other events  (Just like FCP 10.1).   See:
    http://help.apple.com/imovie/mac/10.0/#mov1d890f00b
    You can also choose to display clips in an event grouped by date.
    Geoff

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • [JS] Basic question about event listeners and event handlers

    I am very new to the whole topic of event listeners and event handlers.  I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
    Say I have an InDesign document with a text frame that is linked to an InCopy story.  Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated?  And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
    Thanks.

    Thank you, Kasyan.
    Both of those are good solutions.
    We are currently using InDesign CS4 and InCopy CS5.  I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway.  The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
    Thanks again.  You have no idea how helpful this is.  I made some promises to my boss yesterday that I later realized were  based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going  to have to retract my promises.  But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
    Richard

  • Move multiple events into one album

    Hi,
    I am trying to tidy up our photos on iPhoto.
    Is there a fast, easy way to move multiple 'Events' into one 'Folder'
    For example:
    We have all of our photos from our honeymoon in Europe saved as seperate 'Events' According to the location. It was a 3 month trip so there are a lot of 'Events' or locations. Is there a way i can select all of them and put them into the Honeymoon 'folder' without them all merging into one big album?
    I want to keep them as separate events within the folder so we can remember where they were taken.
    I have been trying to drag the 'Event' over to the Honeymoon 'Folder' but instead of just going straight in there it creates a new unnamed folder on the left panel, and then i have to drag the event up to the honeymoon folder and delete the unnamed folder. It is proving rather time consuming and i have over 12000 photos to sort.
    Any help would be great. Simple terms please!!
    Thanks

    lf you drag an event onto a folder in the left hand pane the photos in that Event will be added to a new album in that folder with the same name as the Event. .
    OT

  • Documentation for custom event listeners

    Hi,
    I am searching in portal 8.1 documents for using custom events, coding and registering event listeners, and using them in jsp pages. So far my search has been unsuccessful.
    Can some one let me know where i find this info?
    -thanks

    Hi J, 
    Thanks for your reply.
    I didn’t find the custom work item Web Access control Official documents, but you can refer to the information in these articles(it’s same in TFS 2013):
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-development.aspx
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-deployment.aspx
    For how to debug TFS Web Access Extensions, please refer to:
    http://www.alexandervanwynsberghe.be/debugging-tfs-web-access-customizations/.
    For the custom work item Web Access control Official documents, you can
    submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is it possible to show multiple events in the Events window of IMovie ?

    we have recently made a video of a play,  where we filmed from different angles each day  over 7 nights using a selection of long and mid-shots.  So we now have multiple Events ( one from each day).  In order to now edit all the events into a single project it would be helpful if  I could display all the events underneith each other in the Events window to make shot selection and editing easier.
    Can this be done in I Movie,  Thanks

    In the View menu do you have, Group Events by Disk, Grou Events by Month and Show Separate Dates in Events all checked?
    That should allow you the broadest way to view all your Events.
    Matt

  • JSP have event listeners???

    Hi Would like to check if JSP have event listeners?? Eg.Like onblur that is used to activate javascript. Instead of calling a javascript function, can it call a JSP code or function.
    Do JSP has functions like javascript?
    Also does anyone know how if javabean is able to return a value and place it in a textfield on a JSP page??
    Please help me I am going more and more headache
    as mine deadline draws near....sign :(

    No.
    JSP can have Java code as scriptlets, but tag libraries are preferred. I don't put any scriptlet code in my JSPs.
    You can add a JavaBean to page, request, session, or application scope in a JSP page and access the properties that have getters. Then you can assign the values to a text field.
    I don't know how tight your deadline is, but the best approach in my view is to use Java Standard Tag Library (JSTL). Jakarta has a free implementation. I'd also recommend reading Shawn Bayern's "JSTL In Action" book. You'll be up to speed with JSTL very quickly. It will provide a solution to what you're asking, if your deadline will allow you time to learn it. The book is very well-written and technically excellent, IMO. - MOD

  • 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

Maybe you are looking for