# How can I retrive Checkbox Values from a Text File..?

**URL:** <https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386>\
**Category:** Uncategorized\
**Created:** [March 13, 2003, 5:31pm UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386 "2003-03-13T17:31:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lastdon](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lastdon](https://forum.kirupa.com/u/lastdon)\
**Post date:** [March 13, 2003, 5:31pm UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/1 "2003-03-13T17:31:48Z")

</div>

Hello,

basically my titles says it  
i have values on my form that is in check boxes and radio buttons  
my check box is

checkboxu  
andmy  
radio button is

rG1

how can i retrieve this info back into flash?

i have done loadvariables,

but only the input text shows up

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 8:03am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/2 "2003-03-14T08:03:38Z")

</div>

any suggestions??☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 8:07am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/3 "2003-03-14T08:07:45Z")

</div>

Howdy…

FCheckBox.setValue and FRadioButton.setValue looks like the one you are looking for… You will have to implement lots of if statements depending on how many check boxes and radio buttons you have on the stage…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 8:30am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/4 "2003-03-14T08:30:30Z")

</div>

:stunned:

Ok this is what i did

when I send the values through EMAIL and OR ASP page that i am using it works fine, I get all the values fine,  
and everything i selected worked great

but

now what i did  
I wrote down some stuff in a text file…  
as follows::  
&traffic=Hello&checkboxu=DriveThru&rG1=Yes  
the world Hello came up cause it was a text  
but the checkboxu and the rG1 being, the radio button  
wont load up when i try to Retrieve from the Txt file.

i dont get it, i got a few radio buttons and ony five chioces of check box.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 8:33am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/5 "2003-03-14T08:33:31Z")

</div>

Well… You could try something like this…

```auto
// Untested...
if (_level0.checkboxu == "DriveThru")
{
   checkboxu.setValue(true);
}

```

something like this goes to all of your components…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 8:38am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/6 "2003-03-14T08:38:55Z")

</div>

last question what will this do?  
send the value or retrieve?

cause i have it going through fine …

just retrieving it

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 9:06am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/7 "2003-03-14T09:06:36Z")

</div>

That piece of code should be going after you load your data from the text file by using loadVariables(), loadVariablesNum(), or LoadVars()… (Use LoadVars() if you are in FMX…) I mean after you have checked if the data is fully loaded…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 9:24am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/8 "2003-03-14T09:24:33Z")

</div>

:hangover:

that is what i feel like dam it lol

well do i make a new layer and name it action script?

cause i have a button called Retrieve  
with this…  
on (release) {  
loadVariablesNum(“test.txt”,0, “GET”)  
}

(-:  
so where would i put this?  
if (\_level0.checkboxu == “DriveThru”)  
{  
checkboxu.setValue(true);  
}  
do i put it on the retrieve button or do i make a new action script i am a bit clueless right now ☹

restless

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 9:35am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/9 "2003-03-14T09:35:18Z")

</div>

Well… Do not use loadVariablesNum(), instead use LoadVars() function and put the rest of the code within the onLoad handler of the LoadVars() object… That’ll make your life whole lot easier… 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 9:43am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/10 "2003-03-14T09:43:33Z")

</div>

when u say

Loadvar ? do u mean

loadvariables(url, target, method ) ??

what would i put for target?

i got no clue lol i can’t even think it’s almost 5am

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 9:54am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/11 "2003-03-14T09:54:14Z")

</div>

Well… If I remember correctly, I have used LoadVars() object last time when we were talking about the form…

Anyways… This will be the gist of it…

```auto
on (release)
{
	myLVs = new LoadVars();
	myLVs.load("test.txt");
	myLVs.onLoad = function(success)
	{
		// more if routines that will set up
		// the check boxes and radio buttons
		// comes right here...
		if (myLVs.checkboxu == "DriveThru")
		{
			checkboxu.setValue(true);
		}
	}
}

```

It’s 5am here too and you expect ME to think??? 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 10:12am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/12 "2003-03-14T10:12:07Z")

</div>

if myLVs something u made up  
or is it a varaible in flash mx?

i am so lost

i compied and pasted what u did below

in my retrieve button

on rlease blah alha  
and nothing happended

from the test.txt file i had

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 10:15am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/13 "2003-03-14T10:15:40Z")

</div>

Well… Post your file then… I got 15 more minutes to be online and then will go to sleep…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 10:26am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/14 "2003-03-14T10:26:46Z")

</div>

hey i uploaded it to here

[http://members.rogers.com/lastdon00/help.zip](http://members.rogers.com/lastdon00/help.zip)

i am not sure what i am doing work the rest works

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 10:39am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/15 "2003-03-14T10:39:15Z")

</div>

Um… Where is your data file???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 10:41am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/16 "2003-03-14T10:41:43Z")

</div>

data file?  
meaning the test.txt?

sorry

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 11:14am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/17 "2003-03-14T11:14:09Z")

</div>

Um… I just splitted the file with WinRAR into 3 files… Get rid of the TXT extensions and unrar the file with WinRAR… I’ve fixed some of those group names for the radio buttons… Check them out… Also, take a look at the format in the text file… I’m off to bed… Let me know how it works for you…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 11:17am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/18 "2003-03-14T11:17:21Z")

</div>

Added traffic one here…

```auto
on (release)
{
	myLVs = new LoadVars();
	myLVs.load("test.txt");
	myLVs.onLoad = function(success)
	{
		// more if routines that will set up
		// the check boxes and radio buttons
		// comes right here...
		traffic = myLVs.traffic;
		if (myLVs.restaurant1 == "mccafe")
		{
			restaurant1.setValue(true);
		}
		if (myLVs.restaurant2 == "24hrs")
		{
			restaurant2.setValue(true);
		}
		if (myLVs.restaurant3 == "Drive Thru")
		{
			restaurant3.setValue(true);
		}
		if (myLVs.restaurant4 == "Playland")
		{
			restaurant4.setValue(true);
		}
		if (myLVs.restaurant5 == "Large Parking Facility")
		{
			restaurant5.setValue(true);
		}
		radioGroup1.setValue(myLVs.rG1);
		radioGroup2.setValue(myLVs.rG2);
		radioGroup3.setValue(myLVs.rG3);
		
	};
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 11:18am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/19 "2003-03-14T11:18:50Z")

</div>

The last one…

Good night!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 11:31am UTC](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386/20 "2003-03-14T11:31:46Z")

</div>

all i can say is thank u!

but one last question

all the radio buttons and check boxes load great

but in the test file  
i added some more fields like traffic etc  
for the input text  
but nothing showed up

is there something i have to do to that as well?

thank u though for the help.

[Next page](https://forum.kirupa.com/t/how-can-i-retrive-checkbox-values-from-a-text-file/15386.md?page=2)
