On Mar 24, 2008, at 8:30 AM, Cor wrote:


This throws an error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.

What am I doing wrong?


You can't call new Background_mc() when it's an instance of Class - there's no constructor for it that the compiler recognizes.

My suggestion if you don't need to extend UIMovieClip is as follows.

In your Library.fla file, check your export for the Background_mc symbol.

Give it a class name (com.something.myBackground) and have it extend flash.display.MovieClip.

Export an SWC of the Library file and then set your compiler prefs to include that SWC into the project.

Then, in your class just do:

import com.something.myBackground

and the usage is:

private var myBG : MovieClip;
private var Background_mc:MovieClip;

myBG = MovieClip( new Background_mc() );

At least, that's one way of doing it. I do it that way for non- component UI elements that do not need to extend UIMovieClip. Also because I use the same SWC as an SWF file for CSS embedding of graphical elements.

good luck,

jon

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to