I just tried it -- it works fine. Did you enter items in the label field for the combobox, and did you name it cboIssueDates?

You can also do it without the listener object (essentially using the current timeline as the listener):

function showSelection(evt:Object) {
   trace ( "You selected "+ evt.target.selectedItem.label);
}

cboIssueDates.addEventListener ("change", showSelection);

More on the same idea for other components here: http://flash-creations.com/notes/components_intro.php

Helen

Miles Thompson wrote:


The movie has been migrated from Flash MX to MX 2004.

The setChangeHandler used to show up in blue in MX, but does not do so in MX 2004. This has presumably taken it's place:


cboIssueDatesLstnr = new Object();

cboIssueDatesLstnr.change = function(eventObj){
    var eventSource = eventObj.target;

    var theSelectedItem = eventSource.selectedItem;
    var theSelectedItemLabel = theSelectedItem.label;

    trace ( "You selected "+theSelectedItemLabel+".");
}

cboIssueDates.addEventListener ("change", cboIssueDatesLstnr);

But this was lifted from MAcroMedia's Business Directory Sample, and it doesn't work either. Heck, the trace() never displays.

This is what I had, and which worked, and still works, in Flash MX:

cboIssueDates.setChangeHandler( "loadStory");

function loadStory(component)
{
    GetStories( component.getSelectedItem().data );
BkIssPrntBtn( cboIssueDates.getSelectedItem().data, _root.lOKtoPrint );
    _root.dtDate = component.getSelectedItem().data ;
}


Three questions, two of which are rhetorical:
1. Why did MM break this?
2. Why do the examples on listeners, copiously published, not work? At least this one doesn't?

3. Humbly, what do I have to do to fix this?

Feeling pretty frustrated - Miles


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to