Hi,

The following class I've coded fails to fade the MC on stage. Could someone explain why the code fails?
//Class
class FadeAlpha extends MovieClip {
        private var alpha:Number = this._alpha;
        private var visible:Boolean = this._visible;
        public var alphaRate:Number;
        public var mc:MovieClip;
        //constructor left enpty, can use later.
        public function FadeAlpha() {
                fadeObj();
        }
        function fadeObj(mc:MovieClip, alphaRate:Number) {
                mc.onEnterFrame = function() {
                        mc.alpha -= alphaRate;
                        if (mc.alpha<=0) {
                                mc._visible = false;
                                delete mc.onEnterFrame;
                        }
                };
        }
}

From AS Timeline:
import FadeAlpha;
var fadeAlpha:FadeAlpha = new FadeAlpha);
img01_mc.fadeAlpha(this, 5);
On Stage:
img1_mc



_______________________________________________
[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

Reply via email to