[ascoders] MX-Componente in F7

  • From: "henning martens" <henninc@xxxxxx>
  • To: <ascoders@xxxxxxxxxxxxx>
  • Date: Thu, 6 Jan 2005 11:09:38 +0100

Frohes Neues,

ich quäle mich mit einer F6-Komponente, die ich in einem F7
Projekt benötige:

http://flashcomponents.net/components/sources/Animated%20Rollover%20v1_1.zip

Sobald ich auf F7 umschalte funktioniert nicht mehr, ich hab schon alles
mögliche versucht, evtl. übersehe ich etwas. Vielleicht ein reservierter
Ausdruck? Wäre nett, wenn mal jemand drauf gucken könnte.

Danke,
Henning

--
#initclip

// construct
AnimatedRolloverClass = function(){
        // create empty listeners list
        this.listenersList = new Array();
        // enable by default
        this.enabled = true;
        // initialize
        this.init();
}

// register class
Object.registerClass("AnimatedRollover", AnimatedRolloverClass);

// initialize component
AnimatedRolloverClass.prototype.init = function(){
        if ( this._targetInstanceName.length > 0 ) {
                this.rolloverTarget = this.targetInstance = 
this._parent[this._targetInstanceName];
                this._visible = false;
                if (this.rolloverTarget instanceof MovieClip) {
                        this.forward = true;
                        this.animate = false;
                        this.currentFrame = 1;
                        this.rolloverTarget.stop();
                        this.maxFrames = this.rolloverTarget._totalFrames;
                        this.rolloverTarget.parent                      = this
                        this.rolloverTarget.onRollOver          = 
this.myRollOver;
                        this.rolloverTarget.onRollOut           = 
this.myRollOut;
                        this.rolloverTarget._focusrect          = false;
                        this.rolloverTarget.useHandCursor       = false;
                } else {
                        trace("AnimatedRollover Component: no target movieclip 
found...");
                        this.enabled = false;
                }
        }
}

// enterframe routine to perform animation
AnimatedRolloverClass.prototype.onEnterFrame = function() {
        if (this.animate) {
                if (this.forward) {
                        // play forward routine
                        if (this.currentFrame < this.maxFrames) {
                                this.currentFrame++;
                                this.sendAnimRollEvent(this.currentFrame);
                                
this.rollOverTarget.gotoAndStop(this.currentFrame);
                        } else {
                                this.animate = false;
                        }
                } else {
                        // play backwards routine
                        if (this.currentFrame > 1) {
                                this.currentFrame--;
                                this.sendAnimRollEvent(this.currentFrame);
                                
this.rollOverTarget.gotoAndStop(this.currentFrame);
                        } else {
                                this.animate = false;
                        }
                }
        }
}

// mouse enters target clip
AnimatedRolloverClass.prototype.myRollOver = function() {
        if (this.parent.enabled) {
                this.parent.forward = true;
                this.parent.animate = true;
        }
}

// mouse leaves target clip
AnimatedRolloverClass.prototype.myRollOut = function() {
        if (this.parent.enabled) {
                this.parent.forward = false;
                this.parent.animate = true;
        }
}

// disable rollover behaviour
AnimatedRolloverClass.prototype.disable = function(){
        this.enabled = false;
}

// enable rollover behaviour
AnimatedRolloverClass.prototype.enable = function(){
        this.enabled = true;
}

// return enabled state
AnimatedRolloverClass.prototype.isEnabled = function(){
        return this.enabled;
}

// add listener method
AnimatedRolloverClass.prototype.addListener = function(ref){
        this.listenersList[ref] = ref;
}

// remove listener method
AnimatedRolloverClass.prototype.removeListener = function(ref){
        delete this.listenersList[ref];
}

// send follow event to all listeners
AnimatedRolloverClass.prototype.sendAnimRollEvent = function(frame){
        // walk through listeners list
        for(var i in this.listenersList) {
                // invoke onAnimRoll handler in listener
                this.listenersList[i].onAnimRollover(frame);
        }
}

#endinitclip

------------------------------------------------------
Archiv   : //www.freelists.org/archives/ascoders/
Optionen : //www.freelists.org/list/ascoders
------------------------------------------------------

Other related posts: