A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: clones

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Location
    ENGLAND
    Posts
    17

    clones

    hi im using clones for layers
    like layer.clone()
    is there a way i can hide/delete all clones at once?

    and if not is there a way i can stop it fro m error reporting if the clone dosent exist(i need to hide all my clones but not all of them will be shoing anyway)
    FINALLY FLASH HAS A GOD

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    make your clones as an Array that way you can loop through the array to change all the clones.

  3. #3
    Junior Member
    Join Date
    Mar 2004
    Location
    ENGLAND
    Posts
    17
    Originally posted by blanius
    make your clones as an Array that way you can loop through the array to change all the clones.
    sorry to sound dum but i dont understand how u mean
    FINALLY FLASH HAS A GOD

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    myclones new Array()

    for (idx=0;idx<10;idx++){
    myclones[idx]=element("layertoclone").clone();

    }

    you now have 10 clones of the layer and can refer to them as
    myclones[0]
    myclones[1]
    myclones[2]
    ...etc....

    So you can now set/assign/change the properties of all the clones in a simple loop. For example to hide them all

    for (idx=0;idx=myclones.length;idx++){
    myclones[idx].hide()
    }

    see the help regarding for loops and arrays and you should get the idea. See the Clone example as I believe it uses an array just as above so that it can check if any of the clones are out of bounds by looping through them.

  5. #5
    Junior Member
    Join Date
    Mar 2004
    Location
    ENGLAND
    Posts
    17
    im surrounded by genius, thanks dude
    FINALLY FLASH HAS A GOD

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