Copy link to clipboard
Copied
I'll use arrays.
Like what:
var sz=[this.mc0,this.mc1]
Array.prototype.myUcase=function(){
xs=0.1
for (i=0;i<this.length;i++){
this[i].x=100
}
}
sz.myUcase()
But I don't know
How
Add a method to a movie clip
lib.prototype.myUcase=function(){
this.x=100
}
this.mc1.myUcase()
This operation fails.
It bothers me.
The approach looks like an ActionScript 1 or 2 way of doing things. With ActionScript 3 you could do this:
var sz=[this.mc0,this.mc1];
for (i=0;i<sz.length;i++){
sz[i].x=100;
}
sz.push(new MyCustomMC() as MovieClip);
sz[sz.length-1].x = 100;
'MyCustomMC' would be a movieclip in your library where you had set its linkage name to MyCustomMC. Saying 'as MovieClip' would make your custom movieclip act like a normal one.
Copy link to clipboard
Copied
The approach looks like an ActionScript 1 or 2 way of doing things. With ActionScript 3 you could do this:
var sz=[this.mc0,this.mc1];
for (i=0;i<sz.length;i++){
sz[i].x=100;
}
sz.push(new MyCustomMC() as MovieClip);
sz[sz.length-1].x = 100;
'MyCustomMC' would be a movieclip in your library where you had set its linkage name to MyCustomMC. Saying 'as MovieClip' would make your custom movieclip act like a normal one.
Copy link to clipboard
Copied
I'm sorry
I don't speak English well
I'm learning HTML5
Use animate cc
I'm looking
https://www.w3schools.com/js/js_object_prototypes.asp
JavaScript Object Prototypes
Array objects inherit from Array.prototype
I wrote the first one in ANIMATECC.
But
How movie clips use prototypes, and I won't rewrite them in Animatecc
Copy link to clipboard
Copied
Hi, I already know how to use it.
Thank you for your answer
Object. is a method that you can add to a movie clip
It's just that "THIS" is wrong.
I'm going to adapt my habits
Use "exportRoot." in "ANIMATECC." Instead of "THIS"