PDA

View Full Version : Checkboxes with Shared Objects


aestheto
09-30-2004, 10:25 PM
I'm new to using SharedObjects, but what I have is THIS:

In my UI, I have "steps" for the user to walk through to configure their selections. On frame label "Step3", the user chooses between THREE products(using radio buttons...this works fine). Upon making their selection, they are taken to frame label "Step4" where their choice is confirmed and a set of options are listed according to what they've chosen. These options are brought on with the "attachMovie" method. Inside each movie are CHECKBOXES that apply to the corresponding option. The end result will compile the radioButton they've selected and the checkbox they've selected and show their configuration in a confirmation frame. My question is...

How do I save the CHECKBOX data to use later? These are the actions I have...

Frame Label "Step3" :

stop();

// Step title
stepTitle.text = "How will you upload files to CompanyProduct ?";

// Create Product cookie
user = SharedObject.getLocal("product");

// If the data was saved previously, display
// "product" is the name of the radioGroup
if (user.data.pr != null) {
product.setValue(user.data.pr);
}
else {
product.setValue(pr1);
}

Button on Frame Label "Step3"

on (press) {
// Set the data
user.data.pr = product.getValue();
user.data.flush();
gotoAndStop("step4");
}


Frame Label "Step4" :

// Step title
stepTitle.text = "Which Options or Add-ons did you purchase ?";

// Tailor options to fit User selection
switch(user.data.pr) {
case "Product 1":
attachMovie("optPR2", "pr2", 2);
pr2._x = 54;
pr2._y = 123;
attachMovie("optPR3", "pr3", 3);
pr3._x = 54;
pr3._y = 170;
break;
case "Product 2":
attachMovie("optPR1", "pr1", 1);
pr1._x = 54;
pr1._y = 120;
attachMovie("optPR2", "pr2", 2);
pr2._x = 54;
pr2._y = 165;
attachMovie("optPR3", "pr3", 3);
pr3._x = 54;
pr3._y = 210;
break;
case "Product 3":
attachMovie("optPR1", "pr1", 1);
pr1._x = 54;
pr1._y = 120;
attachMovie("optPR2", "pr2", 2);
pr2._x = 54;
pr2._y = 165;
attachMovie("optPR3", "pr3", 3);
pr3._x = 54;
pr3._y = 210;
break;
}

THIS IS WHERE I'M STUCK...

// Create option cookie
user_opt = SharedObject.getLocal("option");

aestheto
10-01-2004, 05:34 PM
* BUMP *

anyone out there? i wonder if it should be simply:

I need to call on 3 separate checkboxes from main timeline that lie in their own MC.

any feedback is much appreciated!