You have to initialize the object before you can add listeners;

var listener:Object = new Object();

listener.click = function ( evt:Object)
{
            trace("it worked!");
};

var obj:Object = new Object();

mx.events.EventDispatcher.initialize ( obj );

obj.addEventListener( "click", listener );

obj.dispatchEvent ( {type:'click', target:obj } );


_____________________________

Jesse Graupmann
www.jessegraupmann.com 
www.justgooddesign.com/blog/ 
_____________________________



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cristo @
cryzto.ch
Sent: Tuesday, June 12, 2007 12:45 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] AS2: Multilanguage-Listener

Hi everybody

 

I'm working on a multilanguage configurator and want to update every
textareas, labels etc. by clicking on one of the available lang-buttons
(english, german, spanish ect.).

 

My configurator consists of different movieclips/layers of course. Now I've
tried to reach this by creating an evenlistener on those buttons, but
without success.

 

Code (layer: _level0):

 

var langListener:Object = new Object();

langListener.click = function (EvtObj:Object){

            trace("it worked!");

};

// ie: english-button

_level0.langP_mc.en_btn.addEventListener("click", langListener);

 

 

Can anyone help?

 

Cryzto


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.472 / Virus Database: 269.8.14/845 - Release Date: 12.06.2007
06:39
 
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to