This content has been marked as final. Show 5 replies
Which version of flex are you on?
I'm not sure about version 2 but in Flex 3 fault event does have currentTarget property. What do you get in the trace if you just say event.currentTarget?
from the docs:
The FAULT event type.
The properties of the event object have the following values:
cancelable true, calling preventDefault() from the associated token's responder.fault method will prevent the service or operation from dispatching this event
currentTarget The Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
fault The Fault object that contains the details of what caused this event.
message The Message associated with this event.
target The Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
token The token that represents the call to the method. Used in the asynchronous completion token pattern.
As the matter of fact, i am also using Flex 3 but i obviously overlooked something in docs or maybe looked at Flex 2 docs. However, if i use HTTPService like i posted in first post and trace("evt.currentTarget:"+evt.currentTarget) in 'httpServiceError' which handles error then i get the following:
So i thought that's fine, trace(evt.currentTarget.id) should trace "test" in my example but instead i get the following error:
Main Thread (Suspended: ReferenceError: Error #1069: Property id not found on mx.rpc.http.mxml.HTTPService and there is no default value.)
Which i don't understand since i defined 'id' property :/
id is not really a property at the HttpService, or any other MXML control for that matter, class. Unformatunatly, HttpService doesn't have name property either! So perhaps the best way for you would be to subclass it and add the name property which you can use to dertermine which service faulted.
Hope this helps.
I see, will do that. Thanks for help atta
So you have multiple HTTPService tags? Why not declare a different fault handler for each one?
You do not need multiple HTTPService instances, one will usually do.