actionscript 3 - How to find which item is selected on DropDownList? -


this declaration of resource:

public var langs:arraycollection = new arraycollection(         [ {lab:"english"},         {lab:"russian"}]); 

this declaration of dorpdownlist:

<s:dropdownlist x="157.7" y="10.35" id="list" ></s:dropdownlist> <s:textarea x="15" y="38" width="255" height="277" id="textg"/> <s:textarea x="286" y="39" width="251" height="276" id="textt"/> <s:button x="465" y="322.65" label="translate" click="button1_clickhandler(event)"/> <s:dropdownlist x="286.3" y="10.35" dataprovider="{langs}" labelfield="lab" prompt="select"></s:dropdownlist> 

how find item selected on dropdownlist via as3?

you can provide id dropdownlist.

<s:dropdownlist id="dropdownlistid" x="286.3" y="10.35" dataprovider="{langs}"                  labelfield="lab" prompt="select"></s:dropdownlist> 

and selected item as 

dropdownlistid.selecteditem  

i'm not sure, if follow api there must property called selectedindex. can item dataprovider, arraycollection lang lang.getitemat(dropdownlistid.selectedindex);


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -