A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Question combobox if statement

Hybrid View

  1. #1
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76

    Question combobox if statement

    Hey guys.. so this is the code I have:

    var cbListener:Object = new Object();
    cbListener.change = function(evt_obj:Object) {
    var item_obj:Object = my_cb.selectedItem;
    var i:String;
    for (i in item_obj) {
    }
    trace(item_obj[i]);
    if (item_obj[i]="attractions") {
    trace("hit");
    }
    };
    my_cb.addEventListener("change", cbListener);


    The prob I'm having is that now it keeps assuming that item_obj[i] is "attractions" no matter what the value actually is.. then I tried == and it did nothing.. any suggestions?

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    I think you need to look at the .selectedItem or .value of the item.

    Something like (I'm not positive) item_obj[i].value

  3. #3
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76
    with .value it does not make it always attractions but still traces hit at every value

  4. #4
    Member
    Join Date
    Jan 2004
    Location
    Ontario,Canada
    Posts
    76
    anyone have any ideas? It traces hit at every value even if it isnt "attractions"

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