This content has been marked as final. Show 6 replies
I think you will need to clarify where you are seeing the problem.
I got the problem in productCatalogueEvent.In their is function called "dispatchEvent";I doubtfull here.
If this function is caled here where does it affect?
I can't get wat will do wen this function called?
I dont have your sample but Events are integral to Flex and it is something that is a bit different to most programming. Basically dispatching an event is sending information out to anything that is LISTENING to say that something has occurred. So, to receive the information you/they define an eventListener which listens for that event being dispatched. When the event is dispatched, the listener picks it up and then continues with the processing of the program.
There are lots of sample material for events in the Adobe reference material so I suggest going through a few examples of what events are, and what they do.
I would examine the FB3 help on events. Bascially, your UI just sits there "waiting" for events to be dispatched by other components in response to user interaction with the UI, or else dispatched by data availability, for example in an HTTPService or WebService.
I haven't looked at the code, so I don't know how productCatalogueEvent is being used in the area of code you are examining, but evidently an event was fired probably because of user activity that accesses the product catalog, perhaps by filtering what will be displayed.
Spend a couple of hours in the FB3 help system reading up on events and you will be much clearer on what is going on.
A handy way as well to approach the documentation is to look at the events associated with the particular component in question e.g. button.
Do a search in help docs FB3 for 'button'. You want to find out what events are associated with button, click 'Events' in the menu section associated with your find results for 'button', Scroll down until you see a section called 'Method Detail', this is a list of all the methods associated with button events, e.g 'clickHandler() method
See this kind of info:
protected function clickHandler(event:MouseEvent):void
Default handler for the MouseEvent.CLICK event
Other info here gives other methods e.g mouseDownHandler() method.
so now you have enough info to use in your code eg
private function clickHandler(event:MouseEvent):void
myMessage.text='You clicked it';
<mx:Button label="Hi There" click="clickHandler()"/>
<mx:Label text="Label" id="myMessage"">
Of note is the fact that you get the info clickHandler(event:MouseEvent)
from searching 'button' in the help docs. Hope this helps get you started.
Should have said also, for a look at more complex event handlers and event management in Flex Applications, you won't miss out by having a look on lynda.com at David Gassner's series of video tutorials on 'Flex 3 Essential Training' - also Beyond the Basics