List Info

Thread: RE: Flash player 6




RE: Flash player 6
country flaguser name
United States
2007-07-16 10:54:16
 
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;
		}
	}

}
_______________________________________________
Flashnewbiechattyfig.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

RE: Flash player 6
country flaguser name
United States
2007-07-16 11:39:27
Susan Lord wrote:
 
> 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?

Not if it works ^_^

I wasn't aware that you were using delegate, so, if
"this" is returning a
Number, you should be fine.

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.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

RE: Flash player 6
country flaguser name
United States
2007-07-16 12:03:14
Also, eval() has been depreciated.  Use a reference to the
clip's
location instead.  If it's in the same timeline as the
script, you can
use:

checkBox = this["box"+i+"_mc"];

or if not, then:

checkBox =
theMovieClipTimelineWhereItsLocated_mc["box"+i+&qu
ot;_mc"];

Jason Merrill
Bank of America  
GT&O Learning & Leadership Development
eTools & Multimedia Team


 
_______________________________________________
Flashnewbiechattyfig.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

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )