How to extend the MC class? 2004-03-17 - By Mendelsohn, Michael
Back Hi list...
Is it possible to extend specific movie clip classes?
For instance, I have 9 MCs on the stage, each needing the functions of what's in the object below. I'd like to avoid having the same code written out 9 times on the first frame, so can I do something like: <path to MC>.prototype = gMCextender(-366, -834, 340, 1, "in"); // with parameters?
I can't seem to get it to work. Is there a way to add prototype features with specific parameters to certain MCs?
Thanks, Michael M.
gMCextender = function (theX, theY, theScale, theInfoFrame, inOrOut) { this.onRollOver = function () { if (gObj.pZoomState == "out") { gObj.mColorChange ("rollOver", this); } }; this.onRollOut = function () { if (gObj.pZoomState == "out") { gObj.mColorChange ("rollOut", this); } }; this.onPress = function () { if (gObj.pZoomState == "out") { gObj.mColorChange ("press", this); } }; this.onRelease = function () { if (gObj.pZoomState == "out") { gObj.mColorChange ("release", this); gObj.mZoomIn (theX, theY, theScale, theInfoFrame, inOrOut); } }; this.onReleaseOutside = function () { if (gObj.pZoomState == "out") { gObj.mColorChange ("releaseOutside", this); } }; };
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:107201 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|