# Custom classes and MovieClipLoader issue

**URL:** <https://forum.kirupa.com/t/custom-classes-and-moviecliploader-issue/184125>\
**Category:** Uncategorized\
**Created:** [April 2, 2006, 12:03pm UTC](https://forum.kirupa.com/t/custom-classes-and-moviecliploader-issue/184125 "2006-04-02T12:03:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash1810](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@flash1810](https://forum.kirupa.com/u/flash1810)\
**Post date:** [April 2, 2006, 12:03pm UTC](https://forum.kirupa.com/t/custom-classes-and-moviecliploader-issue/184125/1 "2006-04-02T12:03:41Z")

</div>

Hi everybody…

i am creating an animated thumbnail menu.  
To build the animation i wrote a very simple custom class (using class ClassName extends movieclip).

to load the actual thumbs i use this code :

[COLOR=Blue]image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener); image\_mcl.loadClip(thumbnails[j],this[“thumb”+(j)]);[/COLOR]

Where this[“thumb”+(j)] are my class customized animated movie clips.

The problem that i am having is that the loadclip method seems to be interfering with the custom properties i wrote in my class.  
Everything is fine for properties like \_x, but i can see the poperties i wrote going form a defined value to “undefined” once that method is called.

Has anyone had a similar problem before?

Am i doing something wrong or there is a clash in the datatypes?

If anybody could help please … 😉

D

---

<div class="post-metadata">

**Author:** ![flash1810](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@flash1810](https://forum.kirupa.com/u/flash1810)\
**Post date:** [April 2, 2006, 11:28pm UTC](https://forum.kirupa.com/t/custom-classes-and-moviecliploader-issue/184125/2 "2006-04-02T23:28:05Z")

</div>

first of all the problem :

public loadClip(url:String,\*\* target:Object\*\*) : Boolean

**target:Object** - The target path of a movie clip, or an integer specifying the level in Flash Player into which the movie will be loaded. The **target movie clip** _is replaced_ by the loaded SWF file

So the loadMovie erases the class and replaces it with the new movie (which will be a MovieClip class - as all \_root movies are…)  
(from macromedia docs).

now the solution :

in the custom class add a property and a constructor

public var myThumb : MovieClip;

public function makeMyThumb() {  
myThumb = this.createEmptyMovieClip(“myThumb”,1)  
}

and then load the thumbs into this movieclip like this

[COLOR=Blue]image\_mcl.loadClip(thumbnails[j],this[“thumb”+(j)].myThumb);

[COLOR=Black]remember to inizialise the mc before using it…

and that’s all really…

hope i havent skipped anything… 😉  
D  
[/COLOR][/COLOR]
