   How do I access a movieclip with a variable name?
  Say I have a movieclip whose name is: techI want to access the ._y of this movieclip through a variable like this:var my_mc_name = tech;var my_y = [my_mc_name]._y;  //I need this to be read as tech._y so that it gets the y of tech.How would I do this?  Thank you.   
Quote:Original post by ImozebHow would I do this?  Thank you.That would depend entirely on what language you're using.   ;  It seems that you're using flash with actionscript...If so, then usually these movieclips are already attached to a container (usually the stage) and you can access them by name using Stage.getChildByName(String: name)..then you would cast it to movieclipHTH,Atef Hashem   ;  You are correct.  I am using flash 8 actionscript.  I created an empty movieclip and attached it to that.  Could you provide an example, please.Thank you.   ;  if you are using as2 you can use something like that_root["name"]if movie clip at root. you can specify other layers like _root.container["name"] or simply this["name"] if you are working on same layer;  It's not working :(This is how I create the movieclip:_root.createEmptyMovieClip("n_Layer", 98);n_Layer.attachMovie(n_type, n_id, n_count);I need to access the ._y of the movieclip from another function.  I thought I could do it through a variable?  Like n2_type._y where n2_type is a variable equal to the movieclips name.  Could someone give me an example of how to get this to work?Thank you.   ;  Is name the variable because it is not working for me.name = 'my_mc';_root.container.["name"]._y //should be my_mc._y right???It isn't working.  Please help!!!   ;  Are you using (key) frames? If so, does the movieclip exists in that context?ActionScript 2 is utterly inconsistent and confusing when it comes to referencing objects.   ;  The movieclip which is created use 15 keyframes.  But the main timeline is only different layers (no 2nd or more keyframe)This is how I create the movieclip using action script:_root.createEmptyMovieClip("n_Layer", 98); //creates the new layer under _rootn_Layer.attachMovie(n_type, n_id, n_count);  //attaches the new movieI know that the movieclip exists because I see it on the viewing field once it is created and I can access it throught this.  (if I am in it's enterframe)  What I need is to access it through a varialbe name so I can use a for loopfor(i = 1; i < n_count; i++;){ n_name = 'bob' + n_count;  //inc the name variable 1,2,3.....  _root.["n_name"]._y = bob_y;  //get bob_y through a varialbe so I don't have to do bob1._y, bob2._y, bob3._y etc....};  You don't need the quotes around n_name, that will access a movieclip called n_name.  You need to specify the full path to the movieclip aswell (it was attached to n_layer, so you need to reference this).  You also don't need the . before the square brackets.  This should work:for(i = 1; i < n_count; i++;){n_name = 'bob' + n_count; _root.n_layer[n_name]._y = bob_y; }   