Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Multiple Comboboxes



Hello all,

my question is the following:

I have 3 comboboxes with different values for each one.
Lets say:

combo1 with a,b,c
combo2 with d,e
combo3 with f,g

I also have a submit button:

what is the code I have to use in order to load a specific movie according to the values of the combos?

For instance I want to load clip1.swf if:
combo1=a and combo2=e and combo3=g

Thanking you in advance for your help,



FlashKit > Flash Help > Flash Newbies
Posted on: 02-25-2008, 11:02 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

XML Multiple ComboBoxes
First, I have posted this on Experts Exchange as well bit I have waited 24 hours and there is no response so I am hoping to get some help here.

My goal is to load an external XML. Then populate a first comboBox with category names from a node attribute in the xml. I can do this successfully. I need to then detect when the user makes a change in the comboBox (I can do this sucessfully) BUT then I need to populate the second comboBox with the store names belonging to the category chosen. I can trace out the results but I don't know exactly how to make the second comboBox be populated. Here is my xml code

var myXML:XML=new (XML);

myXML.ignoreWhite=true;
myXML.onLoad=function(success) {
rootNode=this.firstChild;
total=rootNode.childNodes.length;
for (i=0;i<total; i++) {
myCombo.addItem(rootNode.childNodes[i].attributes.title);

for (j=0; j<rootNode.childNodes[i].childNodes.length;j++) {
_global.storeNames=new Array();
storeNames[i]=rootNode.childNodes[i].childNodes [j].attributes.storeName; }
}


var myListener:Object=new Object();
myListener.change=function(evt) {

}
myCombo.addEventListener("change", myListener)
myXML.load("teams.xml");


This is an extract from my xml file:
<stores>
<category title="Apparel">
<store storeName="American Way Thrift Store" phone="841-6013" address="3226 W. Magnolia Blvd." />
<store storeName="Ann of Magnolia" phone="567-1472" address="2926 W. Magnolia Blvd." />
<store storeName="Carly Jean Boutique" phone="972-2500" address="3492 W. Magnolia Blvd."/>
</category>
<category title="Beauty Health">
<store storeName="Actual Image" phone="260-9611" address="2809 W. Magnolia Blvd." />
<store storeName="Arcade Beauty Box" phone="842-6570" address="3319 W. Magnolia Blvd. #A"/>
<store storeName="Beauty Works Hair Studio" phone="845-5540" address="2424 W. Magnolia Blvd. Ste C"/>
</category>


Both files can be accessed at www.alexisjean.com/flash/teams.xml and www.alexisjean.com/flash/thursday.fla. I saved thursday.fla back to version 8 since I am using CS3.

Multiple Comboboxes
I am populating two comboxes one with state names and the other with city names from a simple xml file using xmlconnector. If I click on a state name in the first combo box then its corresponding city names populate correctly in the second combobox.

Now I added three buttons on the layer and added the code to change the selectedindex of the first combobox in the button's onclick event. When I click the button the first combobox correctly changes brings up the state name but the second combobox doe not change. i.e. the second combobox populates the cities only on user doing a mouse clicking on the state names. Everywhere in Adobe docs it says 'user change' but not through 'code change'

What is wrong ? Is there a way to get around this ?

the data in a simple xml is

Massachusettes
----Boston
----Needham
----Worster
New York
----Manhattan
----Bronx
----Brooklyn

etc.


Any help very much appreciated.

Multiple Comboboxes From Php
Hi, I've been having a problem using comboboxes to read from a php script. I want to use around 6 different comboboxes to control a number of different movie clips. I have everything working fine reading from 1 combobox using the following code:

php script:

PHP Code:



<?php
$NameArr = array("Headphones", "Sunglasses",  "Hat");
$DataArr = array("headphones", "sunglasses", "hat");
for($i=0;$i<count($NameArr);$i++) {
$data[] = $NameArr[$i].":".$DataArr[$i];
}

print implode("
", $data);
?>




Flash:

ActionScript Code:
//Create a new instance of the LoadVars objectmyVars = new LoadVars();//Load the text filemyVars.load("loadCombo.php");//Run this when the data has loadedmyVars.onData = function(raw) {        //Split the loaded text into an array by newline        tmp = raw.split("
");        //Loop through the array        for(var i=0;i<tmp.length;i++) {                //make a new array from each element of the first array splitting on the | symbol                tmp2 = tmp[i].split(":");                //Add an item to the comboBox for this element of the text file                myCombo.addItem(tmp2[0], tmp2[1]);        }}//Selection - Select MC mycombo.setChangeHandler("onChange");onChange=function(){    _root.man[selected]._visible = false;    selected = mycombo.getValue();    _root.man[selected]._visible = true;    }function traceCombo(com) {    trace ("Selected Data: " + com.getSelectedItem().data);    trace ("Selected Label: " + com.getSelectedItem().label);       trace ("--------------------------------------");   }


Now I'm having trouble figuring out what would be the best way to go about reading to multiple comboboxes without creating a number of different functions? Would I be able to redefine the current function to load text into multiple comboboxes from my php script? I'm not sure how to sort out my arrays either.

Multiple ComboBoxes And Forms
Hi All,

I have a form with multiple ComboBoxes. I can only get the first value to send to email. I'm not sure what I'm doing wrong but this is the latest AS I've tried:

//Drop Down Data

objComboListener = new Object();
objComboListener.change = function(eventObj){
stateDD.text = eventObj.target.value;
};
stateDD.addEventListener("change", objComboListener);

objComboListener.change = function(eventObj){
contactDDbox.text = eventObj.target.value;
}
contactDDbox.addEventListener("change", objComboListener);

The stateDD value goes but the contactDD value doesn't go - I just have a blank field in the email that was generated from the php file.

Can someone plz help!

Thanks,
Scott

Best Method For XML Content, Multiple Comboboxes, Populating Dynamic Text
Hi folks,

Im looking for some input on the following project. In principle I have a good idea of what shold happen, but its the implementation i'm unsure of.

Basically I built a CDROM in Flash with a bunch of podcasts on it for an event. It went down really well and now they want to release a regular version. In order to manage the regular updates in an efficient manner, i'd like to set up the content externally using XML and do the wizardry with AS3.

The scenario is this, at the moment there are 6 business units but as this gets bigger more will be added (up to 10). Every business unit has its own podcasts, of varying numbers. The podcast CD is 2 screens - an introduction and the podcasts lists(buttons), and a second screen with the flv/mp3 player and the podcast details.

So in principle i need to do is load in the XML, and for every business unit, add a combo box to screen 1, underneath the last one, and populate it with the names of the podcast. When a podcast is selected from the drop down i need to transition to screen 2, populate the dynamic text fields with the specific podcasts details and play the movie.

The guts of the XML will look something like this i guess:

Code:
<businessunit id="">
<podcast>
<path></path>
<title></title>
<overview></overview>
<cta></cta>
</podcast>
<podcast>..........
</podcast>
</businessunit>
<businessunit id="">
<podcast>..........
</podcast>
</businessunit>
The real question for me is, what is the best way of populating multiple comboboxes and how do i track/populate the second screen from the selection on screen 1. I don't really want to ID every podcast so using their position in the XML structure would be a better means of ID for me? There are a few potential options I see for handling the XML - reading all the data into arrays, but seems a bit antequated; using the new E4X syntax; and there's potentially XMLLIST?!

So really not sure what to do for best here - any help or examples much appreciated!!!

Mx Comboboxes
Hello all, Im having an issue with the combo box components in flash mx. im finding that when i create about 10 or more comboboxes on the stage, the player takes a huge performance hit. i find that it takes me about 5-10 seconds to go thru my code which dynamically creates the comboboxes, adds items, reesizes, etc. ive found that addItem and setSize is what takes the most amount of time but these are both essential to what i am creating.

i was wondering if anyone had any suggestions on how i can speed up performance on these so the wait time wouldnt be so damn long. im running on a p4 1.7ghz box.

here is sample code from my file ...
-------code---------------
this.combo.attachMovie("FComboBoxSymbol", codeobj, d.getNewDepth());
this.combo[codeobj].addItem("", null);
for(i=listAr.length-1; i>=0; i--) {
this.combo[codeobj].addItem(listAr[i].decode, listAr[i].codedvalue);
}

// embed the combo box font
embedFontStyle.addListener(this.combo[codeobj]);

this.combo[codeobj]._x = Number(n.attributes.X);
this.combo[codeobj]._y = Number(n.attributes.Y);
this.combo[codeobj].setSize(Number(n.attributes.Width));

// set the tab order
this.combo[codeobj].tabIndex = _global.tab;

// set combo to current setting
if(n.firstChild.attributes.Value != null) {
this.combo[codeobj].setSelectedIndex(n.firstChild.attributes.Value);
}
-------code---------------
any suggestions or help is greatly appreciated.

-d

ComboBoxes
Does anyone know how to use the comboBox componant? Is there an easy and efficient way of doing it? Thanks for you help.

ComboBoxes
How do I use a combo box to change a picture to whatever picture is selected in the combo box at runtime?

ComboBoxes :(
Hey guys, I am embarrassed to say I don't know how to use a ComboBox. I'm setting up a form with about 8 ComboBoxes. Based on the answers a _mc will load. Can anyone please help me with this? I have the layout and the info all in,I just need to learn how to make it work.

Thanks in advance

Michael

Comboboxes And XML
Hello. I'm creating an interactive map. The base map (first scene, first frame) has only building outlines and streets. Above the map are several drop down lists (using comboboxes). If the user selects an item in the combobox, the corresponding building is highlighted and labeled. So far I've accomplished this by creating a different scene for each building, different from the base in that it also includes the highlight and label. I'm keeping the building information in an XML file so it can be easily updated:

<?xml version="1.0" standalone="yes"?>
<buildings>
<site siteName="Building01" Data="B1"></site>
<site siteName="Building02" Data="B2"></site>
<site siteName="Building03" Data="B3"></site>
</buildings>

My actionscript to link the comboboxes with the XML files is:

//create a new XML object
thisXML = new XML();
//ignore whitespace in the file
thisXML.ignoreWhite = true;
//call the LoadChartData function when the XML file is loaded
thisXML.onLoad = LoadCombo;
//load the xml file
thisXML.load("buildings.xml");

function LoadCombo(success) {

if (success) {
//set variables
var BaseNode=thisXML.childNodes[0];
var ComboSites = new Array();
var ComboData = new Array();
var ThisNode;

//set .dataprovider "not needed but nice to have"
CBOLoadBuildings.setDataProvider(ComboSites);
//add the default item to the combo box
CBOLoadBuildings.addItem("--Buildings--");

//get building information
for (i=0; i < BaseNode.childNodes.length; i++) {
ThisNode = BaseNode.childNodes[i];
ComboSites[i] = ThisNode.attributes["siteName"];
ComboData[i] = ThisNode.attributes["Data"];
//add to combo box
CBOLoadBuildings.addItem(ComboSites[i],ComboData[i]);
}
}
}

//Function Call for navigation and to restore comboBoxes
CBOLoadbuildings.setchangeHandler("navigateBuildin gs");


//functions
function navigateBuildings() {
if (CBOLoadBuildings.getSelectedItem().data != null){//stops recursion by checking for valid selection
CBOLoadAcademic.setSelectedIndex(0);
CBOLoadAdmin.setSelectedIndex(0);
CBOLoadResidence.setSelectedIndex(0);
CBOLoadCamp.setSelectedIndex(0);
_root.gotoAndPlay(CBOLoadBuildings.getSelectedItem ().data);
}
}
stop();


I have several questions:

1. The menus are not working. Nothing happens when an item is selected. Any idea why?

2. Do you know a better way to accomplish what I am trying to do?

3. I want the menus to reset once an item is selected. So if I select "Building01" I want the menu to automatically reset to show "--Buildings--". Do you know how to do this?

Thanks for any help you can provide,
malpeigne

2 Comboboxes
Hello,
I hop somebody can help me...
I want to use two Comboboxes, for a product comparison. What i want to do is, to select one product in one combobox and 2nd in the 2nd combobox.
I am not getting how to create 2 functions that if both are selected to move on to the next frame.
I got so far
for one combobox (prod):

prod.setChangeHandler("loadPr");

function loadPr(component);{
var pr1 = component.getSelectedItem().data

mc.loadMovie("test.swf");
}

what i tried to do is to insert
var c = comonent.getSelectedIndex;
if (c > 0) {
gotoAndStop(2);
}

But it doesnt work....
Another thing when you got 2 Comboboxes (similiar) is there a possibility, if selecting 1 to delete the one in the 2nd box?
(so you wouldnt be able to select the same thing in both c.boxes)

Comboboxes Help
ok,
my combobox has these values
red
black
blue
the values are the same.

i want there to be a text box underneath and when the person changes the combobox value the text in the the textbox changes.

so for example

Combo Box lable: red
Text displayed in textbox: red is my favourite colour!!

Combo Box lable: black
Text displayed in textbox: black is the darkest colour.

Combo Box lable: blue
Text displayed in textbox: blue goes well with green.

i have a combobox and a dynamic text box in my prsentation.

i have another frame with the code. i tried code like:

onEnterframe = function () {
if (mycombobox.value == "red") {
textbox.text = "red is my favourite colour";
}
}

that didn't seem to work so can someone plz help me and i would be gratefull if you could upload an example file into this thread or email me an example to:
skyrider123@gmail.com

thanks and i hope you can help me!!

Two Comboboxes
Hi - could anyone help me with some code ?

I need two comboboxes.. .

One has a choice of 10 flavours, the other has a choice of 5 tubs

Once the user presses a GO button the seletced choice combination determines the web page, is there a simple peice of script I can use to make this happen ?

Thanks
Andy

Comboboxes
I am trying to use several combo boxes in a document. I've modified code from page 208 of Foundation Flash 8 Video book, so instead of having a combobox play video, it goes to an URL. I put the Combobox component on the stage, gave it an instance name of 2dCirList, and put links like http://www.ca2.uscourts.gov in Data. Then I put the following code in Frame 1 of the actions layer:

function GetURL():Void{
getURL(2dCirList.data[2dCirList.selectedIndex])
}

var 2dCirListenerObject:Object = new Object ();
2dCirListenerObject.change = function (eventObject:Object):Void{
GetURL();
}

2dCirList.addEventListener ("change", 2dCirListObject);
GetURL();

The list drops down, but when you select an item, it goes nowhere.

I've been trying different combinations of things for 2 days now. Can anyone give me any ideas? Its probably a " or something, but I'm tapped out.

John
www.thefirm.tv

Comboboxes And XML
Hello.  I'm creating an interactive map.  The base map (first scene, first frame) has only building outlines and streets.  Above the map are several drop down lists (using comboboxes).  If the user selects an item in the combobox, the corresponding building is highlighted and labeled.  So far I've accomplished this by creating a different scene for each building, different from the base in that it also includes the highlight and label.  I'm keeping the building information in an XML file so it can be easily updated:

<?xml version="1.0" standalone="yes"?>
<buildings>
    <site siteName="Building01" Data="B1"></site>
        <site siteName="Building02" Data="B2"></site>
        <site siteName="Building03" Data="B3"></site>
</buildings>

My actionscript to link the comboboxes with the XML files is:

//create a new XML object
thisXML = new XML();
//ignore whitespace in the file
thisXML.ignoreWhite = true;
//call the LoadChartData function when the XML file is loaded
thisXML.onLoad = LoadCombo;
//load the xml file
thisXML.load("buildings.xml");

function LoadCombo(success) {
    
 if (success) {
        //set variables
        var BaseNode=thisXML.childNodes[0];
        var ComboSites = new Array();
        var ComboData = new Array();
        var ThisNode;
        
        //set .dataprovider "not needed but nice to have"
        CBOLoadBuildings.setDataProvider(ComboSites);
        //add the default item to the combo box
        CBOLoadBuildings.addItem("--Buildings--");
        
        //get building information
        for (i=0; i < BaseNode.childNodes.length; i++) {
            ThisNode = BaseNode.childNodes[i];
            ComboSites[i] = ThisNode.attributes["siteName"];
            ComboData[i] = ThisNode.attributes["Data"];
        //add to combo box
        CBOLoadBuildings.addItem(ComboSites[i],ComboData[i]);
        }
    }
}

    //Function Call for navigation and to restore comboBoxes
     CBOLoadbuildings.setchangeHandler("navigateBuildings");
     
    
    //functions
function navigateBuildings() {
        if (CBOLoadBuildings.getSelectedItem().data != null){//stops recursion by checking for valid selection
            CBOLoadAcademic.setSelectedIndex(0);
             CBOLoadAdmin.setSelectedIndex(0);
            CBOLoadResidence.setSelectedIndex(0);
            CBOLoadCamp.setSelectedIndex(0);
            _root.gotoAndPlay(CBOLoadBuildings.getSelectedItem().data);
        }
    }
stop();


I have several questions:

1. The menus are not working.  Nothing happens when an item is selected. Any idea why?

2. Do you know a better way to accomplish what I am trying to do?

3. I want the menus to reset once an item is selected.  So if I select "Building01" I want the menu to automatically reset to show "--Buildings--".  Do you know how to do this?

Thanks for any help you can provide,
malpeigne

Comboboxes
hi
I m trying to use a few comboboxes that collect data from a database.
If there is a good tutorial on this please let me know
I m trying to do sth similar to this
http://www.delafuentemallorca.com/search.php
thanks

Problems With ComboBoxes
I´ve just programmed something with ComboBoxes. Everything is working fine.

Problem is, when I load the movie in a higher level the ComboBoxes stop working.

Does anyone knows an answer?
Thanks Dirk

Script for a Box:

typ.setChangeHandler("Wohnmobil");

function Wohnmobil(){
alert_Wombi._x=-100;
alert_Wombi._y=-100;
var auswahlindex = typ.getSelectedIndex();
var wombi=(typ.getItemAt(auswahlindex).data);
wert=wombi.split(",");
kontroll.KontrolleWohnmobil=wert[1];
zusammenstellung.wombi="max. Gewicht Ihres Wohnmobils "+wert[1]+" kg";
zusammenstellung.wombiLeer="Leergewicht Ihres Wohnmobils "+wert[2]+" kg";
maxg=wert[1];
g=wert[2];
n=wert[3];
l=wert[4];
pA=Math.abs(10*n+10*l);

Comboboxes Values Sent To ASP
Hi there again! I'm trying to send the values that are select to ASP, but it always sends the first label(even if other is selected)

Here is the code for combo boxes:

boxState = new Array("Conneticut", "New Jersey", "New York");
for(s = 0; s <=2; s++)
{
state.addItem(boxState[s]);
}
// So far this works it shows the 3 states in combo box, now to assign the selected item to a variable to be sent to ASP//

var fstate = state.getValue();

ok this is it, I used this script and tested it by sending fstate to a dynamic text in flash(which showed fine). But when sent to ASP it stays at Conneticut. What's missing?

Help Me Decide A Bet Concerning Comboboxes
Hi,
Can anybody help me decide this bet I have with my friend:

I say it´s not possible to insert URL links into a combobox. My friend say that it is possible but he doesn´t know how.

Please help me with the answer... Possible or not? If possible, then please explain the method.
Thanx!
ik.

Using ComboBoxes To Fill In URL
OK, Try to follow me on this. I'm trying to figure a way by using a series of combo box components that each one has an instance that fills in various areas in an e-commerce URL.

For example, if I had a series of combo boxes for productID, productName, productPrice, productQty and productSize that when the Push Button is clicked it would all go to a getURL that would look like this URL in Actionscript:

getURL("http://order.ecommerce.com/review+i_"productID"+u_"productPrice"+q_"productQt y"+n_"+productName+"_"+productSize");

I'm not even sure I did that right. But does anyone know an example of this that can be done without PHP or ColdFusion but just ActionScript and arrays?

Comboboxes Never Work Right...
Trying to change the text size of a combobox...no luck.

Trying to change the rowcount becuase it's in a confined area and goes out of bounds...but you have to have a minimum rowcount of 3.

So basically if anyone knows if you can change the textsize in a combobox thats would be great. And if you can't figure it out I'm gunna have to go ahead and ask you to come in on saturday too. Mmmkay?

Thanks.

Controlling Comboboxes
Is there a way to control a combobox with actionscript. I have a combobox that has its labels loaded dynamically, but i need to control which label is in focus/selected with code as well.

Does anyone know how to do this??

Textinut & Comboboxes
another problem where the answer is probally simple. I have movie with a two text inputs and two combo boxes

Name = text input
ID = text input
Group = combo box
Department = combo box
(in this order)

If I fill everything out in the order shown aboe, it works perfect. Once I select a value with the combo box then try to type something in a text area, the combo box will jump to what ever letter you are typing in the text area. All fields have diffrent instance names so I have no idea what is causing this.

Duplicating Comboboxes
Hi everyone,

i'm trying to duplicate comboboxes in a for loop. the comboboxes are populated with data using the additem function from an array of information.

the first combobox is in place at runtime and populated with the data and then, after a user selects how many comboxes he wants, i run a function to duplicate it. this is the easy part..
everything is duplicated as expected, but as for the data in the duplicated comboboxes, there is no data inside of them!
i've tried everything and i've done this so many times before!

here is part of the code:

Code:
var carFieldsArray:Array = new Array (allCars.carMC);
for (var q=0; q<_root.howManyCars;q++) {
if (q>0) {
temp = carFieldsArray[q-1].duplicateMovieClip("carMC"+q, allCars.getNextHighestDepth());
temp._y += 55;
carFieldsArray.push (temp);
carFieldsArray[q].cNum.text = (q+1) + " car";
}
for (i=0;i<_parent.mainXML.childNodes.length;i++) {
carFieldsArray[q].carMan.addItem(_parent.carArray[i][0][0][0]);
}
the carArray is the array with the data
the carfields array is an array that i created for easy access to the comboboxes
carMan is the combobox.

thanks!

Problem With 2 ComboBoxes
Howdy,
I have an app that I'm building and it requires 2 ComboBoxes.

My code as of now is:
quickProcedure.addEventListener("change", this);
quickIC.addEventListener("change", this);
function change(evt){
_root.gotoAndPlay(quickProcedure.selectedItem.data );
}
function change(evt){
attachMovie("printPreview","printPreview",100);
}

I thought this would work but the quickProcedure ComboBox keeps activating the quickIC one.

How do I fix this?
Thanks for everyones time and help

Mikey

[F8] Issue With 2 ComboBoxes
Howdy,
I have an app that I'm building and it requires 2 ComboBoxes.

My code as of now is:
quickProcedure.addEventListener("change", this);
quickIC.addEventListener("change", this);
function change(evt){
_root.gotoAndPlay(quickProcedure.selectedItem.data );
}
function change(evt){
attachMovie("printPreview","printPreview",100);
}

I thought this would work but the quickProcedure ComboBox keeps activating the quickIC one.

How do I fix this?
Thanks for everyones time and help

Mikey

[F8] Populating Comboboxes
Hey I was wondering how i could make a choice in the first combobox, populate the second combobox with the necessary data according to the first combobox choice. i have an .fla example but apparently its too big to post here even though its only 735 KB..., im new to actionscript and maybe someone can help me out. also can someone help me out with my previous post about frames. thanks

[F8] Populating Comboboxes
Hey I was wondering how i could make a choice in the first combobox, populate the second combobox with the necessary data according to the first combobox choice. i have an .fla example but apparently its too big to post here even though its only 735 KB..., im new to actionscript and maybe someone can help me out. also can someone help me out with my previous post about frames. thanks

Customizing Comboboxes
I have two problems with comboboxes:

1) I need to change the colour of the background rollover state.

2) I need to remove the comboboxes scrollbar but keep the scrollbar arrows. I have fully customised the halo skin but can't seem to find all the scroll bar parts. Is there a way of doing it with AS?


Current AS used is:

guests.setStyle("color", 0xFFFFFF);
guests.setStyle("backgroundColor", "000000");
guests.setStyle("fontFamily", "Courier New");
guests.setStyle("borderStyle","none" );
guests.text_mc.setStyle("borderStyle","none" );
guests.setStyle("selectionColor", "000000");


thanks.

Can't Access ComboBoxes
I am unable to control ComboBoxes that are within dynamically created movieclips. Has anyone else experienced this problem?

I am creating a store which pulls all it's data from a database in Flash 8. There is a scrollpane on the stage which displays the merchandise. The content of this scrollpane is a blank movieclip to which I attach movies for each merchandise item using attachMovie(), based on records returned from the database. Within each of these individual merchitem movieclips are several other movieclips displaying the price, description, etc. along with a combobox so the user can choose a size. For some reason, I am unable to control these comboboxes with actionscript. I know that the path to the merchitem movieclip is correct, as I am able to control all the other movieclips it contains, but not the combobox. I've checked my paths and instance names repeatedly, but cannot seem to control the combobox. I've also tried renaming the combobox instance just in case that might somehow be the problem. Has anyone else experienced this problem? Can anyone offer suggestions?

Thanks
- Michael

V2 ComboBoxes, What The Heck?
I have this glitch in a shopping cart I have made for this website. The cart.swf file (which contains the comboboxes) is loaded into the framework.swf file using a MovieClipLoader.

The Issue: Sometimes, the comboBoxes either don't drop down, or they leave behind the rectBorder after they are clicked, as illustrated in the picture above.

I already found the issue with V2 components requiring this._lockroot = true, and have placed this code in the root of the cart.swf file. Most of the time the comboboxes work just fine (in flash testing environment, firefox, most of the time in ie), but sometimes in IE, this issue occurs. This is very bad, because if someone wants to buy a product and the comboBoxes won't drop down, I could get seriously sued for causing my client to lose customers.

If anyone could please shed any light on this issue, or if there are any other known issues with the V2 components that you know of, I would very much appreciate. Thanks so much!

Dependant Comboboxes ... Can Anyone Help?
We've all been to driver download pages where you select your model from one combobox list and then that choice populates the next combobox of choices and then that combobox choice spawns a link to the driver.

I'm trying to figure out how to do that in flash.

Combobox 1 will display a list of 14 items. Each item in that list has a subset of 3-4 items that will appear in combobox 2 once a selection is made. Then when a selection is made in combobox 2 a link will appear for a download

does anyone know how to do this?

Tooltip With Comboboxes
Hello people,
I hope someone could help me out
I did a Form with different comboboxes listcomponents and so on
and i want to show tooltip if i move over some of them
but if i do i cant get the functionality of the component or textfield back.
I followed Lee´s Tooltip Tutorial.

Another thing is it possible to show litle thumbnails in a tooltip ?

Special Characters In ComboBoxes?
I did a search on this and couldn't find any answers:

I am populating a comboBox dynamically from a list of names in a database, but many of these names have accents, eg:
- Eyoum Nganguè
- García Hernández
- Victor Raùl
These special characters just come in as squares.

I tried adding "System.UseCodePage=true;" which fixes the problem in textboxes, but this doesn't seem to help comboBoxes. I also tried substituting the special characters with both their HTML escape codes (eacute, ugrave, etc) and the HEX values, (&232, &249, etc) but neither of those worked either!?

Can anyone shed any light on this?

Many thanks

Embedding Fonts For ComboBoxes
Hi, I'm trying to embed the font that I'm using for a Combo Box. Is that possible? I tried the embedFonts = true; thing in the actionscript but it didn't work. Any ideas would greatly be appreciated! Thanks!

:: | How Can I Make Flash 5 Comboboxes? | ::
1.) Is it possible to export a pull down menu made in Flash MX or MX 2004 as a Flash Player 5 file? I do not believe it is.

2.) If it is not possible, how can I get the Combobox functionality of a Flash MX 2004 pull down mwnu, in a Flash 5 file?

I need to build a pull down menu in Flash 5 that functions exactly as a html pull down menu does. Is Flash not capable of doing this for Flash 5 files? Here is an example of HTML code that I need to mimic in a Flash 5 file:

<><><><><><><><><><><><><><><><><>
Example:
<><><><><><><><><><><><><><><><><>
<select name="url" size="1">
<option value="http://www.item1url.com">Item 1</option>
<option value="http://www.item2url.com">Item 2</option>
<option value="http://www.item3url.com">Item 3</option>
<option value="http://www.item4url.com">Item 4</option>
<option value="http://www.item5url.com">Item 5</option>
</select>
<><><><><><><><><><><><><><><><><>

Anyone know how to build the above example using Flash, and making it Flash 5 compatible?

ComboBoxes, Arrays And Xpaths
I have done the hard bit of using xpaths to collect the data from the xml doc. The titles populate the combo box, and the rest of the information relating to each title in the combo box is stored in arrays.
And as it looks, if i choose 'Title 1', then there is 3 other arrays with information in that same array position which i want to pull out.

Now what im confused with, is how on selecting a track in the combo box does that selection search through the other arrays to find the information i need to be used as variables for other commands to continue.

For instance:
'Track 1' array 1: on selecting needs to pull out

'Track1.mp3' array 2

and

'ImageSlide1.swf' array 3

etc

I can send the file if anybody can help

cheers

lee

Getting Data Out Of Comboboxes Into A Form
Sorry this is really basic...

I have a simple contact details form in flash which is pointed at a PHP script on my server. I have used a combobox component to establish the age of the user. I have set up the values and the labels in the box all display fine when I test the combobox

I can't seem to work out the code that goes on the the 'submit' button for getting the data out of the combo box and and firing it at the the server.

I have successfully used the a check box component to establish if they want 'more info' using the following code on the 'submit' button

on (release) {
if (checkboxname.selected == true) {
info = "yes";
} else {
info = "no";
}

but can't work out what code to use to get the combobox data. I have tried various versions of this code to try and get the age values to report but to no avail
Can anyone help or point me in the right direction
Thanks a lot
m

Using Comboboxes To Navigate To Different Frames
Hello!

I'm pretty new to Flash and I have a project to work on that I think the easiest way to get working is by using either comboboxes or listboxes to navigate to different scenes. The list will be populated by say, a person's name, and when you select that name on the list it will then go to the frame with that person's infomation. But for the life of me I can't find any helpful tutorial. If anyone can help it would be greatly appreciated.

V2 ComboBoxes Lock Up When Second Is Clicked
I have an appliation with 3 comboboxes in a row, each populated, each working great.

I can click on one, select things, etc. If I ever try to click on the second one, it locks up and I get that there is a script running and I have to abort it.

If I use the old MX components combobox, it works perfectly, making believe there is an issue in the V2 component.

The only code I use in regard to it is:

removeAll()
length
getItemAt()

so nothing really crazy in my actionscript, very basic...

anyone else have this problem, or know of a solution?


thanks

Josh

Populating Comboboxes In Flex
Hi all,

I'm trying to populate a combobox in Flex with an xml repsonse I am getting over httpservice response!

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:comp="components.*" width="460" height="522" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[

import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.http.HTTPService;
import mx.utils.XMLUtil;
import mx.collections.ArrayCollection;

I've created an arraycollection
//Array that holds the version name
[Bindable]
public var versionData:ArrayCollection ;

Have my HttpService method
/*Creates an HttpService object and executes the send method*/
public function useHttpService():void {
var params:Object = new Object() ;
//create an HTTPService object named service
var service:HTTPService = new HTTPService();

//set the properties of the service object
service.url = "http://localhost:9080/oneClickInstall/sample/XMLAppListAction";
service.method="get";
service.addEventListener("result", httpResult);
service.addEventListener("fault", httpFault);
service.resultFormat="e4x";
service.send(params); }


and have the following httpResult function

public function httpResult(event:ResultEvent):void {
versionData = event.result.Version.Release.attributes() as ArrayCollection;
} //end function httpResult

...

I then have a simple button which when pushed should populate a combobox

<mxanel layout="absolute" backgroundColor="#8396a9" borderStyle="solid" left="10" top="10" width="440" height="391" cornerRadius="20" borderThickness="2" borderColor="#ffffff" id="panel1">

<mx:Button x="20" y="10" label="Submit" click="useHttpService()" id="submitBtn"/>

<mx:ComboBox x="165" y="10" dataProvider="{versionData}" id="versionBox" prompt="Please select a version..."/>

</mxanel>
</mx:Application>

This doesn't do anything? I was wondering if anyone would have any idea how I might get this to work or if there's any examples of populating a combobox by adding an xml httpresponse to an arraycollection?

Thanks a mil in advance for any help?

Cheers,
Derm

AutoComplete In ComboBoxes (sort Of)
ok, with 2 combo Boxes on the stage (called funs_cb, a_cb). Assign the document class the name of AutoComplete.


Code:
package
{
import flash.events.MouseEvent;
import fl.events.ComponentEvent;
import flash.events.Event;
import fl.controls.TextInput;
import fl.controls.ComboBox;
import flash.display.MovieClip;
import fl.data.DataProvider;
public class AutoComplete extends MovieClip
{
var currentIndex:Number
var initDP:DataProvider;
var initArray:Array;
var FUNSList:Array = ["A + B", "A - B", "(A + B)/2", "A/2 + B", "A/4 + B/2", "(A + 2*B)/3", "A * B", "-A * B", "A * 10^B", "|A + B|", "|A - B|", "Min(A, B)", "Max(A, B)", "Quantize B to A", "Lowpass(F = A, B)", "Hipass(F = A, B)", "B / (1 - A)", "(A + B)^2", "Sin(A + B)", "Cos(A + B)", "Tri(A + B)", "Warp1(A, B)", "Warp2(A, B)", "Warp3(A, B)", "Warp4(A, B)", "Warp8(A, B)", "A AND B", "A OR B", "B > A", "Ramp(F = A + B)", "Ramp(F = A - B)", "Ramp(F = (A + B)/2)", "Ramp(F = A * B)", "Ramp(F = -A * B)", "Ramp(F = A * 10^B)", "Ramp(F = (A + B)/4)", "A * (B - Y)", "A * (Y + B)", "(A * Y) + B", "(A + 1) * Y + B", "Y + A * (Y + B)", "A * |Y| + B", "Sample B on A", "Sample B on ~A", "Track B while A", "Track B while ~A", "Diode(A - B)", "Diode(A - B + .5)", "Diode(A - B - .5)", "Diode(A - B + .25)", "Diode(A - B - .25)"];
var SRCList:Array = ["A CLOCK","AMPENV","ENV2","ENV3","ASR2","ASR1","FUN4","FUN3","FUN2","FUN1","LFO2","LFO1", "2", "0.2", "-.1", "3", "3.5", "3.67"]

public function AutoComplete()
{
currentIndex = 0;
initDP = new DataProvider();
initArray = new Array();
addListeners();
fill_init_dp(FUNSList, "funs_cb");
fill_init_dp(SRCList, "a_cb");
}
public function addListeners()
{
funs_cb.addEventListener(MouseEvent.MOUSE_DOWN, getCurrentIndex) //when you click
funs_cb.textField.addEventListener(Event.CHANGE, getEntry); //when you type
funs_cb.addEventListener(Event.CHANGE, getChoice) //when you make your choice
funs_cb.editable = true;

a_cb.addEventListener(MouseEvent.MOUSE_DOWN, getCurrentIndex)
a_cb.textField.addEventListener(Event.CHANGE, getEntry);
a_cb.addEventListener(Event.CHANGE, getChoice)
a_cb.editable = true;
}

public function getCurrentIndex(m:MouseEvent)
{
trace (" *****************GetCurrentIndex")
//records selectedIndex when user clicks, and also records current dataProvider of selected ComboBox;
var obj = m.currentTarget;
var i:Number;
var s:String;
var n:String;
currentIndex = obj.selectedIndex;
initDP.removeAll();
initArray = [];
for (i = 0; i < obj.length; i++)
{
s = removeSpaces(obj.getItemAt(i).label);
n = obj.getItemAt(i).label;
initArray.push({norm:n, trunc:s});
initDP.addItem(obj.getItemAt(i));
}
}

public function getEntry(e:Event)
{
//reads user's input, and finds match in initArray.
//shows a dataProvider with only things that match
trace ("
*********************** getEntry()
")
var i:Number;
var t:String = TextInput(e.currentTarget).text;
var cb:ComboBox = ComboBox(e.currentTarget.parent);
var temp:Array = [];
var tempDP:DataProvider = new DataProvider();
t = removeSpaces(t).toUpperCase();

for (i = 0; i < initArray.length; i++)
{
var q:String = initArray[i].trunc.substr(0,t.length).toUpperCase(); //convert every initArray element into an upperCase string, that is equal in length to the user's input
if (t == q)
{
trace ("Found a Match:", initArray[i].norm);
temp.push(initArray[i].norm);
}
}
//create temporary DataProvider for CB
for (i = 0; i < temp.length; i++)
{
tempDP.addItem( { data:temp[i], label:temp[i] } );
}
//show the temporary DataProvider to the user with the filtered choices
cb.dataProvider = tempDP;
cb.rowCount = 17;
cb.invalidate();
cb.open();
}

public function getChoice(e:Event)
{
//finds user's choice in initArray(created when you click on the CB)
//reloads the original dataProvider into the CB, and selects the index where user's choice was found.
trace ("
********************** getMouseChoice
")
if (e.target.selectedIndex != -1)
{
var cb = ComboBox(e.target);
var i:Number;
var j:Number;
var choice:String;
choice = removeSpaces(cb.selectedItem.label).toUpperCase();
for (i = 0; i < initArray.length; i++)
{
var n:String = removeSpaces(initArray[i].norm).toUpperCase();
if (choice == n)
{
cb.removeAll();
for (j = 0; j < initDP.length; j++)
{
cb.addItem(initDP.getItemAt(j));
}
cb.selectedIndex = i;
return;
}
}
}
}
public function fill_init_dp (ar:Array, targ:String)
{
var i:Number;
for (i = 0; i < ar.length; i++)
{
this[targ].addItem( { data:ar[i] , label:ar[i] } );
}
this[targ].selectedIndex = 0;
this[targ].rowCount = 17;
}
public function removeSpaces(n:String):String
{
var i:Number;
for (i = 0; i < n.length; i++)
{
if (n.charAt(i) == " ")
{
n = n.substr(0,i) + n.substr(i+1,n.length)
i = i - 1;
}
}
return n;
}
}
}

ComboBoxes In Loaded Movieclip
Hi all,

i'm sorry if this is a double post but i did search the forums for previous/similar question, so here it is:

i have a movieClip i load into a "main" movieclip that uses 4 comboboxes for a search form.

my problem is that even tho i know the comboboxes are populated when i run the loaded movie clip (the one with the combos) into the main movie the comboboxes don't work, eg. i cant open them.

i have an idea of reading about certain components not working propper inside other moviclips but i'm not sure.

the movie clip with the combos also has a small animation (movieclip)0 on a layer above the one that contains the combos. could this be interfering with the combos?

thnx in advance,
Z

sorry but i just found the answer...
plz delete the post if possible.

cheers,
Z

Email Form Using Comboboxes?
Im looking to score an email form for our website. I need to place about 10 or so comboboxes into it. Once the form is filled out I need it to be able to be emailed to the site admins emails by clicking a submit button. Is there anyone with this knowledge and if so is it possible it could be emailed to me?

Im a newbie so if you could help I could really use a decent script for this or even an fla file 8)

Any help would be appreciated, thanx.

gainer900@gmail.com

Help Needed From Flash Gurus - Comboboxes
Hello

Im using Flash MX and I have a component combobox with three labels and values

VALUE = LABEL
London = London
Sydney = Sydney
New York = New york

Now, when the user selects for example London from the combobox I need a Dynamic text box somewhere on the stage to say "This is in England" Likewise if I selected New York i would want the same box to say "This is in America" etc etc

Geddit?

Now i thought you did it this way;

Call the combo box instance "city"
Create a dynamic text box with instance "country"

and have the actionscript being simply -

if (city.getValue() == "London") {
country.text = "that's England";
}

But it doesnt work - am i way off - and can someone pls help me.

I have to get this working real soon - before I get my bum kicked.

Thanks
Christine!

Dynamically Add 5 Comboboxes, Removing 1 Messes Others Up?
Hi guys, I've tried adding 5 comboboxes with createClassObject and attachmovie, and that works fine but when i do a destoryClassObject or RemoveMovieClip on 1 of the comboxes, the Main Label in all the other comboboxes go blank?

any ideas please.

Three Comboboxes Dont Work With Xmlconnector - Help Please
I am populating two comboxes one with state names and the other with city names from a simple xml file using xmlconnector. If I click on a state name in the first combo box then its corresponding city names populate correctly in the second combobox.

Now I added three buttons on the layer and added the code to change the selectedindex of the first combobox in the button's onclick event. When I click the button the first combobox correctly changes brings up the state name but the second combobox doe not change. i.e. the second combobox populates the cities only on user doing a mouse clicking on the state names. Everywhere in Adobe docs it says 'user change' but not through 'code change'

What is wrong ? Is there a way to get around this ?

the data in a simple xml is

Massachusettes
----Boston
----Needham
----Worster
New York
----Manhattan
----Bronx
----Brooklyn
etc.

Any help very much appreciated.

[F8] Hello There... Simple Problem, I Guess. Comboboxes Code.
Hi there…

I am having a little problem with my comboboxes.
The problem is that since I have more than 1 combobox (lets say combobox_a and combobox_b) and when I try to change or choose items in combobox_b after navigating in combobox_a, mr. combobox_a doesn’t “reset” itself or goes to the first item. Instead, it stays on the last item that I navigated just before I started playing around with combobox_b.

How could I make combobox_a go to the first item or reset irself when I access combobox_b?

Thanks.

Leo.

Flash Form Php To Email Works But Not The Comboboxes
I have a party booking form in flash that once submitted I need the data to go to an email address. The three input boxes work fine in AS and PHP and appear in the email as desired. The combo boxes don't send any data. I've put all the code in below and attached the zip file. Any help much appreciated. Thanks, Eugene.


BOX TYPE INSTANCE NAME VAR NAME SENDS TO EMAIL
inputtext textField1 nameField Yes
inputtext textField2 emailField Yes
inputtext textField3 mobileField Yes



ACTION SCRIPT ON SUBMIT BTN

on (release) {
if (nameField eq "" || emailField eq "" || mobileField eq "" || dateField eq "" || monthField eq "" || yearField eq "" || partyField eq "" || guestsField eq "" tableField eq "") {
errorBox._x= 100;
} else {
loadVariablesNum("party.php", 0, "POST");
gotoAndPlay("thankyou");
}
}



ACTION SCRIPT IN ACTIONS LAYER ABOVE FORM IN TIMELINE

stop();

fieldname = new Array(0, "nameField", "emailField", "subjectField", "messageField", "mobileField");
awop = new Array(0, "nameField?", "emailField?", "subjectField?", "messageField?", "mobileField?");




PARTY.PHP CODE:

<?php

include("global.inc.php");
$errors=0;
$error="The following errors occurred while processing your form input.<ul>";
pt_register('POST','nameField');
pt_register('POST','emailField');
pt_register('POST','subjectField');
pt_register('POST','messageField');
pt_register('POST','mobileField');
pt_register('POST','dateField');
pt_register('POST','monthField');
pt_register('POST','yearField');
pt_register('POST','tableField');
pt_register('POST','tableField');
pt_register('POST','tableField');


if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF) ,"/"));
// Useful if you need today's date:
//$today = Time();
//$Date = date("y-m-d");

$message="
Enquiry Form:

Name: ".$nameField."
Email: ".$emailField."
Mobile: ".$mobileField."
DOB Date: ".$dateField."
DOB Month: ".$monthField."
DOB Year: ".$yearField."
DOB Party: ".$partyField."
DOB Guests: ".$guestsField."
DOB Table: ".$tableField."
";
$message = stripslashes($message);

// Fill in the details below for where you want the email to go to
mail("richbushill@hotmail.com","Website Form Reply ",$message,"From: Bangers contact form");
mail("info@crumblefarm.com","Website Form Reply ",$message,"From: Bangers contact form");

}
?>




GLOBAL.INC.PHP CODE

<?php

function pt_register()
{
$num_args = func_num_args();
$vars = array();

if ($num_args >= 2) {
$method = strtoupper(func_get_arg(0));

if (($method != 'SESSION') && ($method != 'GET') && ($method != 'POST') && ($method != 'SERVER') && ($method != 'COOKIE') && ($method != 'ENV')) {
die('The first argument of pt_register must be one of the following: GET, POST, SESSION, SERVER, COOKIE, or ENV');
}

$varname = "HTTP_{$method}_VARS";
global ${$varname};

for ($i = 1; $i < $num_args; $i++) {
$parameter = func_get_arg($i);

if (isset(${$varname}[$parameter])) {
global $$parameter;
$$parameter = ${$varname}[$parameter];
}

}

} else {
die('You must specify at least two arguments');
}

}

?>

Copyright © 2005-08 www.BigResource.com, All rights reserved