0 Replies - 3064 Views - Last Post: 27 August 2012 - 09:04 AM

#1 vitorio78  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-August 12

Combobox, component, as3, flash, cs4

Posted 27 August 2012 - 09:04 AM

Hello everyone, I`m trying to connect 4 Comboboxes (instance names: combo1,combo2...) together for my project. I want when the user select "First Item" in combo1, combo2 to display a data and etc. But I have a problem :(. The code is too long and Flash is ignoring part of it, but the code is with no errors. The AS3 file is external. I`m not so familiar with AS2/AS3. I have looked at this tutorial: http://www.youtube.c...h?v=beFps8_ZWm4 and I have done it that way. Please suggest an easy way to do it.

P.S.: I`m sorry for my English!




combo1.addItem( {label:"Choose..."} );
combo1.addItem( {label:"Item 1"} );
combo1.addItem( {label:"Item 2"} );
combo1.addItem( {label:"Item 3"} );
combo1.addItem( {label:"Item 4"} );
combo1.addItem( {label:"Item 5"} );
combo1.addItem( {label:"Item 6"} );
combo1.addItem( {label:"Item 7"} );
combo1.addItem( {label:"Item 8"} );
combo1.addItem( {label:"Item 9"} );
combo1.addItem( {label:"Item 10"} );


function Item_1_List():void
{
     combo2.addItem( {label:"Choose..."} );
     combo2.addItem( {label:"Item A"} );
     combo2.addItem( {label:"Item B"} );
     combo2.addItem( {label:"Item C"} );
     combo2.addItem( {label:"Item D"} );
     combo2.addItem( {label:"Item E"} );
     combo2.addItem( {label:"Item F"} );
     combo2.addItem( {label:"Item G"} );
     combo2.addItem( {label:"Item H"} );
     combo2.addItem( {label:"Item I"} );
     combo2.addItem( {label:"Item J"} );
}

combo1.addEventListener(Event.CHANGE, main_menu);
function main_menu(event:Event):void
{
	combo2.removeAll();
	combo3.removeAll();
	combo4.removeAll();
	if(combo1.selectedItem.label == "Item 1") Item_1_List();
	if(combo1.selectedItem.label == "Item 2") Item_2_List();
	if(combo1.selectedItem.label == "Item 3") Item_3_List();
	....
        etc
}

combo2.addEventListener(Event.CHANGE, Item_1);
function Item_1(event:Event):void
{
	combo3.removeAll();
	combo4.removeAll();
	if(combo2.selectedItem.label == "Item A") Item_AA_List();
	if(combo2.selectedItem.label == "Item B") Item_BB_List();
	if(combo2.selectedItem.label == "Item C") Item_CC_List();
	if(combo2.selectedItem.label == "Item D") Item_DD_List();
        ...
        etc
}



You got the point. And at the combo4 I want to put some data, which on click goes and stop a certain frame. Please if you know a way share it with me.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1