Thanks Kerry. I left for vacation at noon on Thursday, so I
missed your
response. I am back now.
Maybe I am doing it wrong but "this" is what I
have set up for toggling
my check boxes on and off. When I call the roll function
using
delegate, it sends "i" to the roll function. I
capture it in the roll
function using "this." Is that the wrong way to
do it?? Is there a
cleaner, neater approach?
BTW, I did get the code working before I left by dividing
it into 4
different "if" statements and removing
"_root." It's not pretty, but it
works.
Also, it seems to compile fine in FP6 with delegate but I
saw a few
people reply that delegate shouldn't work. Do you think my
users have
issues if they are using FP6??
Thanks again for everyone's responses!
************************************************************
*****
for (i=1; i<=5; i++) {
checkBox = eval("box"+i+"_mc");
checked = eval("checked"+i+"_mc");
wrong = eval("wrong"+i+"_mc");
boxArray[i] = checkBox;
checkedArray[i] = checked;
wrongArray[i] = wrong;
//set check boxes and x's to alpha 0
checkedArray[i]._alpha = 0;
wrongArray[i]._alpha = 0;
boxArray[i].onPress = Delegate.create(i, roll);
//initialized checked1-checked5 to 0
this["checked"+i] = 0;
trace("checked"+i+" =
"+eval("checked"+i));
}
function roll() {
trace(this);
index = this;
checked = eval("checked"+this+"_mc");
if (checked._alpha == 0) {
checked._alpha = 100;
} else {
checked._alpha = 0;
}
if (index == 1) {
if (checked1 == 1) {
checked1 = 0;
} else {
checked1 = 1;
}
}
if (index == 2) {
if (checked2 == 1) {
checked2 = 0;
} else {
checked2 = 1;
}
}
if (index == 3) {
if (checked3 == 1) {
checked3 = 0;
} else {
checked3 = 1;
}
}
if (index == 4) {
if (checked4 == 1) {
checked4 = 0;
} else {
checked4 = 1;
}
}
if (index == 5) {
if (checked5 == 1) {
checked5 = 0;
} else {
checked5 = 1;
}
}
}
_______________________________________________
Flashnewbie chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om
|