Custom classes and MovieClipLoader issue

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 … :wink:

D

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… :wink:
D
[/COLOR][/COLOR]