system
March 22, 2003, 6:16pm
101
ok the storeerror as u said works fine. thanks.
as for the ON submit and retrieve
on submit button i put
myLVs.action = “Submit”;
and on the retrieve though it’s using sendandLoad i put
myLVs.action = “RETRIEVE”;
i guess that shouldn’t get the database confused if i used the variable name action=retrieve
I think think should be working,
I’ll let u know
thanks so far for all the Help=) my hat goes off to u though it’s not tipping:hat:
system
March 23, 2003, 12:25am
102
:sigh: ok ok time for another question
on (release){
myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.action = "Retrieve";
myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
myLVs.onLoad = function(success)
{
if (myLVs.storeError == "Wrong")
{
getURL("javascript: alert('Store Number is Invalid'), void(0)");
}
else
should not this work? if u type in store : 1234 and hit retrieve should it not LOAD up what ever is in the database?
system
March 23, 2003, 6:24am
103
I guess it should… Why??? It doesn’t load up all the variables from the database???
system
March 23, 2003, 6:55am
104
well strangely enough,
i dont know how to word this…
on retrieve = sendandLaod right? so itpass info
so i type the store number 1234 as a test
and hit retrieve and then the number disappears!
i dont get it lol
system
March 23, 2003, 7:17am
105
Post your code on the retrieve button, would you???
system
March 23, 2003, 7:26am
106
on (release){
myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.action = "Retrieve";
myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
myLVs.onLoad = function(success)
{
if (myLVs.storeError == "Wrong")
{
getURL("javascript: alert('Store Number is Invalid'), void(0)");
}
else
{
// more if routines that will set up
// the check boxes and radio buttons
// comes right here...
other.text = myLVs.other
details.text = myLVs.details
sponsor.text = myLVs.sponsor
raising.text = myLVs.raising
annual.text = myLVs.annual
traffic.text = myLVs.traffic;
store.text = myLVs.store
comments.text = myLVs.comments
varTextBox1.text = myLVs.varTextBox1
varTextBox2.text = myLVs.varTextBox2
varTextBox3.text = myLVs.varTextBox3
varTextBox4.text = myLVs.varTextBox4
if (myLVs.restaurant1 == "Mccafe")
{
restaurant1.setValue(true);
}
if (myLVs.restaurant2 == "24 Hrs")
{
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);
}
radioGroupp.setValue(myLVs.radioGroupp);
radioGroup.setValue(myLVs.radioGroup);
radioGroup1.setValue(myLVs.radioGroup1);
radioGroup2.setValue(myLVs.radioGroup2);
radioGroup3.setValue(myLVs.radioGroup3);
radioGroup4.setValue(myLVs.radioGroup4);
}
}
}
this is for the retrieve button.
system
March 23, 2003, 7:35am
107
I have added three trace() in the code…
Run this and show me what you have in the output window… Do the copy and paste…
on (release)
{
myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.action = "Retrieve";
myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
myLVs.onLoad = function(success)
{
trace("myLVs.storeError = " + myLVs.storeError);
if (myLVs.storeError == "Wrong")
{
getURL("about : alert('Store Number is Invalid'), void(0)");
}
else
{
// more if routines that will set up
// the check boxes and radio buttons
// comes right here...
trace("myLVs.store = " + myLVs.store);
other.text = myLVs.other;
details.text = myLVs.details;
sponsor.text = myLVs.sponsor;
raising.text = myLVs.raising;
annual.text = myLVs.annual;
traffic.text = myLVs.traffic;
store.text = myLVs.store;
comments.text = myLVs.comments;
varTextBox1.text = myLVs.varTextBox1;
varTextBox2.text = myLVs.varTextBox2;
varTextBox3.text = myLVs.varTextBox3;
varTextBox4.text = myLVs.varTextBox4;
if (myLVs.restaurant1 == "Mccafe")
{
restaurant1.setValue(true);
}
if (myLVs.restaurant2 == "24 Hrs")
{
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);
}
radioGroupp.setValue(myLVs.radioGroupp);
radioGroup.setValue(myLVs.radioGroup);
radioGroup1.setValue(myLVs.radioGroup1);
radioGroup2.setValue(myLVs.radioGroup2);
radioGroup3.setValue(myLVs.radioGroup3);
radioGroup4.setValue(myLVs.radioGroup4);
}
trace(unescape(myLVs));
};
}
system
March 23, 2003, 7:40am
108
what do u mean by output window?
when i click submit?
system
March 23, 2003, 7:41am
109
Nope… When you press the ‘Retrieve’ button, you will see the output window popping up… Copy what’s in there and paste it right here…
system
March 23, 2003, 7:52am
110
hey.
I just tried it
there was no windows poping up
it just loaded the values in the places
system
March 23, 2003, 7:55am
111
Huh??? You are supposed to see at least one line… Delete the script in the ‘Retrieve’ button and replace that with this…
Let me know…
on (release)
{
myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.action = "Retrieve";
myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
myLVs.onLoad = function(success)
{
if (success)
{
trace("myLVs.storeError = " + myLVs.storeError);
if (myLVs.storeError == "Wrong")
{
getURL("about : alert('Store Number is Invalid'), void(0)");
}
else
{
// more if routines that will set up
// the check boxes and radio buttons
// comes right here...
trace("myLVs.store = " + myLVs.store);
other.text = myLVs.other;
details.text = myLVs.details;
sponsor.text = myLVs.sponsor;
raising.text = myLVs.raising;
annual.text = myLVs.annual;
traffic.text = myLVs.traffic;
store.text = myLVs.store;
comments.text = myLVs.comments;
varTextBox1.text = myLVs.varTextBox1;
varTextBox2.text = myLVs.varTextBox2;
varTextBox3.text = myLVs.varTextBox3;
varTextBox4.text = myLVs.varTextBox4;
if (myLVs.restaurant1 == "Mccafe")
{
restaurant1.setValue(true);
}
if (myLVs.restaurant2 == "24 Hrs")
{
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);
}
radioGroupp.setValue(myLVs.radioGroupp);
radioGroup.setValue(myLVs.radioGroup);
radioGroup1.setValue(myLVs.radioGroup1);
radioGroup2.setValue(myLVs.radioGroup2);
radioGroup3.setValue(myLVs.radioGroup3);
radioGroup4.setValue(myLVs.radioGroup4);
}
trace(unescape(myLVs));
}
else
{
trace("Connection to the server has failed...");
}
};
}
system
March 23, 2003, 8:11am
112
system
March 23, 2003, 8:14am
113
You just get one line??? I don’t get it…
system
March 23, 2003, 8:20am
114
well yeh cause right now what the database is doig just writting a variable wrong back to flash u know?
i wonder is there a way to limite store.text to just numbrs?
do i do store.text = “1234567890”?
system
March 23, 2003, 8:36am
115
in my access database i had to think
one is 12345
and one is 123456
when i hit retrieve it just loads the first tone 12345
but if i hit 123456
it stills loads the 123456
do u think that problem is onthe asp page?
or with the code?
system
March 23, 2003, 8:52am
116
Well… All I can guess is that there should be something going on with your ASP page, but I know nothing about ASP…
To restrict the store number to be inputted with number, check out ‘TextField.restrict’ from the Flash manual…
system
March 23, 2003, 9:07am
117
yeh that is what i thin it’s my asp side maybe
cause when i have all the pre defined values in the text file
it loads up smoothly
i just wanted to ask u one more thing.
is there a way, to
make if statements for the radio buttons?
like if noting choice is selected not to load up?
system
March 23, 2003, 9:54am
118
You can use this, ‘FRadioButton.getValue’…
Check out the manual… It says, If no button is selected, the method returns undefined., and I think you can use this condition in conjunction with the if statement…
system
March 23, 2003, 10:03am
119
userData = new LoadVars();
userData.name = name;
userData.species = species;
userData.speciesType = speciesType.getValue();
userData.residence =
residence.getValue();
response = new LoadVars();
response.onLoad = getResponse();
userData.sendAndLoad("register.php", response, "post");
}
this is just an example i found on the net…
u notice how he has a userData = new LoadVars(); and then a response = new LoadVars();
and then he calles out to
userData.sendAndLoad(“register.php”, response, “post”);
do u think my problem is that i have
myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.action = "Retrieve";
myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
myLVs.onLoad = function(success)
maybe i need to put another new LoadVar?
? what u think?
myLRs = new LoadVar();
myLRs.onLoad = getResponce?
i dunno maybe this is gibberish since it’s so late lol
but maybe it would do somethinG?
system
March 23, 2003, 10:08am
120
There is no difference whether you have one or two LoadVars() object… All that code does is to seperate the incoming and outgoing variables… If you want, you could try that though… You don’t need my permission to do that… :beam: