To dispatch events, your ViewHelper class has to extend flash.events.EventDispatcher. Another way would be to let your view dispatch the event for you, i.e. inside your ViewHelper something like
view.dispatchEvent(theEvent); Dirk. > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Alberto > Albericio Salvador > Sent: Tuesday, February 14, 2006 1:46 PM > To: [email protected] > Subject: Re: [flexcoders] Dispatching events from cairngorm viewhelper > > Hi Joao, > > Im working with Flex2b1 and I dont import anything, neither > in the main view nor in my custom viewhelper. > > Anyway, importing that continues throwing the error: > > Call to a possibly undefined method 'dispatchEvent' > > Alberto Albericio Salvador > Aura S.A. Seguros > Departamento Informática > > > > João Fernandes escribió: > > Alberto, > > > > Did you import mx.events.EventDispatcher? > > > > João Fernandes > > Sistemas de Informação > > Programador Informático > > Cofina media > > > > Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL > Tel (+351) > > 213 185 200 . Fax (+351) 213 540 370 [EMAIL PROTECTED] > > > > -----Original Message----- > > From: [email protected] > [mailto:[EMAIL PROTECTED] > > On Behalf Of Alberto Albericio Salvador > > Sent: terça-feira, 14 de Fevereiro de 2006 12:19 > > To: [email protected] > > Subject: [flexcoders] Dispatching events from cairngorm viewhelper > > > > Hi all, > > > > When trying to dispatch an event from a custom class that extends > > cairngorm ViewHelper, I get this error: > > > > >> Call to a possibly undefined method 'dispatchEvent' > > > > Firing the event from a function of the main view, same > code, it works fine. > > > > My function is something like, same in the view and in my > custom viewhelper. > > > > public function getPoblaciones(cp:String):void { > > var event : LocalidadesEvent = new > LocalidadesEvent(cp); > > dispatchEvent(event); > > } > > > > Has anybody run into this issue? > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links > > > > > > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

