android - combobox labels to movieclip frames that are on same frame as3 -
hi making android app on flash cs5 helper "mmorpg" game. in app have 3 buttons named flux, naptha , food flavor, lead list of 11 comboboxes named cb1-11. buttons work on same frame (they clear list of each combobox , add theres), on each combobox there 67 labels. on same frame there 11 movieclips namend mv1 - 11 have 67 frames each.
what want make each label gotoandstop on spesified frame in movie clip. want make application save data user able load list agen. oh , cant seem make exit buton work.
p.s. beginner in actionscript 3.0 rather have answer explained in detail.
here example of 1 of comboboxes.
import flash.events.mouseevent; function fluxlist():void { cb1.additem( { label: "choose herb" } ); cb1.additem( { label: "acerba moretum" } ); cb1.additem( { label: "adipem nebulo" } ); cb1.additem( { label: "albus viduae" } ); cb1.additem( { label: "aquila peccatum" } ); cb1.additem( { label: "aureus magistrum" } ); cb1.additem( { label: "bacce hamsa" } ); cb1.additem( { label: "burmenta wallo" } ); cb1.additem( { label: "caeci costos" } ); cb1.additem( { label: "chorea iram" } ); cb1.additem( { label: "curaila jangha" } ); cb1.additem( { label: "curva manus" } ); cb1.additem( { label: "desertus smilax" } ); } function fluxbtn (event:mouseevent):void{ cb1.removeall(); cb2.removeall(); cb3.removeall(); cb4.removeall(); cb5.removeall(); cb6.removeall(); cb7.removeall(); cb8.removeall(); cb9.removeall(); cb10.removeall(); cb11.removeall(); fluxlist(); stadict.text = "my flux list"; } flux_btn.addeventlistener(mouseevent.click, fluxbtn); var font:font1=new font1(); var myformatblack:textformat = new textformat(); myformatblack.font = font.fontname; myformatblack.size = 24; myformatblack.color = 0xffffff; cb1.textfield.setstyle("embedfonts", true); cb1.textfield.setstyle("textformat", myformatblack); cb1.dropdown.setrendererstyle("embedfonts", true); cb1.dropdown.setrendererstyle("textformat", myformatblack); cb1.setstyle("embedfonts", true); cb1.setstyle("textformat", myformatblack); cb1.width = 269; cb1.height = 36.30; cb1.x = 39.75; cb1.y = 321.05; cb1.setstyle("textpadding", 1);
i appreciate solution possible.
thanks in regards [example of frame 38]
as far know exit button isnt possible in flash / air apps.
to gotoandstop on specific frame within mc, use like
root.yourmc.gotoandstop("namedframewithinmc");
or
root.yourmc.gotoandstop(1);
as saving user choices there many ways so.
a great example of how using as3 sharedobject class http://www.republicofcode.com/tutorials/flash/as3sharedobject/
search around stackoverflow other methods if needed there many options work well.
also make sure have added.
import fl.accessibility.comboboxaccimpl; comboboxaccimpl.enableaccessibility();
you use label & data & variables. create change listeners & function
flux_list.addeventlistener(event.change, changehandler); function changehandler(event:event):void { var myvar = mycombobox.selecteditem.data; if (myvar == 1) { root.yourmc.gotoandstop(myvar); } if (myvar == 2) { root.yourmc.gotoandstop(myvar); } }
and in combobox creation ad data field use in above code eg.
cb1.additem( { label: "choose herb", data:"1" } );
some docs worth reading are: http://help.adobe.com/en_us/actionscript/3.0_usingcomponentsas3/ws5b3ccc516d4fbf351e63e3d118a9c65b32-7fa9.html
and
http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/fl/controls/combobox.html
hope helps.
Comments
Post a Comment