Skip to main content
Participant
February 16, 2007
Answered

Forcing a non interaction event. Listeners just wont listen!!! Aaarg!

  • February 16, 2007
  • 2 replies
  • 296 views
I'm trying to force a series of components to update themselves when the selected index of a comboBox has changed. This works perfectly fine when i manually click on the main combo box and make my selection. BUT... and here is the big BUTT...

I have a movie clip that plays and when it ends it send an event to change the selected index on the main combox. The main combobox changes just fine, but everything else that is binded to it doesnt.

Any ideas or suggestions as to how I can go about fixing this?

Sa basically all listeners and events work fine when the user phically clicks on the items and triggers them. But when those events are sent out via the result of automation such as calling a function when a movie ends, nothing happens. What am I doing wrong?
This topic has been closed for replies.
Correct answer Newsgroup_User
The docs specify that the "change" event is fired as a result of user
interaction.

That said, there's nothing to prevent you from firing events whenever you
want. Example:


myComboBox.dispatchEvent({type:"change"})




2 replies

Newsgroup_UserCorrect answer
Inspiring
February 16, 2007
The docs specify that the "change" event is fired as a result of user
interaction.

That said, there's nothing to prevent you from firing events whenever you
want. Example:


myComboBox.dispatchEvent({type:"change"})




Participant
February 16, 2007
A first I didnt get it, but it took a few minutes to sink in and it worked like charm!!!! thanks so much.!!! This is gonna save my life hahahaa
Participant
February 16, 2007
heres an example you can use to test out what Im talking about.

Download this source file:
http://download.macromedia.com/pub/developer/xml_connector.zip

1. Extract it and open the fla.
2. Add a button component somewhere.
3. Place the following code on the button.
//-------------------------------------code-----------------------------------------
on(press){
_root.cbTrips.selectedIndex = _root.cbTrips.selectedIndex+1;
}
//-------------------------------------end code-----------------------------------

4. Ok test it, and notice that if you manipulate the combo box manually all the bindings work fine. but when you press the button, the button then send the command to the combobox to select a new item, so all the other components igonre the binding... what the heck is going on here?!?!?!

P.S. The source file is from xmlconnector tutorial on the adobe site...
( http://www.adobe.com/devnet/flash/articles/xmlconnector.html)