Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 3.00 average. Display Modes
Old 05-16-2007, 05:07 PM   #1
kade119
Senior Member
 
Join Date: Dec 2006
Posts: 203
Default creating checkboxes in a flash form?

is this possible to creat checkboxes like u do in html, but in flash?

can someone explain how?
kade119 is offline   Reply With Quote
Old 05-16-2007, 06:24 PM   #2
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

make a small white box with a black outline. Turn it into a movieClip and then go into it. Add a second frame that has the white box with the black outline but on the second frame place an X inside the box. Then navigate to the root of the FLA and give the box an instance name of checkbox0. Then in the AS frame put this:

Code:
var myCheckBoxVar:String = "no selection";
checkbox0.onRelease = function():Void{
\\ make the checkbox0 MC go to the X frame     
this.gotoAndStop(2);
\\ set some variable to indicate that this checkbox was clicked
myCheckBoxVar = "checkbox0";
}
That is how I would do it. Dvl
dvlnblk is offline   Reply With Quote
Old 05-16-2007, 07:58 PM   #3
kade119
Senior Member
 
Join Date: Dec 2006
Posts: 203
Default creating checkboxes for a form

how do you go about doing this in flash? so that the checkboxes submit information to the e-mail, along w/ the rest of the data that is transferred?

is there a way to create this in flash? the checkboxes
kade119 is offline   Reply With Quote
Old 05-16-2007, 08:43 PM   #4
jenjenut233
Registered User
 
Join Date: May 2007
Posts: 4
Default

Yes, it is built-in to Flash. Open the Components panel from the Window menu. Expand the UI Components section. Scroll down until you see Checkbox. Drag the Checkbox component onto the stage. You can drag a hundred of them if you want. Then you'll need to set up each checkbox's properties.

Select a checkbox on the stage. Then open the Property panel (if it's not already open at the bottom) and where it says <instance name>, give this checkbox a name. Something like cbAnswerA. Do this for each, so you might end up with cbAnswerA, cbAnswerB, cbAnswerC, and cbAnswerD.

Then for each of them, click on the Parameters tab in the Property panel. The label is the text next to the checkbox, so in my example, cbAnswerA would have a label A, cbAnswerB would have a label B, and so on. Label placement is whether or not you want the label to the left or right of the checkbox and selected means whether or not you already want a checkbox to be selected before anyone chooses anything.
jenjenut233 is offline   Reply With Quote
Old 05-25-2007, 11:30 PM   #5
kade119
Senior Member
 
Join Date: Dec 2006
Posts: 203
Default

thanks guys, got that down now

but now .. im using php on my contact form.. do u guys know the php to retrieve the selection they made on the checkbox?
kade119 is offline   Reply With Quote
Old 05-28-2007, 04:00 AM   #6
LOLFlash
Senior Member
 
Join Date: May 2007
Location: Toronto,Canada
Posts: 530
Default CheckBox

put all your chechBoxs in move named: menuMc
call function in Submit button

function sendSubmit(){
var myVars:String;
for(i in menuMc){
if(menuMc[i].selected) myVars+= i+"="+menuMc[i].label+"&";
}
var sendVars:LoadVars= new LoadVars();
sendVars.load("http://www.yourwebsite.com/checkSelected.php?"+myVars);
}

Last edited by LOLFlash; 05-30-2007 at 03:46 AM.
LOLFlash is offline   Reply With Quote
Old 06-06-2007, 01:33 AM   #7
kade119
Senior Member
 
Join Date: Dec 2006
Posts: 203
Default

so that retrieves the information and sends it w/ the contact form?
kade119 is offline   Reply With Quote
Old 06-07-2007, 03:07 AM   #8
LOLFlash
Senior Member
 
Join Date: May 2007
Location: Toronto,Canada
Posts: 530
Default lol

kade

take a look in forum <-> search for "php loadvars" you can find hundreds ready to go examples haw to send and retrieve data to-from php
on your computer in examples folder you have macromedia example of login form

I gave just one way in case you dont know haw many check boxes on screen If you work with XML feed and boxes created on a fly and server need to save data of user choise

There is not much description you'r giving what you want

Please attach file of your application

Last edited by LOLFlash; 06-07-2007 at 03:10 AM.
LOLFlash is offline   Reply With Quote
Old 06-07-2007, 06:00 AM   #9
kade119
Senior Member
 
Join Date: Dec 2006
Posts: 203
Default

PHP Code:
 
  

ahhh ... hate when things dont work, so heres what i got, sorry i didnt specify, i got the checkbox created and working to get the response sent to my e-mail... but the whole form doesn't seem to be responding.. so what ya got on this ?

thanks


<?php

if ($_SERVER['REQUEST_METHOD'] == "POST") {




$msg "$name\n\n";
$msg .= "$message\n\n";
$signs_check $_POST['signs_check']
$phone_check $_POST['phone_check']
$mail_check $_POST['mail_check']
$canvasing_check $_POST['canvasing_check']
$donation_check $_POST['donation_check']
$yardsign_check $_POST['yardsign_check']
$host_check $_POST['host_check']
   
$name $_POST['name'];
$company $_POST['company'];
$phone $_POST['phone'];
$email $_POST['email'];
$comment $_POST['comment'];

$to'[email protected]';
$subject "Website Contact";
$msg .= "Name: $name\n\n";
$msg .= "Company: $company\n\n";
$msg .= "Phone: $phone\n\n";
$msg .= "Email: $email\n\n"
[CODE][/CODE]
$msg .= "Comment: $comment\n\n";
$headers .= "From: $name <$email>";
mail($to$subject$msg);
?>

Code:
on (release) {
var nLv:LoadVars = new LoadVars();
nLv.name = name.text;
nLv.company = phone.text;
nLv.phone = email.text;
nLv.email = hear.text;
nLv.comment = comments.text;
nLv.signs_check = signs_check.selected;
nLv.phone_check = phone_check.selected;
nLv.mail_check = mail_check.selected;
nLv.canvasing_check = canvasing_check.selected;
nLv.donation_check = donation_check.selected;
nLv.yardsign_check = yardsign_check.selected;
nLv.host_check = host_check.selected;
nLv.sendAndLoad("form.php",nLv,"POST");
gotoAndPlay (2);

}
kade119 is offline   Reply With Quote
Old 06-07-2007, 02:04 PM   #10
LOLFlash
Senior Member
 
Join Date: May 2007
Location: Toronto,Canada
Posts: 530
Default send_loadVars

Quote:
Originally Posted by Paul Ferrie View Post
LoadVariablesNum is outdated.

You have a lot more control over the variables your sending and receiving with the php script using sendAndLoad()

Using LoadVariablesNum means
"loadVariablesNum("verzenden.php", 0, "POST");"
Any variables on level 0 will be sent to the php script regardless of wether you need them to be sent or not.
With sendAndLoad you can specifcally declare what variables should be sent.

Here a typical contact form script i use.
ActionScript Code:
butSubmit.onRelease = function() {     //You could do some checking of the forms here to make sure the relevent fields     //are filled     submitContact(); }; function submitContact() {     //define object to hold result     result_lv = new LoadVars();     //Define object to hold vars     cc_lv = new LoadVars();     //Attach vars to object     cc_lv.me_name = txName.text;     cc_lv.me_subject = txSubject.text;     cc_lv.to_email = mcToEmail.txEmail.text;     cc_lv.me_email = txUemail.text;     cc_lv.me_msg = txMessage.text;     //Send vars to script     cc_lv.sendAndLoad(path2php + "contact.php", result_lv, "POST");     result_lv.onLoad = function(success) {         if (success) {             //on the last line of the php script put             //  echo "&retval=1&";             if (result_lv.retval.length > 0) {                 gotoAndStop(8);             } else {                 //incase of error trace what has been sent back                 trace("ERROR:" + newline + unescape(result_lv));             }         }     }; }
This for of using sendAndLoad() i use to handle all my flash php request's

Hope it helps

continue..
LOLFlash is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an email form in Flash FlashNewbee ActionScript 2.0 0 01-13-2007 07:37 AM
Flash Mail Form unusual problem Cemondra Server-Side Scripting 3 12-21-2005 04:52 AM
[AS2] help in Flash X1Commander Gaming and Game Development 1 11-26-2005 10:34 PM
[Q] Do we need those forums??? CyanBlue General Chat 59 07-27-2004 11:13 AM
Another Flash Form Question????? protean ActionScript 2.0 2 05-30-2004 06:25 PM


All times are GMT. The time now is 04:37 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.