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

Similar Messages

  • Removing Event Listeners - Are they needed all the time

    My goal is to increase the performance of my project so I would like to know if it is always a good idea to remove event listeners. More specifically, lets say I have a movie with severals scenes and several frames within those scenes. Each one of the frames has an event listener:
    Example:
    Scene 1
    Frame 1 (EventListener)
    Frame 2 (EventListener)
    Frame 3 (EventListener)
    Frame 4 (EventListener)
    Scene 2
    Frame 1 (EventListener)
    Frame 2 (EventListener)
    Frame 3 (EventListener)
    Frame 4 (EventListener)
    Questions:
    Does Flash continue to listen for an event in Scene 1/Frame 1 when the playhead has moved to Scene 1/ Frame 2?
    Or does Flash just listen for the events when the playhead is in a particular frame only?
    Should I remove the event listener once I leave a particular frame (should there be remove event listeners on each frame)?

    Just mentioning, the addEventListener comes with a parameter you can set to true or false called a weak reference. On desktop flash apps it can become time consuming to constantly remove listeners, especially when things drop off the display list frame to frame. You can mark them for automatic garbage collection by using the weak reference property.
    e.g.
    Credits_bnt.addEventListener(MouseEvent.CLICK, goCredits, false, 0, true); // set weak reference to true (e.g. remove when no references exist anymore automatically)
    Eventually garbage collection will remove that reference automatically when there's nothing left on the display list or in memory to use it.
    However, if this is targeted at mobile, you absolutely want to remove the reference as soon as possible when it's not needed for memory conservation. On a desktop it's not that big of a deal.

  • Loading/Unloading a .swf that adds event listeners to the Stage

    Hi all,
    Disclaimer
    Apologies if I suck so bad at using forum search that the answer to this is on page 1 somewhere; I tried...
    Question
    I am loading and unloading a .swf to which I do not have source code access. This .swf places several event listeners on the stage, as far as I can tell. When the .swf is unloaded, the event listeners placed upon the stage still seem to be in effect. Using unloadAndStop doesn't seem to do it, and I have to target Flash Player 9, anyway, so can't really use it. Is there any other way I can keep this external .swf from holding onto my main movie's stage?
    Additional info
    All eventListeners and references being set by my code are removed.
    I've managed a little contact with the author of the .swf:
    I've requested he provide a dispose() method I can call to get all the listeners removed, and send an updated .swf.
    He's suggested that I should be able to avoid the problem by loading into a unique ApplicationDomain. I'm not terribly familiar with this, but have given it a try without much success. Is this a valid solution - can I really protect my 'stage' by properly using ApplicationDomains - or do I need to persist in trying to get a public dispose() method built in?
    Thanks in advance!
    Cheers, John

    thanks for reply sir
    sir actually, i have not any problem with loading any file but i need to go back to intro.swf file when i click on clsbtn of main.swf, i want unload the main.swf file and panel.swf file
    actually i did was, i have intro.swf file and there is button by clicking load main.swf file (where is timeline controling butons) and in the main file automatically load panel.swf file ( where is all animation)
    its all play gud , no problem
    but my problem is there is a clsbtn in main.swf file and when i click on that button everything should be unload and it should return on the previous position in intro.swf
    i hope u understand what i am trying to say

  • Can't start two listeners at the same time

    Hello -
    I am running Oracle 10g R2 on Solaris 10. I am getting the following error when I try to start my second listener "TNS-01106: Listener using listener name ccn_listener has already been started". There are multiple VIPA's assigned to the server, so I am trying to start two listeners at the same time (I can start each one separately). The different IP's are referenced in the listeners (even though they use port 1521), so there should not be a conflict. I also gave the two listeners distinct non-default names. The listeners are running under two differenct Oracle homes.
    Here is the code of the listeners:
    listener 1:
    PHD_LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.49.236.119)(PORT = 1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    SID_LIST_PHD_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u02/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME=phdv410g)
    (ORACLE_HOME = /u02/app/oracle/product/10.2.0/db_1)
    (SID_NAME = phdv410g)
    listener 2:
    CCN_LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.49.236.131)(PORT = 1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    SID_LIST_CCN_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME=ccn10gt1)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (SID_NAME = ccn10gt1)
    If anyone has any ideas about why I can't start these two listeners togethers, I would really appreciate it.
    Thanks!

    Hi,
    Look at the error: "Listener already started"...
    Can you check if that is right ?
    ps -ef | egrep lsnrWaiting for feedback.
    Regards,
    Yoann.

  • Within the last hour, I noticed that my older MacBook Pro, while I was playing it in iTunes, lost contrast on the screen.  I am sorry, but I did not take exact notes on this event.  Around the same time, I did do a back up, uploaded software, etc.

    Within the last hour, I noticed that my older MacBook Pro, while I was using iTunes, lost contrast on the screen.  I am sorry, but I did not take exact notes on this event.  Around the same time, I did do a back up, uploaded Apple software, etc.
    I'm using two MacPros simultaniously, the old one for iTunes, and the new one for the other things.  My new one has no problems, so am wondering if there is an easy way to correct the older MacPro's contrast problems.  The computer is over three years old, and I'm wondering also if this failure is an aging sign.  (I also have other problems, such as a noisy DVD drive, which is part of the reason I bought a new MacBook Pro.)

    Is the older MBP a pre-Unibody model from early 2008? If so, it could be having this problem:
    http://support.apple.com/kb/ts2377
    If so, you would be entitled to a free repair.
    The lost contrast could be considered distorted video.
    Do you have an external monitor? If the external shows the same lost contrast, the graphics chip is likely the culprit. If the external is OK, then you probably have an issue with the built in display or possibly with its connections.
    You may also want to check in Universal Access to see if the contrast bar is set in its normal position (all the way to the left).
    Apple has a special test they can run to diagnose the NVIDIA issue, so if you have access to an Apple Store, make an appointment at the genius bar to have it run.
    Good luck!

  • Why does the calender do not show the right time if you want to choose 10, 11, 12 o'clock or any other time with 1x:00?

    Why does the calender do not show the right time if you want to choose 10, 11, 12 o'clock or any other time with 1x:00? It only shows 1:00 and there is no way to change the time to 1x:00.

    Ok well you need to get your facts straight. You say the reason to upgrade to OS 4 but half of these have to do with the new iPhone 4 and not the OS. Two totally different issues

  • Is this the right time ???

    actually i want to go for ipod classic 80gb....and found many bugs related to the classic....so i jus want to ask is it the right time to buy it or shuld i wait for sum time to let apple solve all issues with classic.I mean if the issues are only software related then they can be solved easily by updates but if the issues are hardware related then i think i should prefer to wait for some time..
    also one more thing is apple warranty international???..can i claim it in any country where apple has its subsidies??

    A lot of the problems seem to me like they could be fixed by firmware updates, but I guess really only apple can answer that.. Like it could be that firmware updates can squeeze more performance out of the hardware and speed up the interface, but then maybe not.. And some of the other issues are not bugs as such but just things set up differently (like the clock screensaver) I would maybe try and have a go on one if you can and see what you reckon..

  • Displaying the right time on imessage

    Why imessage, facetime and skype displays wrong time on my mac, while on my iphone and my ipad it's the right time? Can anyone help please.

    Almost certainly the Time, *Time Zone* and/or *Daylight Savings* settings +in the phone+ are incorrect for your location.
    First set the Time Zone and Daylight Savings for your location, then adjust the Time if necessary. Finally, re-sync the phone.

  • One published event doesn't show the right time

    Hi all,
    I have a published calendar. Created localy on my MacBook.
    When I go on the web page to see this calendar, very strangely one of the events shows 13:00 on the online calendar but should be at 14:00 (as created in iCal localy). All the other events are all right.
    Tried to delete the event and re-create from scratch. Tried to copy/paste another event at the same time from another day. Not solved the problem. Even after republishing and reloading the web page several times.
    It's very strange that one and only one event has this time bug...
    It's correctly synced on MobileMe. It's only the published version that has this bug.
    Any idea ?
    It's annoying because it's a calendar I published for professional purposes...
    Thanks for any suggestion.

    I've had FCP lock up on me several times.  The cause seems to always be 1.  That I've got a ton of unrendered stills in the timeline, 2. The project is rather large, with a lot of old sequences.  FCP can only access so much ram.  Stills are only virtual media clips until you render them, but FCP had to create them and hold them in a cache until you do render them.  FCP remembers, IN ACTIVE RAM, every cut, transition, every sequence whether active or not, every filter used, audio levels, all the clip info itself-- and a bunch of stuff you or I will never know.
    When you start reaching the limits of what FCP can handle, wonky stuff starts happening.

  • Ical update question show the right time in dock

    Hey I read some where that apple had an update for ical that showed the right day and month in the dock instead of the july 17 date it has always had. I ran all my osx updates and the ical date is still july 17. Is ther something I have to do in order to get it to show the right date. I know when i have it open it has the right date. But I don't want to leave it open all day. Can anybody give me any info thanks

    James,
    Unfortunately there is no such update.
    I have placed iCal in my Login Items (System Preferences...>Accounts>My Account>Login Items>Hide [✓ ]).
    iCal is always available for use and the date in the Dock is always correct. I can switch to iCal at any time and when I am done consulting iCal I use the (⌘+H) command to hide iCal without quitting. Leaving it open but hidden is the price you must pay to see the current day in the Dock.
    You can submit OS X Feedback with your personal recommendation for your desired method of implementation.
    ;~)

  • Remove method: push in the right direction

    Hello everybody. I am new to java and programming all together ( i have been programming for about 3 weeks or so). I am sorry if the question is simple. I seem to be having a problem with remove function.
    Basically I have class Task(which has an ID, brief description, dueDate etc...). I also have a task TaskList as well as a class Date . The taskList has attributes an array of type Task with a length of 10. It also has methods to add, remove tasks as well as display the arrays contents. The remove method is what is causing me problems.
    My general thinking was to find the arraycell containing the reference that points to the taskId that is to be removed. Afterwards I wanted to assign a null value to the cell containing the task to be removed. Then i would begin by swapping references until the null value is in a way where the array has no wholes in it.
    I have tried different variations of the same logic but either it does absolutely nothing, either I get a nullpointer exception. I am not looking for an explicit answer, just a nudge in the right direction. Is the general idea I proposed earlier worth anything. Can I affect a null value to an arraycell containing a reference to an object.
    Thank you in advance for any help.
    P.S: Again I apologize, for I know this must be a question that keeps coming up over and over...
    Oh, before I forget, are there any good textbooks that explain ina detailed manner class relationships, particularly dependancy, aggregation and inheritance.

    Why not use a List instead? Lists are dynamic, i.e. they can add or remove
    elements anywhere, closing the gap (i.e. there's no need to stuff nulls in there).
    Something like this:public class TaskList {
       private List l= new ArrayList();
       public void add(Task t) { l.add(t); }
       public boolean remove(Task t) { return l.remove(t); }
       // all the other functionality you want goes here ...
    }kind regards,
    Jos

  • Is it the right time for me to get SAP SD Certification?

    Greetings everyone!!!
    For the past few days, I have been thinking alot about taking my career to a new step and get SAP SD certification.
    But before venturing further into it, let me briefly explain about my Background.
    I am a marketing Post Graduate and an MBA with an Experience of 10 months in the field of Sales and Business Development, in the Wellness Industry. (I have attached my curriculum vitae for you all to study and help me in selecting the right path)
    As of now, I think of two possible ways of going about the SAP Certification. (Since I have more or less decided to do it anyway)
    1. To get more experience in the domain and then get the certification
    2. To get the certification right away
    I should also declare this before hand that i have no hands on experience with any of the ERP software in practice today. But i do know little bit about Tally. And, if I have to get that before taking us SAP Certification, then that would mean searching for a new job and working in the new job for some time to get to know the basics.
    Also, after visiting the SAP Academy in my city, they offered me two options -
    a) ILT (Instructor Led Training)
    b) E Learning
    I wanted to know if there will be a vast difference between the learning outcome from these two, and which one should i prefer joining. Its just that, If i go for the ILT, I will have to quit my job, where as on the other hand, I can pursue the course without leaving the job, but within 200 Hrs of Campus E Learning.
    Also, considering my background, is Sales and Distribution the correct module for me or should i consider doing any other course.
    Apart from all the above, is there ANYTHING ELSE i am missing?
    Kindly show me the light.
    Thanks and Regards,
    Vedansh

    Hi Vwdansh,
    generally SD modules are taken by MBA or related professionals because of having a domain knowledge in Sales and Distribution area, so your choice is good, however there are some more functional module exits in SAP which can be taken as an career option like CRM etc, for details about the major SAP functional module you can search on Google on in SCN.
    When it comes to taking a training , you can opt for weekends classes as it is a suitable option for a working proffessional, the concern is that while having a online training , you may face some problem in which online suggestion will not provide you any fruitful meanings as your learnings, so a classroom training should be prefferable.
    As you have working experiences so i will suggest you to take training from any authorised training center, ask the councellor that you wants weekends classes so that your present work will not get interrupted.
    Finally, SD module is a right choice for you but once you should search some more major module that may suits you, because in SD there are so many people already working, but its not the case with CRM.
    If you have any further query, please revert.

  • Transfer key pictures and events sorted in the right order to iPhone

    I have organized all events in iPhoto somewhat like this:
    2010-04-01 Event 1
    2010-04-03 Event 2
    etc
    The events are nicely sorted by the dates in iPhoto ..... but not in the iPhone, where some are just displayed in a different sequence.
    Also the key pictures are not transferred to the iPhone.

    actually there was, but let me try again
    on iPhoto the events are sorted nicely according to folder names, but after synchronization to the iPhone the events on the iPhone are sorted more like last added event. How to achieve on the iPhone the same sorting as in iPhoto?
    At the same time the defined key photos are not transferred to the iPhone. How to do this?

  • Why don't my photos change at the right time in my iMovie HD?

    I have searched other people's questions like this and no one has gotten a straight answer. I've imported photos to iMovie HD and set them up to run for 3 seconds each, but when I press play to preview them, they don't change at 3 seconds. Some don't change for 5 seconds, others show up for a split second and disappear into the next photo because all the photos are behind. The playhead runs over each photo, but the image displayed doesn't change when the clip does. What am I missing?
    Please help if you can! I need to finish this wedding slideshow for my wedding on Friday.
    Thanks!

    I would just like anyone else with this problem to know that I found a solution. Not sure if it's the right one, or the one you're looking for, but it at least plays your photos on time!
    Instead of setting your photos for 3 seconds (if that's roughly how long you want them to play), instead you need to set them for a longer period (say, 6-7 seconds) and then add transitions in between photos. For myself, I added Cross Dissolve at 2 seconds for each transition and, viola, I now have a 3 second clip of my photo in between the crossovers between each photo. I hope this makes sense. Apparently iMovie prefers if the photos are completely professional, not just half there with regular choppy transitions!
    Hope this actually helps someone else... It's now 3:30 am and I am definitely ready for some beauty sleep before the wedding.

  • I ran un update to iPhoto as instructed but when done I had no Event Pictures to the right of my Albums..just Palm Trees...how can I fix this?

    I updated an old IPhoto library to work with the lastest Iphoto update as instructed. I lost all my "Event Pictures" and have just Palm Tree graphics? What to do?
    How do I redo this? What went wrong..can I chnage a setting? This library is on an External drive. Here is path.. Usres/Jeff H Dubiel, desktop/iphoto Library (original)/restored Files 2 copy/Mac HD/users/Jeff H Dubiel/Pictures/IPhoto Library(original).. 71 GB 14,000 photo's,352 events..not sure how accurate that is with duplicates etc. Also all updates installed.
    Also on another Library I need updated it "hangs" if I try to update it. Can I use earlier Iphoto versions somehow on these?
    Thanks
    Jeff Dubiel
    Lion Installed 10.7.3

    Most Simple Back Up
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex:
    Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically. Examples of such apps: Chronosync or DejaVu . But are many others. Search on MacUpdate
    Note:
    hold down the command and option (or alt) keys while launching iPhoto.
    If you're getting the options you refer to you're not holding the command key as well.
    Regards
    TD

Maybe you are looking for

  • Current version of itunes will not open in windows 7 64 bit

    itunes will not open from windows 7 64 bit. It is the current version of itunes....can't sync ipad.

  • A lot of bug in ios 7 and problem with the iphone

    There is a problem with ios 7 when I delete history with my iphone 4s ...and only one month after that I've buy my iphone appared a problem with the wi-fi!!!!!!

  • Speed button iMovie 10.0.5

    The slow motion button does work in this updated version. How do I fix this?

  • Itunes 45075 error code

    After I installed itunes, I kept getting (-45075) error code and my itunes would shut itself down right after.  I tried a few times of uninstall and reinstall of itunes and kept getting the same error code.  I am hoping to get some solutions regardin

  • Urgent..Dispatcher is stopping

    Hi everyone.. In our organisation we have a test server.. I installed SAP 47 with oracle 8i on windows 2003 as OS after installation MMC started fine i was able to log into the system. after the i restarted the system..dispatcher is stopping and work