-
read multiple shared objects loop?
Flash 8
I have no idea how to do this:
I have 122 buttons that when clicked they make a shared object = "yes".
the button instances are named save1 through save122.
I want the buttons to change color if they have been clicked before. So when the user comes back , they can see which buttons have already been clicked.
so basically it goes like this: if my shared objects = yes then change that color.
how do i do this for all 122 of them? below is my concept.
if (myshared_object.data.(save1clicked through save122clicked) == "yes") {
var colorful = new Color(save1clicked through save122clicked);
colorful.setRGB(0x926130);
thanks for your help.
-
Use a for loop:
for (i=1, i<123, i++)
Then target all this.save1 through this.save122 like:
this["save"+i]
Sorry i don't know how your saved data gets written so couldn't provide you with full code. Guess you'll figure it out from there.
gparis
-
thanks for your help. I got it to work with your help! again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|