[ascoders] Re: multiple isPlaying ?

  • From: "Marcel Fahle" <ascoders@xxxxxxxxxxxxxxx>
  • To: <ascoders@xxxxxxxxxxxxx>
  • Date: Tue, 20 Jul 2004 08:43:16 +0200

Michael Kneib wrote:

> for (var i in timeline){
>    if(typeof(timeline[i]) =="movieclip" && timeline[i].isPlaying){
>        //huhahu
>    }
> }

Moin Micha,

das mit der Variablen war mein Problem. Ich hab ca 30
Clips, in denen ich die hätte nachträglich setzen müssen.

Ich hatte mir heute morgen mal unten stehendes Script gebastelt,
was auch einigermaßen seinen Dienst verrichtete.
Da ich aber noch auf andere Probleme gestoßen bin, musste ich
mein Problem komplett anders angehen.
(Ich hatte auf manchen Timelines noch kleine Pausen Scripte
sitzen, die zu einem Fehler geführt haben  :-/ )

Na ja, hab jetzt mittlerweile alles im Griff und kann weitermachen  :o)


MovieClip.prototype.isPlaying = function(){
    if (this._previousframe == undefined) this._previousframe =
this._currentframe;
    if (this._previousframe == this._currentframe) var playing = false;
    else var playing = true;
    this._previousframe = this._currentframe;
    return playing;
};

MovieClip.prototype.showPlayingClips = function(){
    for( clip in this ){
        if( typeof this[clip] == "movieclip" ) {
            this[clip].counter = 1;
            this[clip].onEnterFrame = function () {
                trace(this.isPlaying() + "  " + this);
                if (this.counter > 1) {
                    delete this.onEnterFrame;
                }
                this.counter++;
            }
        }
    }
}

_root.showPlayingClips();







-- 
Marcel Fahle

MAT-Computing
Dorotheenstr. 10
44793 Bochum

office   +49 234 6 40 41 02
fax       +49 234 68 08 03
mobile  +49 172 53 929 14

m.fahle@xxxxxxxxxxxxxxxx
http://mat-computing.de

private:
http://marcelfahle.com

latest:
http://www.patric-la-funk.com



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

Other related posts: