[flexcoders] Events and Inheritance
I am still confused about how to make an event come through to an inherited class. For example, in Container.as there is a scroll event. Canvas directly extends Container. When I add canvas inside MXML I can handle the scroll event because it comes through from Container to Canvas. However, I have an example where I have a base component that dispatches an event. When I add an inheriting component to MXML, I can't see the event being dispatched by the base component. Or at least I don't get code hints like the above scroll example. Can anyone explain this to me? Thanks! Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com http://www.cfwebtools.com 402-408-3733 x103
RE: [flexcoders] Events and Inheritance
You know what, nevermind. I started another example from scratch and it inherited fine. I'm not sure what my problem was but it's working. Thanks! Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com http://www.cfwebtools.com 402-408-3733 x103 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jake Churchill Sent: Friday, July 17, 2009 9:09 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and Inheritance I am still confused about how to make an event come through to an inherited class. For example, in Container.as there is a scroll event. Canvas directly extends Container. When I add canvas inside MXML I can handle the scroll event because it comes through from Container to Canvas. However, I have an example where I have a base component that dispatches an event. When I add an inheriting component to MXML, I can't see the event being dispatched by the base component. Or at least I don't get code hints like the above scroll example. Can anyone explain this to me? Thanks! Jake Churchill CF Webtools 11204 Davenport, Ste. 100 Omaha, NE 68154 http://www.cfwebtools.com http://www.cfwebtools.com 402-408-3733 x103 Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.18/2243 - Release Date: 07/17/09 06:08:00
[flexcoders] events
i have an array collection that populates a gallery. my arraycollection is in turn populated when i click an item in a tile list, so whenever i click on a new item in the tilelist, the data for the array collection is supposed to change but nothing seems to change. any help?
[flexcoders] Events and Child SWFs
Hi guys, I've got a parent application with a 'delete' button. When it's clicked, I want to set a flag in a child swf, which is loaded via SWF loader. So in the parent app on the button's click event I'm dispatching an event: dispatchEvent(new Event(inDeleteMode)); In the child SWF's init function I've got this: this.addEventListener(inDeleteMode, deleteModeHandler); And then the deleteModeHandler function (stubbed in for testing): private function deleteModeHandler():Boolean { Alert.show(got it!); return true; } It ain't working. Can someone see what I'm doing wrong? Thanks, David
Re: [flexcoders] Events and Child SWFs
You are assigning the listener to the wrong object. this is your child swf, but it is the parent that dispatches the event. Depending on the rest of the app this.parent might work. So: this.parent.addEventListener(inDeleteMode, deleteModeHandler); Steve On Thu, Feb 12, 2009 at 10:44 AM, stldvd stl...@yahoo.com wrote: Hi guys, I've got a parent application with a 'delete' button. When it's clicked, I want to set a flag in a child swf, which is loaded via SWF loader. So in the parent app on the button's click event I'm dispatching an event: dispatchEvent(new Event(inDeleteMode)); In the child SWF's init function I've got this: this.addEventListener(inDeleteMode, deleteModeHandler); And then the deleteModeHandler function (stubbed in for testing): private function deleteModeHandler():Boolean { Alert.show(got it!); return true; } It ain't working. Can someone see what I'm doing wrong? Thanks, David -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
RE: [flexcoders] Events and .dispatchEvent();
The key thing here seems to be that code that is expecting a (custom) fault event is getting a (custom) result event instead. You need to figure out how that can happen in your code. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dominic Pazula Sent: Wednesday, March 26, 2008 2:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and .dispatchEvent(); This is probably a real easy one. I have a manager for my RPC processes that extends EventDispatcher. I have 2 custom events (fault and result) that extend the RPC ResultEvent and FaultEvent. I have listeners in the manager that catch the rpc events, use them to create my events, stopPropagation() on the RPC event, and then use this.dispatchEvent(myevent) to send my event along. Sometimes this works. Sometimes it doesn't. I often get errors like the following: TypeError: Error #1034: Type Coercion failed: cannot convert talonlib.events::[EMAIL PROTECTED] to mx.rpc.events.MyFaultEvent. I'm sure I'm missing something somewhere? Can anyone see this off the top of their head, or know of a good resource to look into to learn more about this topic? Thanks Dominic
[flexcoders] Events and .dispatchEvent();
This is probably a real easy one. I have a manager for my RPC processes that extends EventDispatcher. I have 2 custom events (fault and result) that extend the RPC ResultEvent and FaultEvent. I have listeners in the manager that catch the rpc events, use them to create my events, stopPropagation() on the RPC event, and then use this.dispatchEvent(myevent) to send my event along. Sometimes this works. Sometimes it doesn't. I often get errors like the following: TypeError: Error #1034: Type Coercion failed: cannot convert talonlib.events::[EMAIL PROTECTED] to mx.rpc.events.MyFaultEvent. I'm sure I'm missing something somewhere? Can anyone see this off the top of their head, or know of a good resource to look into to learn more about this topic? Thanks Dominic
RE: [flexcoders] Events and .dispatchEvent();
Usually, this is an error in the metadata that describes which event class will be dispatched for a particular event, or an error in the code where the type of event in the parameter list of the listener function does not match the actual event sent. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dominic Pazula Sent: Wednesday, March 26, 2008 2:23 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and .dispatchEvent(); This is probably a real easy one. I have a manager for my RPC processes that extends EventDispatcher. I have 2 custom events (fault and result) that extend the RPC ResultEvent and FaultEvent. I have listeners in the manager that catch the rpc events, use them to create my events, stopPropagation() on the RPC event, and then use this.dispatchEvent(myevent) to send my event along. Sometimes this works. Sometimes it doesn't. I often get errors like the following: TypeError: Error #1034: Type Coercion failed: cannot convert talonlib.events::[EMAIL PROTECTED] to mx.rpc.events.MyFaultEvent. I'm sure I'm missing something somewhere? Can anyone see this off the top of their head, or know of a good resource to look into to learn more about this topic? Thanks Dominic
[flexcoders] Events while loading Flex application
2008-02-21
Thread
PradeepKumarD (#2986;#3007;#2992;#2980;#3008;#2986;#3021;#2965;#3009;#2990;#3006;#2992;#3021; #2980;)
Hi Friends, I want to discuss about that what are the default events occuring while the flex application loads. PradeepKumar, D. Software Developer - Flex/Flash
[flexcoders] Events and performance
I was wondering if I could get some input about events and performance. The exact situation I have is I'm using the HashMap class from Copyright (c) 2006 Eric J. Feminella. I've modified the class so that on put/remove/clear/reset functions it will dispatch a dataChanged event. This way I can set listeners on the class. This will obviously create many events. We use this class in several places in our app, but only a couple need to listen to changes. Will this create any type of performance issues since the bulk of the HashMap instances will be dispatching events that nothing is listening to? I'm not sure if Flex is optimized to see that an event is being dispatched that nothing is listening to so handle it efficiently. The other choice I was going to make was to modify the HashMap class and remove the final from the class. Then extend it to a ManagedHashMap class and have the HashMap not dispatch, but have the ManagedHashMap dispatch. Looking forward to hearing some other input. Thanks, Dale
RE: [flexcoders] Events and performance
The player is optimized to know if there are listeners. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dbronk Sent: Wednesday, January 30, 2008 6:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and performance I was wondering if I could get some input about events and performance. The exact situation I have is I'm using the HashMap class from Copyright (c) 2006 Eric J. Feminella. I've modified the class so that on put/remove/clear/reset functions it will dispatch a dataChanged event. This way I can set listeners on the class. This will obviously create many events. We use this class in several places in our app, but only a couple need to listen to changes. Will this create any type of performance issues since the bulk of the HashMap instances will be dispatching events that nothing is listening to? I'm not sure if Flex is optimized to see that an event is being dispatched that nothing is listening to so handle it efficiently. The other choice I was going to make was to modify the HashMap class and remove the final from the class. Then extend it to a ManagedHashMap class and have the HashMap not dispatch, but have the ManagedHashMap dispatch. Looking forward to hearing some other input. Thanks, Dale
[flexcoders] Events in AS3 gives Compile Error 1119
Hi Flexcoders, I#8217;m having trouble with some advanced features of flexthat involve events, custom datagrid components, and item renderers. Basically, I#8217;ve been following along #8220;Thanks Mister#8221; blogwhich shows how to bubble an event to a parent control. In the blog tutorial,there is a list control, and one of the columns has a button, so when a userclicks the button a menu appears, and then which ever menu item is selected bythe user triggers a new event to be dispatched and bubbled up to the parentcontrol. http://thanksmister..com/?p=68#comment-5836 In my situation#8230;. 1.) I have a custom DataGrid object, which has metadatatag: [Event(name=menuClick,type=mx.events.MenuEvent)] 2.)I have a custom datagrid ItemRenderer, thatknows how to bubble up the menu event to the parent custom datagrid control 3.) There is an event handler function inside the mxmlfile that has an instance of the datagrid object. My Problem: For some reason when I use mxml to connect the event handlerfunction with the custom datagrid control I can get that to work; however, whenI try to use AS I get a compile Error 1119: Access of possiblyundefined property MENU_CLICK through a reference with a static type Class. Here is the mxml that works: mx:Script ![CDATA[ publicfunction initApp():void {} publicfunction handleMenuEvent(event:MenuEvent):void { Alert.show(#8220;menu Event#8221;);} ]] /mx:Script local:CustomDataGrid id=#8221;mycustomdg#8221; menuClick=#8221;handleMenuEvent(event)#8221;/ Here is the AS that does *not* work, I put thisinside the initApp() function and I get a compiler error, 1119: this.mycustomdg.addEventListner(MenuEvent.MENU_CLICK,handleMenuEvent); I#8217;ve tried looking at the flex coder archives, and theonly related thread I found was here: http://www.mail-archive.com/flexcoders@yahoogroups.com/msg65790.html Thanks for all of your help! Deven Hariyani - Looking for last minute shopping deals? Find them fast with Yahoo! Search.
RE: [flexcoders] Events in AS3 gives Compile Error 1119
v\:* {behavior:url(#default#VML);}o\:* {behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}..shape {behavior:url(#default#VML);} Hi Michael, Thanks for the info, I was actually getting confused with allthe various event names. You are correct, there is no MenuEvent.MENU_CLICKevent which probably explains the compiler error. I tried to use MenuEvent.MENU_CLICK after reading the blogtutorial. I believe using #8220;menuClick#8221; in the MXML works becausethe custom datagrid obj. that was used has metadata tag at the top of the classdefinition that specifies a new event, named #8220;menuClick#8221; that isfor all MenuEvents. [Event(name=menuClick,type=mx.events.MenuEvent)] Public class CustomDataGrid extends mx.controls.DataGrid { Public function CustomDataGrid():void{ super();} } However, trying your suggestion I changed MenuEvent.MENU_CLICK to MenuEvent.ITEM_CLICKin the AS I started getting runtime errors. Saying Error 1034: Type Coercion failed: cannot convertmx.events.ListEvent to mx.events.MenuEvent I#8217;m sending this back out to the flexcoders community toget their input as well. I appreciate your assistance. --Deven From: Michael Ritchie[mailto:[EMAIL PROTECTED] Sent: Monday, December 03, 2007 12:44 PM To: Deven Hariyani Subject: Re: [flexcoders] Events in AS3 gives Compile Error 1119 There is not eventMenuEvent.MENU_CLICK for MenuEvent, there is aMenuEvent.ITEM_CLICK. this.mycustomdg.addEventListner(MenuEvent.MENU_CLICK, handleMenuEvent); On Dec 3, 2007 12:13 PM, Deven Hariyani [EMAIL PROTECTED] wrote: Hi Flexcoders, I'm having trouble with some advanced features of flex that involve events,custom datagrid components, and item renderers. Basically, I've beenfollowing along Thanks Mister blog which shows how to bubble anevent to a parent control. In the blog tutorial, there is a list control,and one of the columns has a button, so when a user clicks the button a menuappears, and then which ever menu item is selected by the user triggers a newevent to be dispatched and bubbled up to the parent control. http://thanksmister..com/?p=68#comment-5836 In my situation#8230;. 1.)I have a customDataGrid object, which has metadata tag: [Event(name=menuClick,type=mx.events.MenuEvent)] 2.) I have acustom datagrid ItemRenderer, that knows how to bubble up the menu event to theparent custom datagrid control 3.)There is an eventhandler function inside the mxml file that has an instance of the datagridobject. My Problem: For some reason when I use mxml to connect the event handler function withthe custom datagrid control I can get that to work; however, when I try to useAS I get a compile Error 1119: Access of possibly undefined propertyMENU_CLICK through a reference with a static type Class. Here is the mxml that works: mx:Script ![CDATA[ public function initApp():void {} public function handleMenuEvent(event:MenuEvent):void { Alert.show(menu Event);} ]] /mx:Script local:CustomDataGrid id=mycustomdg menuClick=handleMenuEvent(event)/ Here is the AS that does *not* work, I put this inside the initApp()function and I get a compiler error, 1119: this.mycustomdg.addEventListner(MenuEvent.MENU_CLICK, handleMenuEvent); I've tried looking at the flex coder archives, and the only related thread Ifound was here: http://www.mail-archive.com/flexcoders@yahoogroups.com/msg65790.html Thanks for all of your help! Deven Hariyani - Looking for last minute shopping deals? Find them fast with Yahoo! Search. -- Michael Ritchie - Looking for last minute shopping deals? Find them fast with Yahoo! Search.
[flexcoders] Events and Non-Display Objects
General question here... I understand Event flow with objects in the display list. They flow either up (bubbling) or down (capture) between parent and child. Maybe an oversimplification but my question really is about how to handle events with objects that are not in the display list. How do you pass events from them? Like for instance, I've got this situation here... I have an MXML that is just an mx:Object. It's MXML because I'm defining some remoteObjects in it and that's just way more fun to do in MXML than in AS. So anyway, regardless, the methods inside are static and I don't want to draw the thing. It just needs to hang out and be available so I can make these remoting calls. So there's the rub. How can this MXML talk back to where it was called from? Can I use events for this or do I need to send a callback function? Any wisdom here would be awesome... this has been befuddling me for a while. -b
RE: [flexcoders] Events and Non-Display Objects
You can try extending EventDispatcher and dispatch events From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bithroop Sent: Wednesday, November 28, 2007 10:18 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and Non-Display Objects General question here... I understand Event flow with objects in the display list. They flow either up (bubbling) or down (capture) between parent and child. Maybe an oversimplification but my question really is about how to handle events with objects that are not in the display list. How do you pass events from them? Like for instance, I've got this situation here... I have an MXML that is just an mx:Object. It's MXML because I'm defining some remoteObjects in it and that's just way more fun to do in MXML than in AS. So anyway, regardless, the methods inside are static and I don't want to draw the thing. It just needs to hang out and be available so I can make these remoting calls. So there's the rub. How can this MXML talk back to where it was called from? Can I use events for this or do I need to send a callback function? Any wisdom here would be awesome... this has been befuddling me for a while. -b
RE: [flexcoders] Events and Non-Display Objects
Or your Object subclass could create an EventDispatcher instance which can dispatch events on its behalf: var eventDispatcher:EventDispatcher = new EventDispatcher(this); eventDispatcher.dispatchEvent(event); Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, November 28, 2007 1:26 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects You can try extending EventDispatcher and dispatch events From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bithroop Sent: Wednesday, November 28, 2007 10:18 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and Non-Display Objects General question here... I understand Event flow with objects in the display list. They flow either up (bubbling) or down (capture) between parent and child. Maybe an oversimplification but my question really is about how to handle events with objects that are not in the display list. How do you pass events from them? Like for instance, I've got this situation here... I have an MXML that is just an mx:Object. It's MXML because I'm defining some remoteObjects in it and that's just way more fun to do in MXML than in AS. So anyway, regardless, the methods inside are static and I don't want to draw the thing. It just needs to hang out and be available so I can make these remoting calls. So there's the rub. How can this MXML talk back to where it was called from? Can I use events for this or do I need to send a callback function? Any wisdom here would be awesome... this has been befuddling me for a while. -b
RE: [flexcoders] Events and Non-Display Objects
You can adopt the following two options to achieve your requirements. 1. Your MXML Object should Implement the IEventDispatcher interface and internally it creates an instance of EventDispathcer class and delegates calls to that instance. 2. If you dont want to use built-in event dispatcher and you want to define your own function definition, then you can defines an interface and all the listeners should implement that interface. Moreover, you should methods in your MXML Object to register and unregister those listeners and call the specific method of that interface on some condition. Gordon, I want to ask you a few questions regarding event dispatching mechanism of default EventDispatcher. 1. Does EventDispatcher calls the listeners synchronously or asynchronously? 2. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? --- Gordon Smith [EMAIL PROTECTED] wrote: Or your Object subclass could create an EventDispatcher instance which can dispatch events on its behalf: var eventDispatcher:EventDispatcher = new EventDispatcher(this); eventDispatcher.dispatchEvent(event); Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex Harui Sent: Wednesday, November 28, 2007 1:26 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects You can try extending EventDispatcher and dispatch events From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of bithroop Sent: Wednesday, November 28, 2007 10:18 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events and Non-Display Objects General question here... I understand Event flow with objects in the display list. They flow either up (bubbling) or down (capture) between parent and child. Maybe an oversimplification but my question really is about how to handle events with objects that are not in the display list. How do you pass events from them? Like for instance, I've got this situation here... I have an MXML that is just an mx:Object. It's MXML because I'm defining some remoteObjects in it and that's just way more fun to do in MXML than in AS. So anyway, regardless, the methods inside are static and I don't want to draw the thing. It just needs to hang out and be available so I can make these remoting calls. So there's the rub. How can this MXML talk back to where it was called from? Can I use events for this or do I need to send a callback function? Any wisdom here would be awesome... this has been befuddling me for a while. -b Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs
RE: [flexcoders] Events and Non-Display Objects
Does EventDispatcher calls the listeners synchronously or asynchronously? Synchrously, in the order that they were added. To see that the handlers execute before dispatchEvent() returns, add a handler which traces out something and single-step in FlexBuilder or fdb over a dispatchEvent() call. You should see the trace output. BTW, I may be the only person in the world that distinguishes between a listener and a handler. A listener is an object that is interested in knowing about an event dispatched by another object, while a handler is a method of the listener that executes in response to the event. The name addEventListener() is somewhat confusing. You might think that you'd have to pass it both listener and a handler (to tell it which method to execute, and which object to use as the method's 'this'), but due to the magic of method closures, you only need to pass the handler and it implies the listener. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? The second listener gets the modified event instance. A copy doesn't happen in this case. However, when an event handler calls dispatchEvent() to redispatch the event in the middle of event processing, then dispatchEvent() close the event's clone() method to copy it and redispatches the copy. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jehanzeb Musani Sent: Wednesday, November 28, 2007 1:42 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects You can adopt the following two options to achieve your requirements. 1. Your MXML Object should Implement the IEventDispatcher interface and internally it creates an instance of EventDispathcer class and delegates calls to that instance. 2. If you dont want to use built-in event dispatcher and you want to define your own function definition, then you can defines an interface and all the listeners should implement that interface. Moreover, you should methods in your MXML Object to register and unregister those listeners and call the specific method of that interface on some condition. Gordon, I want to ask you a few questions regarding event dispatching mechanism of default EventDispatcher. 1. Does EventDispatcher calls the listeners synchronously or asynchronously? 2. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? --- Gordon Smith [EMAIL PROTECTED] mailto:gosmith%40adobe.com wrote: Or your Object subclass could create an EventDispatcher instance which can dispatch events on its behalf: var eventDispatcher:EventDispatcher = new EventDispatcher(this); eventDispatcher.dispatchEvent(event); Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Alex Harui Sent: Wednesday, November 28, 2007 1:26 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects You can try extending EventDispatcher and dispatch events From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of bithroop Sent: Wednesday, November 28, 2007 10:18 AM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Events and Non-Display Objects General question here... I understand Event flow with objects in the display list. They flow either up (bubbling) or down (capture) between parent and child. Maybe an oversimplification but my question really is about how to handle events with objects that are not in the display list. How do you pass events from them? Like for instance, I've got this situation here... I have an MXML that is just an mx:Object. It's MXML because I'm defining some remoteObjects in it and that's just way more fun to do in MXML than in AS. So anyway, regardless, the methods inside are static and I don't want to draw the thing. It just needs to hang out and be available so I can make these remoting calls. So there's the rub. How can this MXML talk back to where it was called from? Can I use events for this or do I need to send a callback function
RE: [flexcoders] Events and Non-Display Objects
Thanks Gordon for you prompt reply. Gordon, my experience is somewhat different that what you explained. As per my experience, I feel the handler functions of listeners are called asynchronously in the order the handlers were registered. By synchornous, I mean if the handler of the first listener calls a blocking function or perform some time consuming calculation (let say runs a for loop for 500 times) then the handler of the second listener will not be called unless the handler of the first listener returns. I have tested it by a couple of techniques. 1. Handler function of first listener displays an alert and then iterates for 500 times (performing some useless tasks like modifying the same property of the object). Handler function of second listener simply display alert. Both alert message boxes are displyed at the same time even though the first handler is still inside the for loop. 2. Here I apply the break point on the first instruction of handler functions of both listeners. The functionaly of handler functions are the same as expained in above. The debugger break on the instruction of first handler and then I press F8. The debugger then breaks on the instruction of the second handler, however, the first handler function is still inside the for loop. Can you still confirm that eventdispatcher invokes the handlers in synchronous manner? I am implementing a publisher-subscriber scenario using EventDispatcher and the desing decision will be highly affected by the behavior of deafault EventDispatcher. --- Gordon Smith [EMAIL PROTECTED] wrote: Does EventDispatcher calls the listeners synchronously or asynchronously? Synchrously, in the order that they were added. To see that the handlers execute before dispatchEvent() returns, add a handler which traces out something and single-step in FlexBuilder or fdb over a dispatchEvent() call. You should see the trace output. BTW, I may be the only person in the world that distinguishes between a listener and a handler. A listener is an object that is interested in knowing about an event dispatched by another object, while a handler is a method of the listener that executes in response to the event. The name addEventListener() is somewhat confusing. You might think that you'd have to pass it both listener and a handler (to tell it which method to execute, and which object to use as the method's 'this'), but due to the magic of method closures, you only need to pass the handler and it implies the listener. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? The second listener gets the modified event instance. A copy doesn't happen in this case. However, when an event handler calls dispatchEvent() to redispatch the event in the middle of event processing, then dispatchEvent() close the event's clone() method to copy it and redispatches the copy. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jehanzeb Musani Sent: Wednesday, November 28, 2007 1:42 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects You can adopt the following two options to achieve your requirements. 1. Your MXML Object should Implement the IEventDispatcher interface and internally it creates an instance of EventDispathcer class and delegates calls to that instance. 2. If you dont want to use built-in event dispatcher and you want to define your own function definition, then you can defines an interface and all the listeners should implement that interface. Moreover, you should methods in your MXML Object to register and unregister those listeners and call the specific method of that interface on some condition. Gordon, I want to ask you a few questions regarding event dispatching mechanism of default EventDispatcher. 1. Does EventDispatcher calls the listeners synchronously or asynchronously? 2. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? --- Gordon Smith [EMAIL PROTECTED] mailto:gosmith%40adobe.com wrote: Or your Object subclass could create an EventDispatcher instance which can dispatch events on its behalf: var eventDispatcher:EventDispatcher = new EventDispatcher(this); eventDispatcher.dispatchEvent(event); Gordon Smith Adobe Flex SDK
RE: [flexcoders] Events and Non-Display Objects
The tried the program below and the output that appears is 1a 1b 2 indicating that handler1() runs to completion before handler2() starts executing. And when I set breakpoints on the three t.text assignments in both handlers, I hit them in the expected synchronous order. Both alert message boxes are displyed at the same time even though the first handler is still inside the for loop. They're displayed at the same time because the Flash Player doesn't redraw the stage immediately when you call Alert.show(); it waits until later, by whicn time all the handlers have completed. I think you were jumping to the incorrect conclusion that since the two alerts appeared together, the first handler must have been still inside the loop. Am I right? - Gordon ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml mx:Script ![CDATA[ private function doit():void { addEventListener(doit, handler1); addEventListener(doit, handler2); dispatchEvent(new Event(doit)); } private function handler1(event:Event):void { t.text += 1a\n; for (var i:int = 0; i 10; i++) { } t.text += 1b\n; } private function handler2(event:Event):void { t.text += 2\n; } ]] /mx:Script mx:Button id=b click=doit()/ mx:Text id=t/ /mx:Application From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jehanzeb Musani Sent: Wednesday, November 28, 2007 2:16 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects Thanks Gordon for you prompt reply. Gordon, my experience is somewhat different that what you explained. As per my experience, I feel the handler functions of listeners are called asynchronously in the order the handlers were registered. By synchornous, I mean if the handler of the first listener calls a blocking function or perform some time consuming calculation (let say runs a for loop for 500 times) then the handler of the second listener will not be called unless the handler of the first listener returns. I have tested it by a couple of techniques. 1. Handler function of first listener displays an alert and then iterates for 500 times (performing some useless tasks like modifying the same property of the object). Handler function of second listener simply display alert. Both alert message boxes are displyed at the same time even though the first handler is still inside the for loop. 2. Here I apply the break point on the first instruction of handler functions of both listeners. The functionaly of handler functions are the same as expained in above. The debugger break on the instruction of first handler and then I press F8. The debugger then breaks on the instruction of the second handler, however, the first handler function is still inside the for loop. Can you still confirm that eventdispatcher invokes the handlers in synchronous manner? I am implementing a publisher-subscriber scenario using EventDispatcher and the desing decision will be highly affected by the behavior of deafault EventDispatcher. --- Gordon Smith [EMAIL PROTECTED] mailto:gosmith%40adobe.com wrote: Does EventDispatcher calls the listeners synchronously or asynchronously? Synchrously, in the order that they were added. To see that the handlers execute before dispatchEvent() returns, add a handler which traces out something and single-step in FlexBuilder or fdb over a dispatchEvent() call. You should see the trace output. BTW, I may be the only person in the world that distinguishes between a listener and a handler. A listener is an object that is interested in knowing about an event dispatched by another object, while a handler is a method of the listener that executes in response to the event. The name addEventListener() is somewhat confusing. You might think that you'd have to pass it both listener and a handler (to tell it which method to execute, and which object to use as the method's 'this'), but due to the magic of method closures, you only need to pass the handler and it implies the listener. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy of the original one? The second listener gets the modified event instance. A copy doesn't happen in this case. However, when an event handler calls dispatchEvent() to redispatch the event in the middle of event processing, then dispatchEvent() close the event's clone() method to copy it and redispatches the copy. Gordon Smith Adobe Flex SDK Team
RE: [flexcoders] Events and Non-Display Objects
Thanks Gordon for your prompt reply and sample code. I will confirm you about my findings till day end and hopefully post the example code too. --- Gordon Smith [EMAIL PROTECTED] wrote: The tried the program below and the output that appears is 1a 1b 2 indicating that handler1() runs to completion before handler2() starts executing. And when I set breakpoints on the three t.text assignments in both handlers, I hit them in the expected synchronous order. Both alert message boxes are displyed at the same time even though the first handler is still inside the for loop. They're displayed at the same time because the Flash Player doesn't redraw the stage immediately when you call Alert.show(); it waits until later, by whicn time all the handlers have completed. I think you were jumping to the incorrect conclusion that since the two alerts appeared together, the first handler must have been still inside the loop. Am I right? - Gordon ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml http://www.adobe.com/2006/mxml mx:Script ![CDATA[ private function doit():void { addEventListener(doit, handler1); addEventListener(doit, handler2); dispatchEvent(new Event(doit)); } private function handler1(event:Event):void { t.text += 1a\n; for (var i:int = 0; i 10; i++) { } t.text += 1b\n; } private function handler2(event:Event):void { t.text += 2\n; } ]] /mx:Script mx:Button id=b click=doit()/ mx:Text id=t/ /mx:Application From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jehanzeb Musani Sent: Wednesday, November 28, 2007 2:16 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events and Non-Display Objects Thanks Gordon for you prompt reply. Gordon, my experience is somewhat different that what you explained. As per my experience, I feel the handler functions of listeners are called asynchronously in the order the handlers were registered. By synchornous, I mean if the handler of the first listener calls a blocking function or perform some time consuming calculation (let say runs a for loop for 500 times) then the handler of the second listener will not be called unless the handler of the first listener returns. I have tested it by a couple of techniques. 1. Handler function of first listener displays an alert and then iterates for 500 times (performing some useless tasks like modifying the same property of the object). Handler function of second listener simply display alert. Both alert message boxes are displyed at the same time even though the first handler is still inside the for loop. 2. Here I apply the break point on the first instruction of handler functions of both listeners. The functionaly of handler functions are the same as expained in above. The debugger break on the instruction of first handler and then I press F8. The debugger then breaks on the instruction of the second handler, however, the first handler function is still inside the for loop. Can you still confirm that eventdispatcher invokes the handlers in synchronous manner? I am implementing a publisher-subscriber scenario using EventDispatcher and the desing decision will be highly affected by the behavior of deafault EventDispatcher. --- Gordon Smith [EMAIL PROTECTED] mailto:gosmith%40adobe.com wrote: Does EventDispatcher calls the listeners synchronously or asynchronously? Synchrously, in the order that they were added. To see that the handlers execute before dispatchEvent() returns, add a handler which traces out something and single-step in FlexBuilder or fdb over a dispatchEvent() call. You should see the trace output. BTW, I may be the only person in the world that distinguishes between a listener and a handler. A listener is an object that is interested in knowing about an event dispatched by another object, while a handler is a method of the listener that executes in response to the event. The name addEventListener() is somewhat confusing. You might think that you'd have to pass it both listener and a handler (to tell it which method to execute, and which object to use as the method's 'this'), but due to the magic of method closures, you only need to pass the handler and it implies the listener. Does the EventDispatcher make copies of the event object provided to EventDispatcher's dispatchEvent function when calling the listeners? Let say, I define 2 listeners for specific event type. The first listener modify some properties of the event object. Do the second listener get the modified one or the copy
[flexcoders] Events, itemRenderers, and the horizontalList control
I have been trying to figure out how to do something and have finally reached wits end today. I must be missing some fundamental understanding of something between events, itemRenderers, and the horizontalList control... I am very new to itemRenderers, so I suspect this is where my problem lies. Here's what I'm trying to do. For the sake of example, I would like to have a horizontalList control that gets dynamically populated with n-number of interactive controls (all of the same class - for simplicity's sake, I chose a list control.) So basically, click on a button (or other event) and dynamically add a new List control to the horizontalList's dataProvider. In order to do that, I have to tell the horizontalList how to display the new control, which (unless I'm mistaken) requires an itemRenderer. Once those dynamic controls are created I need to operate on them independently, so I'm trying to add an event listener to each of those controls as they are added. Seems easy enough using a call to addEventListener at the time the new dynamic List control is created, and I can even trap that event in the itemRenderer (or, so I think), by adding a generic on change event handler in the itemRenderer which, in turns, re-dispatches the original event... I think this may be where I'm going wrong, however I'm at a loss on how to achieve what I'd like to accomplish otherwise. The problem is, the event listener that I added when the dynamic component was created isn't being recognized, or I'm placing the event listener on the wrong component. The event from the itemRenderer apparently fires, however it's not heard by the main application. Any assistance you guys can provide would be hugely appreciated, I've been banging my head on the desk for longer than I care to admit on this and I'm still missing something... Thanks in advance, Brian dynamicLists.mxml ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init(); mx:Script ![CDATA[ import mx.events.ListEvent; import mx.controls.List; import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; import flash.events.Event; import flash.events.MouseEvent; [Bindable] private var _items:ArrayCollection = new ArrayCollection([Item1,Item2,Item3]); private var _listCount:int = 0; private function init():void{ } //Add a new list component to the horizontalList control private function addListItem(event:MouseEvent):void{ _listCount++; addList(); } //Create a new dynamic list control private function getNewList():List{ var newList:List = new List; newList.id = dynamicList_ + _listCount; newList.dataProvider = _items; newList.toolTip = newList.id; newList.addEventListener('change', handleListChange); return newList; } //handle an event change of the list private function handleListChange(event:ListEvent):void{ trace('... handleListChange from ' + event.currentTarget.id); } //add a list to the Horizontal List component private function addList():void{ itemListAC.addItem(getNewList()); trace('Added new List control: ' + itemListAC[itemListAC.length-1].id); if(itemListAC[itemListAC.length-1].hasEventListener('change')){ trace('onChange event listener was successfully placed on: ' + itemListAC[itemListAC.length-1].id); }else{ trace('No onChange event listener was present on: ' + itemListAC[itemListAC.length-1].id); } } ]] /mx:Script mx:VBox width=100% height=100% mx:Button click=addListItem(event) label=Click to add a new List (should be identical to the one at the bottom)/ mx:HorizontalList id=itemsHList width=100% height=100% itemRenderer=ListIR mx:dataProvider mx:ArrayCollection id=itemListAC /mx:ArrayCollection /mx:dataProvider /mx:HorizontalList mx:List id=staticList dataProvider={_items} width=100% height=100% change=handleListChange(event) toolTip=staticList /mx:List /mx:VBox /mx:Application ListIR.mxml ?xml version=1.0 encoding=utf-8? mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100 height=300 creationComplete=init() mx:Metadata [Event(name=change, type=ListEvent)] /mx:Metadata mx:Script ![CDATA[ import mx.events.ListEvent; import mx.collections.ArrayCollection; [Bindable] private var
RE: [flexcoders] Events, itemRenderers, and the horizontalList control
Renderers get recycled. Have you read my blog articles (blogs.adobe.com/aharui). Normally, you add data items to the collection and the list responds by creating renderers from the itemRenderer factory. You are adding Lists to the collection and they aren't the lists that you see in the UI which is why they don't send events. Normally the renderer dispatches an event off the .owner property so you can listen to it from the List. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of burttram Sent: Tuesday, November 27, 2007 3:21 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events, itemRenderers, and the horizontalList control I have been trying to figure out how to do something and have finally reached wits end today. I must be missing some fundamental understanding of something between events, itemRenderers, and the horizontalList control... I am very new to itemRenderers, so I suspect this is where my problem lies. Here's what I'm trying to do. For the sake of example, I would like to have a horizontalList control that gets dynamically populated with n-number of interactive controls (all of the same class - for simplicity's sake, I chose a list control.) So basically, click on a button (or other event) and dynamically add a new List control to the horizontalList's dataProvider. In order to do that, I have to tell the horizontalList how to display the new control, which (unless I'm mistaken) requires an itemRenderer. Once those dynamic controls are created I need to operate on them independently, so I'm trying to add an event listen! er to each of those controls as they are added. Seems easy enough using a call to addEventListener at the time the new dynamic List control is created, and I can even trap that event in the itemRenderer (or, so I think), by adding a generic on change event handler in the itemRenderer which, in turns, re-dispatches the original event... I think this may be where I'm going wrong, however I'm at a loss on how to achieve what I'd like to accomplish otherwise. The problem is, the event listener that I added when the dynamic component was created isn't being recognized, or I'm placing the event listener on the wrong component. The event from the itemRenderer apparently fires, however it's not heard by the main application. Any assistance you guys can provide would be hugely appreciated, I've been banging my head on the desk for longer than I care to admit on this and I'm still missing something... Thanks in advance, Brian dynamicLists.mxml ?xml version=1! .0 enco ding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute creationComplete=init(); mx:Script ![CDATA[ import mx.events.ListEvent; import mx.controls.List; import mx.rpc.events.ResultEvent; import mx.collections.ArrayCollection; import flash.events.Event; import flash.events.MouseEvent; [Bindable] private var _items:ArrayCollect! ion = new ArrayCollection([Item1,Item2,Item3]); private var _listCount:int = 0; private function init():void{ } //Add a new list component to the horizontalList control private function addListItem(event:MouseEvent):void{ _listCount++; addList(); n! bsp; } n! bsp;nbs p; //Create a new dynamic list control private function getNewList():List{ var newList:List = new List; newList.id = dynamicList_ + _listCount; newList.dataProvider = _items; newList.toolTip = newList.id; newList.addEventListener('change', handleListChange); return newList; nbs! p; } //handle an event change of the list private function handleListChange(event:ListEvent):void{ trace('... handleListChange from ' + event.currentTarget.id); } //add a list to the Horizontal List component private function addList():void{ itemListAC.addItem(getNewList()); nbs! p; trace('Added new List control: ' + itemL! istAC[it emListAC.length-1].id); if(itemListAC[itemListAC.length-1].hasEventListener('change')){ trace('onChange event listener was successfully placed on: ' + itemListAC[itemListAC.length-1].id); }else{ trace('No onChange event listener was present on: ' + itemListAC[itemListAC.length-1].id); } } ]] /mx:Script n! bsp; mx:VBox width=100% height=100% mx:Button click=addListItem(event) label=Click to add a new List (should be identical to the one at the bottom
[flexcoders] Events in AS3 Classes
I know that I can write my own custom event class, but I was wondering about something that seems to be undocumented and that seems to initially be promising: When adding a meta tag to an AS class such as: [Event(name=myEvent,type=flash.events.Event)] the event shows up when using the class by creating an event listener. The interesting thing is that code assist picks it up, but it shows up with an altered signature: myClass.addEventListener(Event.MY_EVENT,myEventHandler); I wasn't able to find any documentation on it. So I am wondering if this would actually work. At the moment I'm not able to fully test it, as the compiler throws an error with my static class (defined as a singleton) stating: Error 1119: Access of possibly undefined property MY_EVENT through a reference with static type Class. If this is legal code, then the question would be how to 'define the property' so that the compiler is satisfied. Does anyone have more information on this? Thanks, Jurgen
[flexcoders] Events not firing from swf imported with SwfLoader
Hi, I'm not a flash expert so you'll have to bear with me on this. I'm not creating the swf's myself. I've recieved animations in swf's before and used them in image controls and they work fine. (movie clips generated in Flash MX 2004) If however the swf has a button on it (just an animation which plays on the rollover and snaps back to first frame on rollout) no events get fired from it when it's embeded into my image control. I'm assuming that the button in the swf is catching all mouse events and not passing them on. Does anybody know if this is the expected behaviour or if there's an easy way around it? As it stands I guess I'll need to handle switching to an animation on the rollover event within Flex2. Thanks in advance Bill P.S. I saw this, but it seems like overkill for what I want. http://www.jessewarden.com/archives/2006/08/flash_9_button.html
RE: [flexcoders] Events not firing from swf imported with SwfLoader
Flex strips off all actionscript unless it is generated by Flash 9 ! So therez no way u can monitor the events from flex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of beecee1977 Sent: Friday, May 18, 2007 4:07 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Events not firing from swf imported with SwfLoader Hi, I'm not a flash expert so you'll have to bear with me on this. I'm not creating the swf's myself. I've recieved animations in swf's before and used them in image controls and they work fine. (movie clips generated in Flash MX 2004) If however the swf has a button on it (just an animation which plays on the rollover and snaps back to first frame on rollout) no events get fired from it when it's embeded into my image control. I'm assuming that the button in the swf is catching all mouse events and not passing them on. Does anybody know if this is the expected behaviour or if there's an easy way around it? As it stands I guess I'll need to handle switching to an animation on the rollover event within Flex2. Thanks in advance Bill P.S. I saw this, but it seems like overkill for what I want. http://www.jessewarden.com/archives/2006/08/flash_9_button.html http://www.jessewarden.com/archives/2006/08/flash_9_button.html
[flexcoders] events not being called: HTTPService
I'm trying to retrieve a static XML doc for processing. I can step thru all the way to trace(xmlRequest.send); but after that it won't go into either listener method: onResultReturn() onResultFault() and after xmlRequest.send(), the app returns back to the calling code then an error is thrown on the first use of the XML (null reference- it's missing). what I'm trying to do is so simple, I think I'm suffering code blindness can anyone spot where I'm going wrong? thanx b [Bindable] public var questionaire:XML; [Bindable] public var xmlRequest:HTTPService = new HTTPService(); public var xmlLocation:String = ./questionaire.xml; public function getQuestions(xmlLocation:String):void { trace(getQuestions called); xmlRequest.url = xmlLocation; trace(xmlLocation: + xmlLocation); xmlRequest.method = GET; xmlRequest.contentType = Application/xml; xmlRequest.resultFormat = e4x; xmlRequest.addEventListener(ResultEvent.RESULT,onResultReturn); xmlRequest.addEventListener(FaultEvent.FAULT, onResultFault); trace(xmlRequest.send); xmlRequest.send(); } public function onResultReturn(event:ResultEvent):void { trace(onResultReturn called); questionaire = new XML(event.result); trace(questionaire.toXMLString()); } public function onResultFault(event:FaultEvent):void { trace(onResultFault called: + event.toString()) }
RE: [flexcoders] events not being called: HTTPService
Why are you setting: xmlRequest.contentType = Application/xml; I have seen this cause people problems. Leave the default and see if that helps. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of barry.beattie Sent: Monday, May 14, 2007 12:20 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] events not being called: HTTPService I'm trying to retrieve a static XML doc for processing. I can step thru all the way to trace(xmlRequest.send); but after that it won't go into either listener method: onResultReturn() onResultFault() and after xmlRequest.send(), the app returns back to the calling code then an error is thrown on the first use of the XML (null reference- it's missing). what I'm trying to do is so simple, I think I'm suffering code blindness can anyone spot where I'm going wrong? thanx b [Bindable] public var questionaire:XML; [Bindable] public var xmlRequest:HTTPService = new HTTPService(); public var xmlLocation:String = ./questionaire.xml; public function getQuestions(xmlLocation:String):void { trace(getQuestions called); xmlRequest.url = xmlLocation; trace(xmlLocation: + xmlLocation); xmlRequest.method = GET; xmlRequest.contentType = Application/xml; xmlRequest.resultFormat = e4x; xmlRequest.addEventListener(ResultEvent.RESULT,onResultReturn); xmlRequest.addEventListener(FaultEvent.FAULT, onResultFault); trace(xmlRequest.send); xmlRequest.send(); } public function onResultReturn(event:ResultEvent):void { trace(onResultReturn called); questionaire = new XML(event.result); trace(questionaire.toXMLString()); } public function onResultFault(event:FaultEvent):void { trace(onResultFault called: + event.toString()) }
Re: [flexcoders] events? Should I use mx.events or flash.events?
Depends on what are you going to apply it. mx.events it's used to Flex Events and elements packages. flash.events it's used to the new DOM of elements that could used to extend or new components that are coming throw it, wich also supports EventDispatcher base class for it Regards. On 11/17/06, dj [EMAIL PROTECTED] wrote: What's the difference between the two? Thanks, Patrick -- Igor Costa www.igorcosta.com
[flexcoders] events? Should I use mx.events or flash.events?
What's the difference between the two? Thanks, Patrick
[flexcoders] events
Where can I find a suitable list of events for ActionScript 2.0? I know the obvious ones such as click, enter, change, but where can I find a complete list that I can reference? Thanks! -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] events
On Mon, May 15, 2006 at 4:19 PM, in message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I know the obvious ones such as click, enter, change, but where can I find a complete list that I can reference? It's listed per tag in the documentation, see 'events' of http://livedocs.macromedia.com/labs/1/flex20beta3/langref/mx/controls/ComboBox.html for instance. Tom Chiverton This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the Year at the 2005 Growth Company Awards -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] events
What about keyListeners? How can I implement a KeyListener, because when I run the following code, it errors trying to access the Key variable. Lines 3 6. This statement is not permitted in a class definition. var keyListener = new Object(); keyListener. { x = Key.getAscii(); trace(You hit: + x); }; Key.addListener(keyListener); Thanks again! - Doug On 5/15/06, Tom Chiverton [EMAIL PROTECTED] wrote: On Mon, May 15, 2006 at 4:19 PM, in message[EMAIL PROTECTED] , [EMAIL PROTECTED] wrote: I know the obvious ones such as click, enter, change, but where can I find a complete list that I can reference? It's listed per tag in the documentation, see 'events' of http://livedocs.macromedia.com/labs/1/flex20beta3/langref/mx/controls/ComboBox.htmlfor instance.Tom ChivertonThis email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITYThis email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com.We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the Year at the 2005 Growth Company Awards --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com YAHOO! GROUPS LINKS Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Events again...
Sidenote: instead of subclassing EventDispatcher directly you can also use the IEventDispatcher interface. This way you don't need to derive from EventDispatcher: // pseudo code class Foo implements IEventDispatcher { public function Foo() { dispatcher:EventDispatcher = new EventDispatcher(this); } // later public function dispatchEvent(event:Event):Booleen { return dispatcher.dispatchEvent(event); } } Dirk. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ralf Rottmann Sent: Saturday, December 03, 2005 12:34 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Events again... Just wanted to let you know: Solved the issue. Deriving my AS3 class from EventDispatcher did the trick. However I wonder why Flex Builder does not offer EventDispatcher as tooltip help when you type import flash.events. it offers everything else but not EventDispatcher. Alpha bug? Regards Ralf Rottmann From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ralf Rottmann Sent: Freitag, 2. Dezember 2005 20:57 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Events again... Thanks. I'll give it a try. How about my second question: how can I propagate the event up to ClassA (fired in ClassB)? Regards RR -- mobile: +49-(0)170-914-5495 email: [EMAIL PROTECTED] -Original Message- From: flexcoders@yahoogroups.com flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Fri Dec 02 20:32:19 2005 Subject: Re: [flexcoders] Events again... Ralf - dispatchEvent and addEventListener are methods of the EventDispatcher class. EventDispatcher is the superclass to most (all?) built in flex components, but is not inherently available to all AS3 classes. If you modify ClassB to instead be public ClassB extends flash.events.EventDispatcher, it should run as expected. At 01:42 PM 12/2/2005, you wrote: Again an Event question with desperate need for help: Talking about Flex 2.0 Alpha. Two custom classes: ClassA and ClassB. Both .as files, so no MXML, no Component, not derived from any other built-in class. In ClassA you find something like that: public ClassA { private helper:ClassB; public function ClassA() { helper = new ClassB(); helper.addEventListener(fire, onCustomEvent); } private function onCustomEvent(_e:Event);Void { trace (Event received.); } } ClassB looks like this [Event(fire)] public ClassB { // constructor and other stuff private function aFunction():Void { ... ... var e:Event = new Event(fire); dispatchEvent(e); ... ... } } Problem: ClassB never receives the event. I am sure the dispatchEvent(e) gets called because if I add a listener and a handler in ClassB itself and add var e:Event = new Event(fire); this.addEventListener(fire, onDummyHandler); dispatchEvent(e); the onDummyHandler in ClassB gets called as expected. Your help is more than appreciated - as always. Best regards Ralf Note: These are not excerpts from my real classes but much more simplified versions to illustrate the problem. Regards Ralf -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
[flexcoders] Events again...
Again an Event question with desperate need for help: Talking about Flex 2.0 Alpha. Two custom classes: ClassA and ClassB. Both .as files, so no MXML, no Component, not derived from any other built-in class. In ClassA you find something like that: public ClassA { private helper:ClassB; public function ClassA() { helper = new ClassB(); helper.addEventListener(fire, onCustomEvent); } private function onCustomEvent(_e:Event);Void { trace (Event received.); } } ClassB looks like this [Event(fire)] public ClassB { // constructor and other stuff private function aFunction():Void { var e:Event = new Event(fire); dispatchEvent(e); } } Problem: ClassB never receives the event. I am sure the dispatchEvent(e) gets called because if I add a listener and a handler in ClassB itself and add var e:Event = new Event(fire); this.addEventListener(fire, onDummyHandler); dispatchEvent(e); the onDummyHandler in ClassB gets called as expected. Your help is more than appreciated as always. Best regards Ralf Note: These are not excerpts from my real classes but much more simplified versions to illustrate the problem. Regards Ralf -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] Events again...
Ralf - dispatchEvent and addEventListener are methods of the EventDispatcher class. EventDispatcher is the superclass to most (all?) built in flex components, but is not inherently available to all AS3 classes. If you modify ClassB to instead be public ClassB extends flash.events.EventDispatcher, it should run as expected. At 01:42 PM 12/2/2005, you wrote: Again an Event question with desperate need for help: Talking about Flex 2.0 Alpha. Two custom classes: ClassA and ClassB. Both .as files, so no MXML, no Component, not derived from any other built-in class. In ClassA you find something like that: public ClassA { private helper:ClassB; public function ClassA() { helper = new ClassB(); helper.addEventListener(fire, onCustomEvent); } private function onCustomEvent(_e:Event);Void { trace (Event received.); } } ClassB looks like this [Event(fire)] public ClassB { // constructor and other stuff private function aFunction():Void { var e:Event = new Event(fire); dispatchEvent(e); } } Problem: ClassB never receives the event. I am sure the dispatchEvent(e) gets called because if I add a listener and a handler in ClassB itself and add var e:Event = new Event(fire); this.addEventListener(fire, onDummyHandler); dispatchEvent(e); the onDummyHandler in ClassB gets called as expected. Your help is more than appreciated as always. Best regards Ralf Note: These are not excerpts from my real classes but much more simplified versions to illustrate the problem. Regards Ralf -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ~-- AIDS in India: A lurking bomb. Click and help stop AIDS now. http://us.click.yahoo.com/VpTY2A/lzNLAA/yQLSAA/nhFolB/TM ~- -- 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/
Re: [flexcoders] Events again...
Title: Re: [flexcoders] Events again... Thanks. I'll give it a try. How about my second question: how can I propagate the event up to ClassA (fired in ClassB)? Regards RR -- mobile: +49-(0)170-914-5495 email: [EMAIL PROTECTED] -Original Message- From: flexcoders@yahoogroups.com flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Fri Dec 02 20:32:19 2005 Subject: Re: [flexcoders] Events again... Ralf - dispatchEvent and addEventListener are methods of the EventDispatcher class. EventDispatcher is the superclass to most (all?) built in flex components, but is not inherently available to all AS3 classes. If you modify ClassB to instead be public ClassB extends flash.events.EventDispatcher, it should run as expected. At 01:42 PM 12/2/2005, you wrote: Again an Event question with desperate need for help: Talking about Flex 2.0 Alpha. Two custom classes: ClassA and ClassB. Both .as files, so no MXML, no Component, not derived from any other built-in class. In ClassA you find something like that: public ClassA { private helper:ClassB; public function ClassA() { helper = new ClassB(); helper.addEventListener(fire, onCustomEvent); } private function onCustomEvent(_e:Event);Void { trace (Event received.); } } ClassB looks like this [Event(fire)] public ClassB { // constructor and other stuff private function aFunction():Void { var e:Event = new Event(fire); dispatchEvent(e); } } Problem: ClassB never receives the event. I am sure the dispatchEvent(e) gets called because if I add a listener and a handler in ClassB itself and add var e:Event = new Event(fire); this.addEventListener(fire, onDummyHandler); dispatchEvent(e); the onDummyHandler in ClassB gets called as expected. Your help is more than appreciated as always. Best regards Ralf Note: These are not excerpts from my real classes but much more simplified versions to illustrate the problem. Regards Ralf -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ~-- AIDS in India: A lurking bomb. Click and help stop AIDS now. http://us.click.yahoo.com/VpTY2A/lzNLAA/yQLSAA/nhFolB/TM ~- -- 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/ -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] Events again...
Title: Re: [flexcoders] Events again... Just wanted to let you know: Solved the issue. Deriving my AS3 class from EventDispatcher did the trick. However I wonder why Flex Builder does not offer EventDispatcher as tooltip help when you type import flash.events. it offers everything else but not EventDispatcher. Alpha bug? Regards Ralf Rottmann From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ralf Rottmann Sent: Freitag, 2. Dezember 2005 20:57 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Events again... Thanks. I'll give it a try. How about my second question: how can I propagate the event up to ClassA (fired in ClassB)? Regards RR -- mobile: +49-(0)170-914-5495 email: [EMAIL PROTECTED] -Original Message- From: flexcoders@yahoogroups.com flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Sent: Fri Dec 02 20:32:19 2005 Subject: Re: [flexcoders] Events again... Ralf - dispatchEvent and addEventListener are methods of the EventDispatcher class. EventDispatcher is the superclass to most (all?) built in flex components, but is not inherently available to all AS3 classes. If you modify ClassB to instead be public ClassB extends flash.events.EventDispatcher, it should run as expected. At 01:42 PM 12/2/2005, you wrote: Again an Event question with desperate need for help: Talking about Flex 2.0 Alpha. Two custom classes: ClassA and ClassB. Both .as files, so no MXML, no Component, not derived from any other built-in class. In ClassA you find something like that: public ClassA { private helper:ClassB; public function ClassA() { helper = new ClassB(); helper.addEventListener(fire, onCustomEvent); } private function onCustomEvent(_e:Event);Void { trace (Event received.); } } ClassB looks like this [Event(fire)] public ClassB { // constructor and other stuff private function aFunction():Void { var e:Event = new Event(fire); dispatchEvent(e); } } Problem: ClassB never receives the event. I am sure the dispatchEvent(e) gets called because if I add a listener and a handler in ClassB itself and add var e:Event = new Event(fire); this.addEventListener(fire, onDummyHandler); dispatchEvent(e); the onDummyHandler in ClassB gets called as expected. Your help is more than appreciated as always. Best regards Ralf Note: These are not excerpts from my real classes but much more simplified versions to illustrate the problem. Regards Ralf -- 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 Visit your group flexcoders on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Sponsor ~-- AIDS in India: A lurking bomb. Click and help stop AIDS now. http://us.click.yahoo.com/VpTY2A/lzNLAA/yQLSAA/nhFolB/TM ~- -- 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/ -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] events issue
Hi Thanks for reply. I just found out that I had created controller object in more than one place. This was the cause. It is now sorted. Thanks again HusainAbdul Qabiz [EMAIL PROTECTED] wrote: Hi, Can you post the sample-but-complete code, so that we can see what is going wrong? -abdul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Husain KitabiSent: Saturday, October 01, 2005 8:48 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] events issue Hi I am having a problem with button click event. When I click a button, it makes a call and talks to the remoteObject. But it does that 5times! If I click login button, it logs me into the application but shows 5 alert windows saying I have logged in - it has to show just one.Onthe server console(of jboss) i see println 5 times. Same is the problem everywhere a button is clicked. Any ideas? Regards Husainhussain Yahoo! for GoodClick here to donate to the Hurricane Katrina relief effort. hussain Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] events issue
Hi, Can you post the sample-but-complete code, so that we can see what is going wrong? -abdul From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Husain KitabiSent: Saturday, October 01, 2005 8:48 PMTo: flexcoders@yahoogroups.comSubject: [flexcoders] events issue Hi I am having a problem with button click event. When I click a button, it makes a call and talks to the remoteObject. But it does that 5times! If I click login button, it logs me into the application but shows 5 alert windows saying I have logged in - it has to show just one.Onthe server console(of jboss) i see println 5 times. Same is the problem everywhere a button is clicked. Any ideas? Regards Husainhussain Yahoo! for GoodClick here to donate to the Hurricane Katrina relief effort. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] events issue
Hi I am having a problem with button click event. When I click a button, it makes a call and talks to the remoteObject. But it does that 5times! If I click login button, it logs me into the application but shows 5 alert windows saying I have logged in - it has to show just one.Onthe server console(of jboss) i see println 5 times. Same is the problem everywhere a button is clicked. Any ideas? Regards Husainhussain Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[flexcoders] events between siblings
Hi, Can anyone tell me if I can send an event from onr sibling to another i.e., I have an application, it has two custom components lets say both are canvas and contain elements in them (Sib1 and sib2) How do I let sib2 know that something has changed in sib1. For addeventlistener I beleive you need a handle of the object since sib2 does not have the handle for sib1, I will not be able to dispatch and receive the event. Or even how to send an event from the application to sib2 would be great. Can anyone shed some light on this. Regards Rajesh J Yahoo! Groups Sponsor ~-- Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM ~- -- 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/
Re: [flexcoders] Events and Components
You can bind to the result from the GetResults function directly, flex takes care of generating the binding code for you. (no need to dispatch events) E.g., mx:ComboBox dataProvider={this.parent.Webservice1.GetResults.result}/ Or, if you need to invoke a method with the results mx:ComboBox dataProvider={myFunction(this.parent.Webservice1.GetResults.result)}/ define your operation like: mx:operation name=GetResults/ -ashley gevgelija50 wrote: I have a component that contains a combobox. The component is called by the parent application. I want to populate the component's combobox with the result received from the webservice in my parent application. How can I listen to the result event of the main webservice? Currently I have the following setup in my main webservice: mx:operation name=GetResults result={dispatchEvent ('GetResults');} / In my component, I am trying to add a listener as follows: this.parent.Webservice1.GetResults.addEventListener(GetResults, doSomething) This DOES NOT work! Please help. Thanks, Alex *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] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/. 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/
RE: [flexcoders] Events and Components
In 1.5 the web service doesnt cleanly support adding event listeners at runtime, youd need to do it at compile-time through the tag (this is changing in the next version). But you could delegate this work if you wanted by using something like a Responder as mentioned in the Cairngorm framework and the iteration::two book. Matt From: Manish Jethani [mailto:[EMAIL PROTECTED] Sent: Monday, April 04, 2005 12:56 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Events and Components On Apr 4, 2005 11:40 PM, gevgelija50 [EMAIL PROTECTED] wrote: mx:operation name=GetResults result={dispatchEvent ('GetResults');} / In my component, I am trying to add a listener as follows: this.parent.Webservice1.GetResults.addEventListener(GetResults, doSomething) I'm not sure if this'll work, but try passing the result object as a part of the GetResuts event. So in your doSomething() you get the event object which contains the result object. Manish 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 the Yahoo! Terms of Service.
RE: [flexcoders] Events being captured by hidden components
Im not sure why its happening, but you could just put another vbox behind the overlay and disable that one. Matt From: Paul Frantz [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:22 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Eventsbeing captured by hidden components Hi, I'm sure I'm missing something really obvious but... If I have a canvas with one component that overlays another what can I do to ensure events do not filter through to the component below? An earlier post by Matt suggests disabling the overlaying component. This works but doesn't do much for me if I need children of the overlaying component to be active. Any ideas? Thanks, Paul. ?xml version=1.0? mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml backgroundColor=#FF mx:Canvas mx:ComboBox id=SoftwareSelection mx:dataProvider mx:Array mx:StringMacromedia Flex/mx:String mx:StringMacromedia Dreamweaver/mx:String mx:StringMacromedia ColdFusion/mx:String mx:StringMacromedia Flash/mx:String /mx:Array /mx:dataProvider /mx:ComboBox mx:VBox x=30 backgroundColor=0xFF mx:Label text=I'm an overlaying VBox / mx:Label text=why is the combobox underneath me/ mx:Label text=clickable?/ /mx:VBox /mx:Canvas /mx:Application ~~--- This e-mail may contain confidential information. If you are not the intended recipient, please notify the sender immediately and delete this e-mail from your system. You must not disclose this e-mail to anyone without express permission from the sender. The contents of all e-mails sent to and received from Optus may be scanned, stored, or disclosed to others at Optus discretion. Optus has exercised care to avoid errors in the information contained in this e-mail but does not warrant that the information is error or omission free. The information (including any pricing information) contained in this e-mail is subject to change. This e-mail is not a quotation or proposal and no contractual obligations arise until you and Optus sign a formal written contract or formal variation to your existing contract. Any pricing contained in this e-mail is exclusive of GST unless otherwise stated.