eventlistener

Actionscript 3 (Flex) - How do you clone an object including copying the event handlers/listeners?

I want to clone an object of a class (whose source code I do not have) and copy all of the associated event handlers from the original object to the new cloned object. Does anyone know how I can do that? I know how to copy the properties from the original to the new, but can I iterate over all the event handlers and add them to the new o...

AS3: Removing EventListeners without knowing amount or names

Hello! First shortly about how my site works: When a link is clicked it checks if something is already displayed in either the Left or Right side of the screen (the website looks like a book, so I have a left page I want to display information on and a right page). If there is already something showing it hides it and displays the new o...

Keeping the number of objects and event-listeners on stage as low as possible

Hello. I am creating a site with lots of big scrollable text-boxes in it. Each text-box object contained some text, and two buttons to scroll up/down with. The scroll buttons each had an event listener so the text moved when you clicked them. These text-boxes were stacked on-top of each other with all except one having an alpha of 0. I...

Add a listener inside or outside get method

I'm learning Swing and have composed an interface using a series of get methods to add components. Is it a good practise to add a Listener inside a get method as follows? I'd like to make things as decoupled as possible. private JButton getConnectButton() { if (connectButton == null) { connectButton = new JButton(); connectButt...

How to add event listeners in C#?

How to add event listeners in C#? ...

URLLoader.load() issue when using the same URLRequest

Hello, I have an issue with my eventListeners with the URLLoader, but this issue happens in IE, not in FF. public function getUploadURL():void { var request:URLRequest = new URLRequest(); request.url = getPath(); request.method = URLRequestMethod.GET; _loader = new URLLoader(); _loader.dataFormat = URLLoaderData...

Flash AS3 button eventlistener array bug

Hi there, this is my first time posting a question here. I have an array of 12 buttons on a timeline that when first visiting that part of the timeline, get a CLICK eventlistener added to them using a for loop. All of them work perfectly at that point. When you click one it plays a frame label inside the specific movieClip and reveals...

Swing: does DefaultBoundedRangeModel coalesce multiple events?

I have a JProgressBar displaying a BoundedRangeModel which is extremely fine grained and I was concerned that updating it too often would slow down my computer. So I wrote a quick test program (see below) which has a 10Hz timer but each timer tick makes 10,000 calls to microtick() which in turn increments the BoundedRangeModel. Yet it se...

Clearing eventListeners on a FileReference object

Hello all, I have a strange issue! I am trying to remove an event listener on a FileReference object by calling a function, but it seems not to be removed, and I do not understand why. Here is the code: private function clearFileUploadListeners(file:FileReference, index:String):void { var dispatchEvent:Function = function(event:Ev...

Safari Extension safari.application error

Hi, I'm making an extension for safari I created a context item with command = showNote In debugger I get the follwing error TypeError: Result of expression 'safari.application' [undefined] is not an object on line 8(the last line) are there any things you need to include or call before this works? main.js function showNote(event){...

Flash, ActionScript 3: how do you give a the EventListener a function With parameters?

I am trying to to attach a function with parameters to the timer but it says "unrelated type function" is there any way to get around this?? code example: var redoTimer:Timer = new Timer(50); redoTimer.addEventListener(TimerEvent.TIMER, saySomething("helloo")); redoTimer.start(); this wont seem to work but is there a way to pass on ...

Cannot set entity properties in NHibernate event listener.

Hi all I'm overriding NHibernate's PreInsertEventListener in order to set the entity's DateCreated property to DateTime.Now. Here is my code: public bool OnPreInsert(PreInsertEvent e) { DomainObject domainObject = (DomainObject) e.Entity; if (domainObject.CreatedById == 0) throw new Exception("The " + domainObject.GetType().Name +...

View all open events on html node - Javascript

I still consider myself a novice with javascript...so be gentle :) Is there a way to view all open events listeners on a page and perhaps to see any inifinte loops that may be running? What is happening, is a page I'm trying to debug works fine. Nodes get added to the page dynamically via a drag and drop method. All works well, but a...

Seperate event listener for every textview in android

I want to add separate event listener to dynamically created list of textview. The code so far is like this: while (cur.moveToNext()){ TextView tv = new TextView(this); temp = cur.getString(cur.getColumnIndexOrThrow("_ID")); result = "some text"; tv.setText(result); tv.setOnClickListener(new View.OnClickListener() { ...

Auditing to Ignore Certain Property Changes with NHibernate Event Listeners

Hi, i've hooked up logging in my application to automatically log changes to certain entities using event listeners. This works great but for some of the properties withing the entities i'm logging i don't wish to insert a log if only a change is made to that property. These properties are decorated with the IgnoreLoggingAttribute attr...