Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-08-2006, 10:32 PM   #1
Registered User
Join Date: Dec 2006
Posts: 2
Default ComboBox and event handlers

I think my question is two-fold:

How do I capture and/or refer to the current state of a ComboBox? or it's changed state?

Here is a slice of my code:

typefaceNamesCombo.dataProvider = fontMenuFiller_global;
typefaceNamesCombo.addEventListener("change",trace ('eventListner encountered'));
var index= typefaceNamesCombo.selectedIndex;
trace('change handler entered; index= ' + index);
myText.text=('Typographer: '+maker_global[index] + '\r'+bio_global[index]);

I want to have users choose an item from the drop down list and use that information to display items in another (dynamic) text box.

Using the code above, I get 'undefined' as the value of index. (I want to use that index to reference array's I have created from an XML file.)
krivedal is offline   Reply With Quote
Old 12-09-2006, 05:00 AM   #2
Fight ya for a pint!
pan69's Avatar
Join Date: Jan 2005
Location: Sydney / Australia
Posts: 1,706

Hi and welcome to actionscript.org,

The sort answer:
ActionScript Code:
import mx.utils.Delegate; this.onChange = function(event : Object) : Void {    trace("onChange"); }; typefaceNamesCombo.dataProvider = fontMenuFiller_global; typefaceNamesCombo.addEventListener("change", Delegate.create(this, onChange) );

the long answer (at least, a start of it): http://www.actionscript.org/resource...ass/Page1.html

Hope this helps.


Last edited by pan69; 11-16-2012 at 10:35 PM.
pan69 is offline   Reply With Quote
Old 12-09-2006, 01:18 PM   #3
Registered User
Join Date: Dec 2006
Posts: 2

Thanks sooo much. I knew there had to be a tutorial --I just couldn't find it.
krivedal is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
removeMovieClip() not work for components? djandrew Components 30 08-03-2007 04:51 PM
Combobox selection affect onClick handlers for buttons RQFlash Components 8 11-05-2006 08:43 PM
Problem with ComboBox over a MovieClip mansonet Components 0 11-01-2006 01:04 PM
comboBox - events ahungryghost Components 4 05-21-2006 02:40 PM
Directing URL based on combobox responses extravaganza1 Components 0 09-30-2005 11:27 PM

All times are GMT. The time now is 03:28 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.