A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: read multiple shared objects loop?

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    14

    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.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    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

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    14
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center