PDA

View Full Version : ComboBox


Ashraf
02-23-2004, 01:28 AM
i am a beginner
i want to make combobox, when clik each label open separet SWF File.
Like: Chapter 1 ..... 5, to my project
I hope any boody help me.
Thanks

farafiro
02-24-2004, 06:44 AM
okey, here ya go ya Ashraf
//grab the ComboBox to the stage and then delete it
//
import mx.controls.*;
//
var theData:Array = ["A", "B", "C", "D", "E"];
var theSwf:Array = ["one", "two", "three", "four", "five"];
//
createClassObject(ComboBox, "co", 1, {dataProvider:theData, _x:50, _y:50});
//
var o:Object = new Object();
o.change = function(z) {
trace(z.target.selectedIndex+": :: "+_level0.theSwf[z.target.selectedIndex]+"swf");
_level0.holder_mc.loadMovie(_level0.theSwf[z.target.selectedIndex]+".swf");
};
co.addEventListener("change", o);

Ashraf
02-25-2004, 12:17 PM
Thank you
i want try now

estudioworks
03-19-2006, 01:35 PM
Question for you, what If when the combox is selected it goes to differant frames within your movie, how would you do that ?

I tried:


stop();
import mx.controls.*;
//
var theData:Array = ["A", "B", "C", "D", "E"];
var theFrame:Array = ["A", "B", "C", "D", "E"];
//
createClassObject(ComboBox, "co", 1, {dataProvider:theData, _x:50, _y:50});
//
var o:Object = new Object();
o.change = function(z) {
gotoAndStop(selectedIndex);
};
co.addEventListener("change", o)

farafiro
03-20-2006, 04:49 AM
stop();
import mx.controls.*;
//
var theData:Array = ["A", "B", "C", "D", "E"];
var theFrame:Array = ["A", "B", "C", "D", "E"];
//
createClassObject(ComboBox, "co", 1, {dataProvider:theData, _x:50, _y:50});
//
var o:Object = new Object();
o.change = function(z) {
gotoAndStop(theFrame[z.target.selectedIndex]);
};
co.addEventListener("change", o);

icemart525
03-20-2006, 05:06 AM
okey, here ya go ya Ashraf
//grab the ComboBox to the stage and then delete it


why do i still need to do this? :)

estudioworks
03-20-2006, 01:27 PM
Thanks, I got it to work about 2 minutes after I posted it !!

Thanks !! :)

icemart525
03-21-2006, 12:53 AM
why do i still need to do this? :)

ok i gt it, it needs to be in the library..:eek:

hi_master
01-27-2007, 02:22 PM
Hi there!

This is my first post here . I am learning FLash 8 and combining that with PHP but I am stuck on a flash issuew.
I am using a combo box (called myComboBox) to give the user a selection of listed items from a database. I want the user to select an item from the drop down which then in turn brings up further information about that selection in a dynamic text box.

I want the information to be displayed as soon as the selection is pressed without the user having to click a button next to the component

The way I am trying to do it is set some Listener Handler(or something like that) that calls a function to display the info in the dynamic textbox (I called txtBox1) but this does not work.

Here's my code:

myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();
};
myData.load("http://localhost/tda/Flash/db2.php");
placeTheDataIntoTheRightPlace = function(){

var i=0;
while ((myData["apellido" + i])<>null){

myComboBox.addItemAt(i,(myData["apellido" + i]+ ", " + myData["nombre" + i]));
i++;

listenerObject = new Object();
listenerObject.change = function(eventObject){

this.txtBox1.text= myData["torre" + i];
}
myComboBox.addEventListener("change", listenerObject);
};
};

I don't know, sure I'm doing wrong things here but what!? I'm lose hop

Please be gently because I'm new actionscript user. Any help on this would be great as I am getting really frustrated

Thanks a lot in advenced and have a great week!