Why doesn't this work?Code:function Clip(){
this.createEmptyMovieClip("ChildClip",3);
trace(this.ChildClip);
}
Clip.prototype = MovieClip.prototype;
myClip = new Clip();
Thanks in advance,
Somar!
Printable View
Why doesn't this work?Code:function Clip(){
this.createEmptyMovieClip("ChildClip",3);
trace(this.ChildClip);
}
Clip.prototype = MovieClip.prototype;
myClip = new Clip();
Thanks in advance,
Somar!
It works if the movieclip is on the stage at design time, but I don't think Macromedia would make that mandatory... =/
I am not quitely sure about the reason.
I think, "Class" is an object, not movieClip, so we can not do "Object.createEmptyMovieClip()"; Unless we combine this class to a movieClip by #initClip and Object.registerClass.
To create a MovieClip dynamically, we have
1.createEmptyMovieClip
2.duplicateMovieClip
3.attachMovie
It seems that, we can not dynamically create a movieClip by "new" constructor.
myMovieClip = new MovieClip(); // I don't get what you're saying...Quote:
Originally posted by ericlin
It seems that, we can not dynamically create a movieClip by "new" constructor.
I mean, we can not create a new movieClip by "new":
myMovieClip = new MovieClip();
trace(myMovieClip._x);
trace(myMovieClip._name);
myMovieClip.attachMovie("someId","clip1",2);
myMovieClip.loadMovie("someSwf");
None of those codes that a movieClip can implement will work.