function Square(){}
Square.prototype=new MovieClip();
Square.prototype.changeColorTo=function (clr:Number)
{
var tempClr:Color=new Color(this);
tempClr.setRGB(clr);
delete tempClr;
}
var linkageID_str:String="exportedClip";
//associate the linked clip with sub class
Object.registerClass(linkageID_str,Square);
//attach
var mc:MovieClip= attachMovie(linkageID_str,"mc",1);
//then prohibit further association of linked clip to class
Object.registerClass(linkageID_str,null);
//when you call the method it should work
mc.changeColorTo(0xFF0000);
Same idea if you're working with Actionscript 2.0
Y Shouman
On 12/1/06, Micky Hulse <[EMAIL PROTECTED]> wrote:
Just curious if it is possible to extend/apply a sub class to a swf
which is loaded via attachMovie()?
TIA,
Cheers,
M
--
Wishlist: <http://snipurl.com/vrs9>
Switch: <http://browsehappy.com/>
BCC?: <http://snipurl.com/w6f8>
My: <http://del.icio.us/mhulse>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com