A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Need new script for MX2004 ComboBox!

  1. #1
    Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    30

    Need new script for MX2004 ComboBox!

    I used this script on my combobox in FlashMX(6) but it dont works with MX2004 (7). Need a upgraded version!

    code:--------------------------------------------------------------------------------
    function GoToURL() {
    value = cb.getSelectedItem().data
    gotoAndStop(value);
    }

    cb.setChangeHandler("GoToURL");
    cb.addItem("start", "label1");
    cb.addItem("finish", "label2")
    --------------------------------------------------------------------------------

  2. #2
    See-n-reMember azwaldo's Avatar
    Join Date
    Mar 2003
    Location
    Sonoran Desert
    Posts
    745
    howdy peder,
    looks like addItem() should still work the same, as far as the "change" handler...try attaching this to your actions on the main timeline:
    Code:
    listenerObject = new Object();
    listenerObject.change = function(eventObject){
       // your code here
       GoToURL();//call to your fxn 
    }
    comboBoxInstanceName.addEventListener("change", listenerObject)
    ...have a look at this page, and see if that helps. if not post again
    __azwaldo__

  3. #3
    Member
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    30
    Thanks!
    It worked out this way:

    listener = new Object();
    listener.change = function(eventObj){
    if(my_cb.selectedIndex == 1){

    gotoAndStop("label1");

    }else if(my_cb.selectedIndex == 2){

    getURL("http://wwww.google.com");

    }else if(my_cb.selectedIndex == 3){

    getURL("http://wwww.amazon.com");

    }
    }
    my_cb.addEventListener("change",listener);



    Regards
    peder

  4. #4
    See-n-reMember azwaldo's Avatar
    Join Date
    Mar 2003
    Location
    Sonoran Desert
    Posts
    745
    glad you found a solution
    __azwaldo__

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center