Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 09-12-2004, 14:18   #1 (permalink)
Neuer User
 
Benutzerbild von JohnJohnson
 
Registriert seit: Oct 2004
Beiträge: 84
Unhappy 100% CPU Auslastung - keine ahnung wo der fehler liegt....

Hallo leute.....

habe eine website gebaut die im grunde über eine basisseite verfügt in die verschiedene swfs per loadMovie geladen werden.
alles wunderbar soweit, es funzt und läuft. - nur - die basisseite allein verursacht eine 100% CPU-Auslastung. Das Script das ich hier poste steuert im grunde die gesamte basisseite ab, liegt im ersten frame allein über/in einem leeren schlüsselbild.
es existieren noch exakt zwei onEnterFrames - die aber ebenfalls über ne eigene funktion wieder abgeschaltet werden (sollen??) der rest wird durch onRelease aufrufe und variablen-wert-veränderung abgesteuert...
denk mir, vielleicht setze ich einfach nur den delete onEnterFrame falsch?
leute das ist eine seminararbeit für mein studium und abgabe is morgen mittag - hoffentlich kann mir jemand helfen....

hier das script:
PHP-Code:
var homebig=1;
var 
filmbig=0;
var 
biobig=0;
var 
bildbig=0;
var 
contbig=0;
var 
speed=120;
var 
sizebig=10000;
var 
sizesmall=150;
var 
warten 2;
var 
warten=1;
MovieClip.prototype.navlayout = function(objbuttvari) {
    
this.onEnterFrame = function (){
        if (
buttvar==1) {
            if (
obj._x<=400) {
            
obj._x+=_root.speed;
            if (
obj._x>=200) {
                
obj._y=obj._x-300;
            }
        }
        if (
obj._xscale<=_root.sizebig) {
            
obj._xscale+=obj._xscale/2;
            
obj._yscale=obj._xscale;
        }
    }
        if (
buttvar==0) {
            if (
obj._x>=100) {
                
obj._x-=_root.speed;
                
obj._y=obj._x-(70*i);
            }
            if (
obj._xscale>=_root.sizesmall) {
                
obj._xscale-=obj._xscale*0.5;
                
obj._yscale=obj._xscale;
            }
    }
    if(
alp==0&&obj._alpha<=100-obj._xscale/150){
        
obj._alpha+=10
    
}else{
        
alp=1;
        
obj._alpha=100-obj._xscale/150;
    }
    };    
    if(
viewer==0){
        
delete this.onEnterFrame;
    }
};
ladestatus = function(){
        
loader.onEnterFrame = function(){
            
geladen _root.drop.getBytesLoaded();
            
zuladen _root.drop.getBytesTotal();
            
prel Math.round(geladen*10/zuladen);
        };
        if(
viewer==0&&warten==0){
                
delete this.onEnterFrame;
            }
    };
this.onEnterFrame = function (){
        
_root.createEmptyMovieClip("audience",0);
        
with(_root.audience) {
                
beginFill (0xcccccc20);
                
lineStyle(0.1,0x000000,20);
                
moveTo(0,420);
                
lineTo(_root.point4._x,_root.point4._y);
                
lineTo(_root.point3._x,_root.point3._y);
                
lineTo(760,420);
                
lineTo(0,420);
                
beginFill (0xcccccc5);
                
lineStyle(0.1,0x000000,20);
                
moveTo(0,0);
                
lineTo(_root.point1._x,_root.point1._y);
                
lineTo(_root.point4._x,_root.point4._y);
                
lineTo(0,420);
                
lineTo(0,0);
                
lineStyle(0.1,0x000000,20);
                
moveTo(760,0);
                
lineTo(_root.point2._x,_root.point2._y);
                
lineTo(760,0);
        }
        if(
_parent.viewer==0&&_parent.warten==0){
        
delete this.onEnterFrame;
        }
};
MovieClip.prototype.fadinout = function() {
    
this.onEnterFrame = function() {
        if(
drop._alpha>=1&&subdrop._alpha>=1){
            
drop._alpha-=50;
            
subdrop._alpha-=25;
        }else{
            
unloadMovie("drop");
            
fader=0;
            
unloadMovie("subdrop");
            
subfader=0;
        }
        if(
fader==0&&subfader==0){
            
drop._alpha=100;
            
subdrop._alpha=100;
            
loadMovie(submovie+".swf""subdrop");
            
loadMovie(movie+".swf""drop");
            
ladestatus();
        }
    }
    if(
warten==0&&viewer==0){
        
delete this.onEnterFrame;
    }
};
MovieClip.prototype.leinwandmove = function(destxdestyscale) {
    
this.onEnterFrame = function (){
        
delta_x destx-leinwand._x;
        
delta_y desty-leinwand._y;
        
leinwand._x += delta_x/8;
        
leinwand._y += delta_y/8;
        if (
leinwand._xscale<=scale) {
            
leinwand._xscale+=leinwand._xscale/(leinwand._xscale/10);
            
leinwand._yscale=leinwand._xscale;
        }
        if (
leinwand._xscale>=scale) {
            
leinwand._xscale-=leinwand._xscale/(leinwand._xscale/10);
            
leinwand._yscale=leinwand._xscale;
        }
    }
    if(
viewer==0){
        
delete this.onEnterFrame;
    }
};
home.onRelease leinwand.onLoad = function(){
    if(
homebig==1){
        
warten=1;
        
viewer=1;
        
loader.gotoAndStop(2);
        
drop.fadinout();
        
fader=1;
        
movie "home01";
        
subfader=1;
        
submovie "dummy";
        
leinwand.leinwandmove(380,210200);
    }
};
bio.onRelease = function() {
    if(
biobig==1){
        
warten=1;
        
viewer=1;
        
loader.gotoAndStop(2);        
        
drop.fadinout();
        
fader=1;
        
movie "bio";
        
subfader=1;
        
submovie "dummy";
        
leinwand.leinwandmove(420,210,170);
    }
};
films.onRelease = function() {
    if(
filmbig==1){
        
warten=1;
        
viewer=1;
        
loader.gotoAndStop(2);
        
drop.fadinout();
        
fader=1;
        
movie "filmpraesi02sub";
        
subfader=1;
        
submovie "kreismenu06c1";
        
leinwand.leinwandmove(500,150,115);
    }
};
bilder.onRelease = function() {
    if(
bildbig==1){
        
warten=1;
        
viewer=1;
        
loader.gotoAndStop(2);
    
drop.fadinout();
    
fader=1;
    
movie "bilder01";
    
subfader=1;
    
submovie "dummy";
    
leinwand.leinwandmove(440,200,149);
    }
};
kontakt.onRelease = function() {
    if(
contbig==1){
        
warten=1;
        
viewer=1;
        
loader.gotoAndStop(2);
    
drop.fadinout();
    
fader=1;
    
movie "kontakt01b";
    
subfader=1;
    
submovie "try2_scal02";
    
leinwand.leinwandmove(430,210,165);
    }
}; 

was ich vergessen habe -
zum anschauen gibts die seite auf nem testordner
http://www.farbpfeil.de/film/dynamiclayout01.html

Geändert von JohnJohnson (09-12-2004 um 14:37 Uhr)
JohnJohnson ist offline   Mit Zitat antworten
Alt 09-12-2004, 15:31   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Ich weiß nicht ob's hilft, aber dieses oEF scheint ewig zu laufen. Kenne mich aber nicht genug aus, um zu erkennen warum...

PHP-Code:
this.onEnterFrame = function (){ 
        
_root.createEmptyMovieClip("audience",0); 
        
with(_root.audience) { 
                
beginFill (0xcccccc20); 
                
lineStyle(0.1,0x000000,20); 
                
moveTo(0,420); 
                
lineTo(_root.point4._x,_root.point4._y); 
                
lineTo(_root.point3._x,_root.point3._y); 
                
lineTo(760,420); 
                
lineTo(0,420); 
                
beginFill (0xcccccc5); 
                
lineStyle(0.1,0x000000,20); 
                
moveTo(0,0); 
                
lineTo(_root.point1._x,_root.point1._y); 
                
lineTo(_root.point4._x,_root.point4._y); 
                
lineTo(0,420); 
                
lineTo(0,0); 
                
lineStyle(0.1,0x000000,20); 
                
moveTo(760,0); 
                
lineTo(_root.point2._x,_root.point2._y); 
                
lineTo(760,0); 
        } 
        if(
_parent.viewer==0&&_parent.warten==0){ 
        
delete this.onEnterFrame
        } 
}; 
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 09-12-2004, 20:48   #3 (permalink)
Neuer User
 
Benutzerbild von JohnJohnson
 
Registriert seit: Oct 2004
Beiträge: 84
Danke für deine antwort.
der gedanke kam mir auch ziemlich am anfang - hab dieses script dann rausgelöscht und getestet. es lief aber in keinster weise besser.
scheint nicht der haupt-performancekiller zu sein.....
JohnJohnson ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 19:19 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele