A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: FComboBox madness

  1. #1
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100

    FComboBox madness

    Try this, drag a FComboBox component on to the main stage in Flash MX.

    Name it "Box" or whatever, by selecting it and then typing "Box" in the properties panel.

    Then click on frame one and add this script to the actions panel....

    box.addItem("Jan",01);
    box.addItem("Feb",02);

    Works a charm, then try adding....

    box.addItem("Aug",08);

    .....it outputs a syntax error.

    box.addItem("Aug",8);
    box.addItem("Aug",18);
    box.addItem("Aug",01);

    ....all work, for some reason 08, and 09 aren't acceptable data types, which is a damn shame cos I planning on throwing those variables into a database.

    Anyone have any idea what's going wrong??

  2. #2
    Member
    Join Date
    Aug 2003
    Posts
    37
    Looks like it's not specific to combo boxes. Same thing with this code:

    Code:
    myArray = new Array(  );
    myArray[0] = 01 ;
    myArray[1] = 02 ;
    myArray[2] = 03 ;
    myArray[3] = 08 ;
    myArray[4] = 09 ;
    myArray[5] = 8 ;
    myArray[6] = 9 ;


    Just curious, why the leading zeros? Do the values need to behave as numbers or as strings?

  3. #3
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100
    I'm intending to throw the details into a "date" column in a Mysql database, which I believe needs "20040101" type format (New Years Day 2004).

    I solved the problem by inserting the data type in the properties panel, as it goes, but I'm still curious, it's as if "08" and "09" are reserved characters.

  4. #4
    Member
    Join Date
    Aug 2003
    Posts
    37
    Originally posted by skalie
    I'm intending to throw the details into a "date" column in a Mysql database, which I believe needs "20040101" type format (New Years Day 2004).
    If "20040101" is a string, maybe you could use "01", "08" and "09", etc. as string values, that seemed to work fine. If you need to do it with ActionScript, that is.


    I solved the problem by inserting the data type in the properties panel...
    Do you mean that you just entered the values in manually in the properties panel?

    It seems pretty strange, for sure.
    Last edited by pauline m; 08-13-2003 at 09:47 AM.

  5. #5
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100
    Originally posted by pauline m
    Do you mean that you just entered the values in manually in the properties panel?
    Yep

  6. #6
    Member
    Join Date
    Aug 2003
    Posts
    37
    Interesting. Just tried that, entering 01, 02, 08, 09 (no quotes). The getSelectedItem.data returned 1, 2, 8, and 9, and the data type is shown as number. So somewhere in there flash is recognizing those as numbers, but then stripping away the leading zero.

    If you enter them with quotes, like "09", you get 09 back with getSelectedItem.data, with data type string - no surprise there.



    Strano.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center