actionscript 3 - Want to send parameters with custom dispatch event -
I am creating a library [example (name = "event action", type = "something")) public function create_new_customer
----; ----; ------------; Rpc.addEventListener (event.complete, on_resite); } Private Events onCreate_returns (evt: Event): Zero {var ob: object = evt.target.getResponse (); Dispatches (new event ("Event Action")); } I have a listener of this event on the side of the app. So when I send the event manually, I should send "ob" as a parameter. How to do it
You need to create a custom event class with additional properties to pass data with it. In your case, you can use a class like
public category YourEvent Event {public static const SOMETHING_HAPPENED: String = "somethingHappend"; Public Miscellaneous Data: Object; Public Event YourEvent (type: string, data: object, bubbles: boolean = false, cancellable: boolean = false) {super (types, bubbles, cancellable); This.data = data; } Override Public Function Clone (): Event {Return to New Artistic (Types, Data, Bubbles, Cancellable); }} Then when you send:
SenderAvent (new your inventory (your event.SOMETHING_HAPPENED, ob));
Comments
Post a Comment