A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: + thingy never works the way i want it to

  1. #1
    Angkor-What? Gekke_Hollander's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    234

    + thingy never works the way i want it to

    Hi there,

    I got this function where I want the use the i var to change the names of various objects:

    Code:
    function imgHolders()
    {
    for(i=0; i<myVars.total; i++)
    {
    this.createEmptyMovieClip("imgholder"+i, i); 
    // "imgholder"+i should result in imgholder0
    clip._x = 10*i;
    clip._y = 10*i;
    loadMovie myVars.imgfolder+myVars.img+i, "imgholder"+i); 
    // myVars.img+i should result in myVars.img0
    }
    }
    Can someone please explain once and for all how to do this. I keep on messing this up!!!

    Cheers,
    Gekke_Hollander
    MX 2004 Pro - Oops I did it again!!!
    SWF, it's a journey... not a destination

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Try:

    myVars["img"+i]

    K.

  3. #3
    Angkor-What? Gekke_Hollander's Avatar
    Join Date
    Jun 2000
    Location
    Netherlands
    Posts
    234
    That worked, thanx!
    MX 2004 Pro - Oops I did it again!!!
    SWF, it's a journey... not a destination

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