A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Assign a variable

  1. #21
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Not at all. Just didn't want to confuse any more than I have.

    File is posted. I'm in kiosk mode for a couple of hours to run some tests but the satellites should allow users in fine.

  2. #22
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Chris,
    I put this code into the frame with my combobox but the combobox is empty when it loads.
    code:
    var gender = gender.text;

    items = new Array();
    items.push({label:'Choose Male',value:'Male'});
    items.push({label:'Choose Female',value:'Female'});


    combo.setItems(items,false,new TextFormat('Arial',12));

    combo.onChange = function(v){
    _root.gender.text=this.getValue();
    //right here you can do anything with the value instead of above
    };

    //now when you submit your form...the value of gender.text will be the "gender" variable

    stop();

    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  3. #23

  4. #24
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Ok, I must be doing something wrong...I can't for the life of me get it to work. I've tried and tried but it doesn't populate my combo box.

    Here is the link to the fun file (+ the dependent files)
    http://www.nsfilms.com/km/dniezby_webform.zip

    If you have time, can you look at it? If you don't, don't sweat it...I'm sure I'll finally figure it out. That's part of the reason I love doing this stuff...Figuring out why programs don't work.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  5. #25
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Since the timeline is short, I placed the combobox onstage at frame 1 and made it invisible so it can receive the array. When it gets called in frame 5 we make it visible and on frame 6 invisible again for when they advance past frame 5.

    You will have to set the combo colors again. Sorry...I needed to place a new one.

  6. #26
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Are comboboxes always this much of a pain?
    I mean, I see a lot of people use them...

    I'll download it now and check it out. See what the heck I was doing wrong.

    Thanks a lot for the lessons.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  7. #27
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    just had a look at it...That's IT !?
    That's ALL I was doing wrong?

    Man, that is frustrating. I was up researching the code all night and kept finding that I was pretty much on the money...I still don't understand why it didn't work the other way but...what the heck...it works now...

    Thanks a million.

    So, I'm guessing I should use this technique everytime I use a combobox?

    BTW, any idea why it doesn't seem to work if I use the + button to add the combobox items?...Or can I? Hmm...
    Last edited by dniezby; 01-06-2006 at 10:35 PM.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  8. #28
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    You should just enter them in the GUI. I usually code it that way out of habit because I usually populate them from php data and I like to use the scripted styling. The styling demos in the examples folders all build them this way too. It's just a preference.

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