# Movieclip Class

**URL:** <https://forum.kirupa.com/t/movieclip-class/317765>\
**Category:** flash\
**Created:** [January 2, 2011, 12:15pm UTC](https://forum.kirupa.com/t/movieclip-class/317765 "2011-01-02T12:15:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LonGe](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@LonGe](https://forum.kirupa.com/u/LonGe)\
**Post date:** [January 2, 2011, 12:15pm UTC](https://forum.kirupa.com/t/movieclip-class/317765/1 "2011-01-02T12:15:48Z")

</div>

Hello!  
I have AS in main timeline:

```auto

for (var i:Number = 0; i < 10; i++) {
    var pic_mc:thumb=new thumb();
    pic_mc.name = "pic"+i;
    stage_holder.addChild(pic_mc);
    pic_mc.loadPic(pic_url);

```

creates movieclips like this:  
stage\_holder.pic0  
stage\_holder.pic1 etc.

Inside movieclip “thumb” I have movieClip named “b”, there I want to add loaded picture, but don’t know how to do it! Also I want to trace movieclip’s name “pic1”, "pic2"etc.

movieClip thumb has class:

```auto
package 
{
 import fl.transitions.*;
 import flash.display.*;
 import flash.events.*;
 import flash.net.URLRequest;

 import flash.display.Loader 

public class thumb extends MovieClip
    {
        private var myLoader:Loader;
       public function thumb()
        {
         **//doesn't show movieclip name!**
            trace("created "+ name);
        }
        
 public function loadPic(links:String)
        {
var myLoader:Loader = new Loader();

myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderReady);

var fileRequest:URLRequest = new URLRequest(links);
myLoader.load(fileRequest);

        }
        
        

public function onLoaderReady(e:Event) {     

**//here I want to add picture to movieclip: stage_holder.pic1.b**
b.addChild(myLoader);
   
} }

}

```
