Simple combo box question

I have Flash MX 2004 Pro. I want to create a
movie/graphic/button ( not sure which one yet) of a county
(obviously from a state map) and I want to have all of the counties
(over 40) listed in a Combo Box. I would like the Combo box to
automatically be updated/populated every time I create a
movie/graphic/button of a county. I would like to be able to click
on a county name in the combo box and have the county highlighted.
While the graphic part is doable, I am asking for help with the
scripts.
One more thing: I have a text box that I want to have data
displayed only for the specific county. So I am thinking of
creating a text box that is invisible in the State swf but will be
viewable when the county is selected (mouse over or thru the combo
box). Do I have to use the scripts to make it viewable when the
movie is selected?
Is this even possible with my version of Flash and if so,
does anyone have some codes I can look at?
Thanks.

As far as the text goes, there are several ways to do that.
Simplest way is to make the text visible when rolled over and
invisible when rolled out. That way you get the text positioned and
formated the way you want. It isn't the best method in terms of
maintenance. A better method is have one text clip that you can
position in relation to the (x,y) coordinates of the highlighted
county and pull the text for the county from an array. The latter
requires more script but is easier to go back and change since all
you do is update an array.
I just noticed a line in the onRollOut
this[this._parent._name + "menu"].selectedIndex = 0;
that will serve you no purpose whatsoever. I missed deleting
that from the script I modified to post to you. It doesn't hurt
anything since it targets nothing you have

Similar Messages

  • HTML Combo Box Question

    I generate an HTML page with a Servlet and I have a combo box that lists numbers 1-20. Depending on a parameter that is passed to the servlet I want to set the Combo box to be initalized to (display) a certain number.
    Does anybody know how I can do that? (I would prefer to have the Combo Box entries remain in order)
    Thanks,
    Andrew

    You can always put something in there like
    int foo = Integer.parseInt(request.getParameter("foo"));
    for(int i=1; i <= 20; i++)
      out.println("<option value=\""+i+"\" "+(foo==i)?"SELECTED":"" +" >"+i+"</OPTION>");
    }

  • JSP Combo box question

    How can I make a combo box have the ability to add new items in its list? I have an existing combo box that gets its value from an SQL query. How can I let users have the ability to add to that list? If this is not possible with JSP combo boxes, any suggestions as to what field I may use? Thanks

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Combo Box question on JSP

    I have two combo boxes. Box 2 is populated dependant on the value of box 1.
    The data wil be coming out of a JavaBean with a connection to a database.
    What would be the best way to acheive this?
    TIA
    Owen Thomas

    Hello Russ9754!
    Might be abit late, but I just read this thread.
    Anyway...I think I have what you are looking for.
    This code creates a dropdown box with the alternatives of your choice. If none of the options is good enough for the user, he/she can choose "other" and enter a more suitable choice in a pop-up javascriptprompt.
    <FORM NAME="formName">
    <SELECT NAME="country" onChange="countryOnChange();">
    <OPTION VALUE="Albania" selected>- = Albania = -</OPTION>
    <OPTION VALUE="Finland">- = Finland = -</OPTION>
    <OPTION VALUE="USA">- = USA = -</OPTION>
    <OPTION VALUE="Other"> Other... </
    OPTION>
    </SELECT>
    </FORM>
    <SCRIPT>
    function countryOnChange(){
    sel = document.formName.country.selectedIndex;
    val = document.formName.country.options[sel].
    value;
    len = document.formName.country.length;
    if (val == "Other"){
    var newcountry = prompt("Enter your country.", "");
    if (newcountry == null) { return; }
    document.formName.country.options[sel].text = newcountry;
    document.formName.country.options[sel].value = newcountry;
    document.formName.country.length = len +1;
    document.formName.country.options[len].text = "Other...";
    document.formName.country.options[len].value = "Other";
    </SCRIPT>

  • Combo box question

    Hi! I'm new to Adobe Acrobat pro, so forgive me if I ask dumm questions!
    So I wanted to make a form with multiple comboboxes which are referring to each other, so that if you choose something from the first one, you can only choose from the subtypes of the chosen type......
    Is it even possible?
    I attached an exaple in Openoffice. It works  with the database fields and hlookup function, but it would be the best to have it in pdf......
    Thanks in advance

    It's possible in Acrobat as well, but you will need to have some custom
    scripts to do it.

  • Combo box question - can a store extra values?

    my data is
    car# id
    CAR1 111111
    CAR2 222222
    CAR5 555555
    i want to be able to select CAR1 in the combo and
    retrieve the id field.
    what is the best way to do this? in foxpro one can
    have hidden fields and some ocxs of cargo objects.
    thanks for any help
    owen brandon

    Hi,
    I haven't used JComboBox for a while but I think you just need to make a class with an id (eg. 11111) and a name (eg. CAR1), and specify a toString method that returns the name. I fyou catch the object you then can cast it and call its getID() method.
    Greets
    Puce

  • Combo box , error type !

    Hello,
    I've got an error I can't find since 2 days ! I'm trying to build a simple combo box in which there are some data from my database . It's to deploy a process under jBoss jBPM but the error is a JSF one :
    Here is my JSF form code :
        <jbpm:datacell>
          <f:facet name="header">
            <h:outputText value="Produit desire: "/>
          </f:facet>
           <h:selectOneMenu value="#{genList.value}">
                <f:selectItems value="#{genList.items}" />
           </h:selectOneMenu>
        </jbpm:datacell>Then, here is my genList.java :
    public class genList {
         private String value="";
         private Connection conn;
         public genList() {}
         public String getValue() {
              return value;
         public void setValue(String value) {
              this.value = value;
         public Collection getItems() {
              Collection items = new ArrayList();
              SelectItem si = null;
              try{
                   //-- Connexion
                  Class.forName("com.mysql.jdbc.Driver");
                  conn = DriverManager.getConnection ("jdbc:mysql://localhost:3306/databaseName", "root", " ");
                  //-- Creation du statement et de la requete
                  Statement stmt = conn.createStatement();
                  String requete = null;
                  requete = "SELECT ID_,NOM_ FROM materiel";
                  //-- Execution de la requete
                  ResultSet rs = stmt.executeQuery(requete);
                  //-- Lecture des donnees
                  while (rs.next())
                       si = new SelectItem (String.valueOf(rs.getInt(1)), rs.getString(2));
                       items.add(si);
                  //-- Deconnexion
                  conn.close();
              } catch(Exception e){
                  System.out.println("\n\n\nCONNEXION ECHOUEE: "+e+"\n\n\n");
                  System.exit(-1); 
              return items;
    }Here is my Face config :
    <managed-bean>
          <managed-bean-name>genList</managed-bean-name>
          <managed-bean-class>com.demande.action.genList</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>Finally here is the error returned :
    Argument Error: An option for component j_id48 was not an instance of javax.faces.model.SelectItem. Type found: java.util.ArrayList.
    (j_id48 is the name given automatically to the combo box)
    I tried a lot of things to repair that error, but nothing works... I can't see where is the problem, if you could help me.
    Thanks,
    Richard T.

    I'm sorry i accidentaly put my topic on the watchlist... I don't know what it is, but I don't know how to correct it ...

  • How do i create a combo-box?

    Dear guys..how do i create a simple combo-box that get populated with data fron the database at run-time? I can create pop-lists , but that is hardcoded and no good to me.
    Kind Regards

    cheers folks..most helpful :)
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    Hi, Satnam Bihal
    I think this code will solve your problem.
    DECLARE
    rgid RECORDGROUP ;
    err NUMBER ;
    BEGIN
    :main.dynamic_list := '' ;
    :main.list_value := '' ;
    IF :main.sql_text IS NOT NULL THEN
    CLEAR_LIST('main.dynamic_list') ;
    rgid := CREATE_GROUP_FROM_QUERY('rg', :main.sql_text) ;
    err := POPULATE_GROUP(rgid) ;
    POPULATE_LIST('dynamic_list', rgid) ;
    DELETE_GROUP(rgid) ;
    END IF ;
    END ;<HR></BLOCKQUOTE>
    null

  • Combo box browser issue

    Hi I currently have a simple combo box compenent with three options to choose fonts. It works fine when i test it, but it doesnt drop down in the browser.
    This is the code
    [AS]
    LBtextMenu.LBfontList.textField.setStyle("textFormat", tf);
    LBtextMenu.LBfontList.dropdown.setRendererStyle("textFormat", tf);
    LBtextMenu.LBfontList.addItem( {label: "Arial" } );
    LBtextMenu.LBfontList.addItem( {label: "Calibri" } );
    LBtextMenu.LBfontList.addItem( {label: "Bauhaus 93" } );
    var LBnewFormat:TextFormat = new TextFormat();
        LBnewFormat.font = "Arial";
        LBnewFormat.size = 12;
    var LBnewFormat01:TextFormat = new TextFormat();
        LBnewFormat01.font = "Bauhaus 93";
        LBnewFormat01.size = 12;
    var LBnewFormat02:TextFormat = new TextFormat();
        LBnewFormat02.font = "Calibri";
        LBnewFormat02.size = 12;
    LBtextMenu.LBfontList.addEventListener(Event.CHANGE, LBfontSelect);
    function LBfontSelect(event:Event){
              if (event.target.selectedIndex == 0){
                        trace("Arial was chosen")
                        LBTxt.LBOutput.setTextFormat(LBnewFormat)
              }  if (event.target.selectedIndex == 1) {
                        trace("Calibri1 was chosen")
                        LBTxt.LBOutput.setTextFormat(LBnewFormat02);
              if (event.target.selectedIndex == 2) {
                        trace("Bauhaus was chosen")
                        LBTxt.LBOutput.setTextFormat(LBnewFormat01);
    [/AS]
    If anyone can help it is greatly appreciated, Thanks.

    use the swf embedding code published by flash.
    if you already are using that html, what's your url and what needs to be done to see the problem, if it's not obvious.

  • A simple question about combo box

    Dear All,
    Just got a simple question about combo box: I have one of these selectors with labels based on filtered rows from a table.
    Is it possible to have one more label that would select all options?
    Like:
    Product A
    Product B
    Product C
    All Product
    Many thanks for your help!
    Gilles

    Hi Gilles,
    The purpose of ComboBox itself to select single option out of many.
    For your purpose, you may have to use "List Builder" which can accomodate 1 or more  to select.
    Please revert for more clarification if you need.
    With best wishes
    BaaRaa.

  • Simple date selector based on three combo boxes

    Hi all,
    I am looking for a simple script to allow users to choose a valid date. However, it should only be based on combo boxes (I just need the basics really).
    Similar to: http://www.easyjet.co.uk/en/book/index.asp
    But without the visual calendar bit and with a separate combo box for choosing the year. I had a look at jcalendar and various other scripts, but they are way too advanced for my application
    Does anybody know how to accomplish this?
    Thanks in advance.

    we have Hboxes i.e. A,B,C etc and each containing many boxes and that boxes contain the labels
    for 'A' HBox I have many boxes inside 'A' may be 20 and these boxes contains the label for each box A1,A2,....A20
    some of them may be highlighted with red color based on the values coming from database for respectivg HBoxes A,B,C etc
    Now I want to select a value from combo box if it is 7 I have only 3 positions to select in 'A' which didn't highlighted
    and these three are in contiguous so when i click on any one of them the remaing possible number of values to be highlighted either they are left or right to the selected box and then i have 4 in my hand to select I need to have the chance to select them from any 4 from any remaining boxes from B,C etc
    and if tere are 7 contiguous boxes to select and my selected value is 3 only three needs to be selected when i click on any one box

  • Question about using the Combo Box feature!

    I have a form that I am trying to create for our company that will allow our field nurses to select what they need and print it more effieciently.  The problem is that some of the selections are too long and I can't get the Combo box feature to allow them to be printed on multiple lines:
    I have spoken to my supervisor about redoing the form to look like this:
    But in order for us to meet state guidelines it has to be formated like the first because that is the state form given to us.  I want to be able to either:
    A) have the combo box multi-line auto text sized so it will get all the information into each box
    OR
    B) create text boxes at the end of the form that auto enteries the selected data from the second picture into boxes that look like the first picture.
    Is there any way to do either of these?

    A) No.
    B) Yes. Create a text box with the following code as the custom calculation
    script (assuming the name of the combo is "Combo Box1"):
    event.value = this.getField("Combo Box1").value;
    That way, when the user makes a selection in the combo-box, the value will
    also appear in the text box. Just make sure to make the text box read-only
    and set the combo-box to apply the selection immediately.

  • Question abt. combo box and database

    Hi. I have two combo boxes, A and B. Items in A is obtained from table X, Items in B is obtained from table Y. But, the problem is that whatever appears in combo box B should not contain those in combo box A. How do i go about doing this? Note that values in table X come from values in table Y.Here's an example:
    (this is I currently have)
    Combo X             Combo Y
    Apple            Mango
    Orange           Kiwi Fruit
    Pineapple        Apple
    Kiwi Fruit        
    Mango          (this is I WANT)
    Combo X                  Combo Y
    Orange                  Mango
    Pineapple               Kiwi Fruit
                            ApplePlease help and thanks in advance.

    hi....
    First of all, I've designed the two combo boxes with Add/Delete buttons in the GUI. I'm using JSP to retrieve values from database table into my combo boxes.
    Actually, I have the two combo boxes already. I have already got the items inserted into combo A from table X using JSP. I am thinking of getting all the values in combo box B from the table Y first, then maybe store them in an array or something, b4 comparing those values with that from combo box A, eliminate those existing in combo box A, and the rest will be stored in combo B.
    I do not know exactly how to store values i obtained from table to an array and how to compare arrays.
    hope u understand what i'm trying to say, please help if possible, thanks.

  • Question on Combo Box

    I have a form with Master (Single Record ) and Detail ( Multi Record ) blocks. There is a Combo Box in Header block. When I select a value from Combo box ( When list changed ) detail block records are to re queried. Similarly when I enter some value manulally and by pressing tab/enter key ( Key Next Item) , the detail records are to re queried.
    While entering a value with Key board, the trigger When-List-Changed trigger is firing for each letter I'm typing. Is there any work around solution for this?

    Quote:I think it will be nice to close the editor if we click again on the down arrow or the cell without selecting any item in the combobox, so that users can see original cell view
    Your opinion collides with the opinion of other users that say they want to keep the combobox active to see what is underneath the open dropdown to open it again.
    Adding your code to the iconCanvas in NatCombo breaks the behavior on clicking the down arrow. At least in my workspace. I don't know of which version we are talking about and which codebase you have. But hideDropDownControl() does not close the editor, it only hides the dropdown. This can't be the solution.
    What you need is to override mouseDown() to close the editor instead of hiding it.
    BTW, with this change you remove the ability to move the focus to the text control to allow editing.

  • How can I code a lookup table from a combo box

    Hi, I am trying to use combo boxes on a front page which selects a desired gas.  I then want this to look up a simple 2D table which returns the associated K factor value to be used.  Essentially I need to gain the conversion factor for a selected gas to be used in the block diagram to adjust the outputs and inputs accordingly.  I tried to load an excel file into an array and then extract the desired numeric value but failed. Any help would be great.  I don’t want to be manually inputting the values in the block diagram because there are lots of them so it must be read in from a file of some sort.
    Regards

    Hello Sniepsy,
    You posted this question in the FieldPoint forum, but the
    question appears to have nothing to do with that hardware product.  I can’t deduce from your post what
    programming platform you are using, but I assume that it’s LabVIEW.  If so, you might consider reposting your
    question to the LabVIEW forum.
    I’ll broadly address your question though.  If the number of possible input factors is
    small (say in the order of less than 50), the easiest thing to do is just
    generate 2 1D arrays with one for keys, and one for values.  Make sure the indices match up and just look
    up the index of a key in array 1, and index array 2 with that to get your
    number.  A purist might complain that the
    lookup time would be linear, and we can achieve log-time with sorted lists and
    advanced structures – but since these aren’t in LabVIEW the overhead of
    implementing them might outweigh the benefit.
    Hope this helps! 
    Please let us know if you have further questions.
    Travis M
    LabVIEW R&D
    National Instruments

Maybe you are looking for