actionscript 3 - Flex 3 event propagation on a composite custom component? -


I have a select component, which is composed of a selection control (radio button) and text input. I want to make some arguments in response to the incidents of change with both the controls, but after that I want to do anything that the transformation of the composite component has been registered on the handler so that there is a change in the handling of events. The problem is, when I send events again, the event goal has changed to my custom component, the goal of the initial event has been lost.

Here is my custom component:

   & Lt; Mx: text input width = "100%" maxChars = "{listItem.specify. EntryLength}" enabled = "{selected}" visible = "{listItem.hasOwnProperty ('specify')}" include inlineout = "{visible} "Change =" onTextChange (event) "/> & Lt; / Mx: hbox & gt;  

In the event handler that receives the change event from this component, I think that specify the event.target is an example of a radio button, not TextInput or RadioButton, as I expected the event How do I get it, which I wanted here?

  get event [event type = "change" bubble = wrong cancelable = false eventPhase = 2] from question0. Tab.Survey.questionForm.questionContainer.Single94.VBox95.SpecifyRadioButton111  

revert to the original event Instead of sending from the new event and the original event as the origEvent property, specify the new presentation that the RadioButton Displays can be either a custom event class that extends the event, or you are lazy Can and just use mx.events.DynamicEvent.

Example:

  Import mx.events.DynamicEvent; Private Function Change Changes (Event: Event): Zero {selected = event.target.selected; Var newEvent: DynamicEvent = New DynamicEvent (Event. CHANGE); NewEvent.origEvent = Event; DispatchEvent (newEvent); }  

Then, in your handler for the SpecifyRadioButton.change event, reference the event.origEvent property.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -