A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: Check Box & Forms

  1. #1
    Thick as a Brick bobgodwin's Avatar
    Join Date
    Sep 2003
    Location
    Metro Detroit
    Posts
    217

    Check Box & Forms

    How does one go about using a check box as a form variable? I'd need to make a form for my band site where you can use four check boxes to pick which CD & where (USA or Overseas) it's going to be sent. Not sure what to do though. It will also have a text box for their email.
    Bob Godwin

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Quote Originally Posted by bobgodwin
    How does one go about using a check box as a form variable? I'd need to make a form for my band site where you can use four check boxes to pick which CD & where (USA or Overseas) it's going to be sent. Not sure what to do though. It will also have a text box for their email.
    Sorry for the slow response, I didn't see this post.

    I need to know a few things about the checkboxes before this can be done so I will use some general values.

    Place the checkboxes where you want them, delete the label and put whatever text you want on stage to signify their value. (OR you could use the label but I generally don't. The fonts look better if you just place it on stage and a text object)

    Open the Properties menu for the checkbox and go to it's onChange option.

    In that actionscript window place this code. Do this for each of the check boxes.
    (I use php tags on the forum to add syntax highlighting)

    If you want the value of the checkbox assigned to a variable:
    PHP Code:
    if (this.getValue() == true){
        
    product "item name" // use your item's name here.
       
    }
    else {
        
    product ""// Clears the variable if unchecked.

    If you want the value of the checkbox assigned to a dynamic textfield:
    PHP Code:
    if (this.getValue() == true){
         
    product.text "Item Name"// use your item's name here.
        
    }
    else {
        
    product.text ""// Clears the textbox if item unchecked. 
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Did this work for you?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  4. #4
    Thick as a Brick bobgodwin's Avatar
    Join Date
    Sep 2003
    Location
    Metro Detroit
    Posts
    217
    Sorry for the late response. I just got to it a couple of days ago, and yes it does work. But only in Flash 6, and my site is built in Flash 8 (The boxes won't check in 7 or 8). I'm not sure if this is a script thing, or a bug of some kind (I built it with the new beta). I sent Bob an email with the file and .php, an was waiting to hear back. Again sorry for not getting back with you sooner and a big thanks for your reply.
    Bob Godwin

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Post your file and I'll take a look at it. Or you can email it [email protected]

    Don't forget to remove the nospam part before trying to eMail.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  6. #6
    Thick as a Brick bobgodwin's Avatar
    Join Date
    Sep 2003
    Location
    Metro Detroit
    Posts
    217
    Here are the files I have.
    Last edited by bobgodwin; 02-26-2008 at 06:28 PM.
    Bob Godwin

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    All fixed Bob...Check your PM for the files.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  8. #8
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Are we still having problems or did we fix them?
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  9. #9
    Thick as a Brick bobgodwin's Avatar
    Join Date
    Sep 2003
    Location
    Metro Detroit
    Posts
    217
    Fixed. Just sent you a PM. The files are in beta. Should I post them anyway?
    Bob Godwin

  10. #10
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    No need.
    I think you can mark this tread RESOLVED. (Under thread tools)

    Glad to help.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  11. #11
    Junior Member
    Join Date
    May 2007
    Posts
    3
    I surely would have liked to have seen the code for this solution! I am having the same problem in Flash 8. Am trying to create a checkbox for a contact form that calls a PHP file. But my checkbox won't check. I must need to enable it somehow, but have been searching.

    Here's the code I have in frame 1:

    myCheckBoxListener = new Object();
    myCheckBoxListener.click = function(evt) {
    form.myCheckBox = "yes";
    }
    myCheckBox.addEventListener("click",myCheckBoxList ener);


    on the submit button that goes with the checkbox, I have:

    on (release) {
    form.loadVariables("email.php", "POST");
    }

    Any help would be appreciated. Thanks so much.

  12. #12
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    You didn't read this thread did you? The answer to your question is the 2nd post.
    http://board.flashkit.com/board/show...65&postcount=2

    You're making it more complicated than it needs to be.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  13. #13
    Junior Member
    Join Date
    May 2007
    Posts
    3
    Yes. I did read it. That's the really, really sad part.

    Open the Properties menu for the checkbox and go to it's onChange option.
    When I do this in Flash 8, I do not see an onChange option anywhere. Not in the parameters part of the properties inspector, or the component inspector or anywhere else. There's what looks like a text box under labe, labelPlacement and selected in the properties inspector, but i cannot click inside of it.

    I am customizing a template that a client purchased that will only allow me to publish in FLashplayer 6. If I try to publish higher, the page slider won't work. And I've spent way too much time on this project already. Do you think there could be a compatibility issue? Or am I just that stupid.

    Can I manually build a checkbox and not use the component?

    Thanks.

  14. #14
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Quote Originally Posted by verbatim
    Yes. I did read it. That's the really, really sad part.

    When I do this in Flash 8, I do not see an onChange option anywhere. Not in the parameters part of the properties inspector, or the component inspector or anywhere else. There's what looks like a text box under labe, labelPlacement and selected in the properties inspector, but i cannot click inside of it.

    I am customizing a template that a client purchased that will only allow me to publish in FLashplayer 6. If I try to publish higher, the page slider won't work. And I've spent way too much time on this project already. Do you think there could be a compatibility issue? Or am I just that stupid.

    Can I manually build a checkbox and not use the component?

    Thanks.
    Wait...are you using Koolmoves or Flash? If you're using flash, you're in the wrong forum. If you're using Koolmoves then the on Changed option is right here in the component's options dialog


    If you make a copy of the template available maybe we will be able to see your issue a little better. Though it sounds like you're in the wrong forum. This is a Koolmoves support forum.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

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

  15. #15
    Junior Member
    Join Date
    May 2007
    Posts
    3
    I am most definitely in the wrong forum. Thanks for your time, though. I don't know what Koolmoves is, so I blew right by that in the breadcrumbs. Sorry.

    ugh. The search continues. Thanks again.

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