sorry i forgot to write the array in new CompleteEvent("newEvent")
it's ok but doesn't work!! i'try to explain well the problem... i created this class: public class CompleteEvent extends Event { private var array:ArrayCollection public function CompleteEvent(type:String, array:ArrayCollection) { super(type); this.array = array; } public override function clone():Event { return new CompleteEvent(type, array); } } the main class create the array through a socket connection within the socket listeners for Socket.DATA...the socketdata method listeners dispatch the event... [Event(name="newEvent", type="CompleteEvent")] public class MainApp{ .... socket.addEventListeners(ProgressEvent.SOCKET_DATA, socketData); ... private function socketData(event:Event):void { ...some code to create array from server data... //dispatch event var dipsatcher:EventDispatcher = new EventDispatcher(); var ev:CompleteEvent = new CompleteEvent("newEvent", array); dispatcher.dispatchEvent(ev); } } and this other class listens for the event public class BasePanel extends Panel { private function dataEventHandler():void { trace("Array retrieved"); } public function BasePanel() { super(); this.addEventListener("newEvent", dataEventHandler); } } but not working...the BasePanel class doesn't listen for the event.. thanks... Regards Lord On 15 Dic, 13:19, dolly <dolly.sa...@gmail.com> wrote: > completeevent constructor has two parameters. --> > > public function CompleteEvent(type:String, > array:ArrayCollection) > > here, array:arrayCollection should either be default initialized as > public function CompleteEvent(type:String, > array:ArrayCollection=null) > > or it should be passed while creating new CompleteEvent as > ev:CompleteEvent = new CompleteEvent("newEvent",ARRAY); > > On Dec 15, 2:37 pm, Lord <lore...@katamail.com> wrote: > > > Hi > > > i've a problem..anibody can help me? > > > i created this class: > > > public class CompleteEvent extends Event > > { > > private var array:ArrayCollection > > > public function CompleteEvent(type:String, > > array:ArrayCollection) > > { > > super(type); > > this.array = array; > > } > > > public override function clone():Event { > > return new CompleteEvent(type, array); > > } > > > } > > > the main class dispatch the event: > > > [Event(name="newEvent", type="CompleteEvent")] > > > ....some code for create an array..... > > > var ev:CompleteEvent = new CompleteEvent("newEvent"); > > > dispatchEvent(ev); > > > and this other class listens for the event > > > public class BasePanel extends Panel > > { > > > private function dataEventHandler():void { > > trace("Array retrieved"); > > } > > > public function BasePanel() > > { > > super(); > > this.addEventListener("newEvent", dataEventHandler); > > } > > > } > > > is it correct or i missed something, seems not working? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_india@googlegroups.com To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---