This content has been marked as final. Show 5 replies
Its a little difficult to be sure what the issue might be without more information.
your code could be shortened
check the trace output to see if it gives what you expect
For the checkbox 'values' to carry on between two frames make sure that there is only one keyframe in the first frame on the layer that contains the checkboxes and that the second frame is not a new keyframe with a new 'instance' of each of the checkboxes... its difficult to be sure what is causing the problem beyond that suggestion with the information you have posted, sorry.
This method works just fine as long as my checkboxes and my submit button reside on the same page. The variables are loaded and passed to the database. The issue is that this is a two page form. There are checkboxes on page one (Frame 1 on the timeline). As normal, the user inputs their name, etc. Clicks on the appropriate checkboxes and then clicks on the next button to go to page two (Frame 2) where there are more checkboxes (all CB's have unique names, etc). The user clicks on the appropriate check boxes and then clicks on the SUBMIT button (located on Frame 2 of the timeline). Using the event handler listed in this post, the data from both pages (Frame 1 & Frame 2) are supposed to be uploaded to the database. But....it's not working. Let's assume that "chBx1" is on Page 1 / Frame 1, and "chBx2" resides on page 2 / Frame 2, the same location as the SUBMIT button. The variable from "chBx2" is traces correctly, but "chBx1" traces as either Undefined or False (even when the checkbox has been selected.
Hopefully, this explanation helps and I appreciate any help you may offer.
Is there any way you can put your fla online. I'll take a look at it if you want.
If chBx1 is in its own layer and is only in a keyframe on frame 1 of that layer and not duplicated on frame 2, then it should continue to maintain its state etc . But that's the same advice I gave earlier, just a little more specific for chBx1.
If that's not the problem/cause then I'd probably need to see the fla to work it out. It is strange that you get 'undefined' ever, because that would indicate that the checkBox does not exist, if you're tracing chBx1.selected in frame 2. If a checkbox exists, then its selected property is defined - and is either true or false.
The other thing that may be related is the fact that you're doing a sendAndLoad with my_lv also receiving the result of the load part of that. What is your php script returning to my_lv? And are you tracing for example my_lv.myVar1 after the sendAndLoad has received its result back into my_lv, overwriting what was there originally?
I normally use two different LoadVars for sendAndLoad and have the second one receive the result.
This doesn't seem like it would be the problem ... but I am afraid its difficult to tell with the information I have. To get further I'd need to see the fla I think.
OK, I'll email it to you now.
You were redeclaring the LoadVars on frame 2. I just put the declaration in the main timeline on frame 1 and removed the declarations in the on release handlers. A couple of other minor changes, but I think that was the main one.