Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 02-08-2006, 16:50   #1 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Question function in reie schalten?

hi ich habe 2 functoinen und ich will wenn der mit der einen function fertig ist das der mit der anderen functoin weiter macht wie macht man das am sinnvollsten ?
flozwo ist offline   Mit Zitat antworten
Alt 02-08-2006, 16:52   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Hallo!

Das hängt ja auch von den Funktionen ab bzw. was da genau passiert.
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 02-08-2006, 16:52   #3 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Code:
function a()
{
}
function b()
{
}

a();
b();
Code:
function b()
{
}
function a()
{
   b();
}
a();
sebastian ist offline   Mit Zitat antworten
Alt 02-08-2006, 17:00   #4 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Unhappy

also wenn ich das so
Code:
function b()
{
}
function a()
{
   b();
}
a();
mache dann hängt der sich auch auf.

das sind so meine 2 functionen.

this.MousePan("newLoader");
this.MousePan("stop");
flozwo ist offline   Mit Zitat antworten
Alt 02-08-2006, 17:04   #5 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Das sind deine Funktionsaufrufe, nicht die Funktionen, es ist nämlich
auch nur eine Funktion, die aufgerufen wird. Kannst du mal die
Funktion posten?
sebastian ist offline   Mit Zitat antworten
Alt 02-08-2006, 17:38   #6 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
ja ich weis das es ein ist aber es werde 2 unter schiedlcihe sachen durchgespilet.

Code:
ViewerClass.prototype.MousePan = function(panEvent) 
{
	if(this.gInitialized==true && this.gEnabled==true)
	{
		if(this.gInTransition==false)
		{
			//trace("nicht aktiv-> "+this._initialZoom);
			if (panEvent == "start" && this.gzoom != this._minZoom)
			{
				if(this.gMouseEnabled)
				{
					this.gMouseStartX=_root._xmouse;
					this.gMouseStartY=_root._ymouse;
					this.stopZoomToView();
					this.gCurrentTier_mc.startDrag();
					this.syncTierMotionID = setInterval(this, "syncTierMotion", 1);
					this.setFocus(true);
				}
			}
		}
		if (panEvent == "newLoader") 
		{
			if(this.gMouseEnabled)
			{
					this.gMouseStartX=_root._xmouse;
					this.gMouseStartY=_root._ymouse;
					this.stopZoomToView();
					this.syncTierMotionID = setInterval(this, "syncTierMotion", 1);
					this.setFocus(true);
			}

		}
		if (panEvent == "stop") 
		{
			if(this.gMouseEnabled && this.syncTierMotionID != -1)
			{
				this.gCurrentTier_mc.stopDrag();
				clearInterval(this.syncTierMotionID);
				this.syncTierMotionID=-1;
				
				this.panStop();
				
				if(this._clickZoom && _root._xmouse-this.gMouseStartX < 3 && _root._xmouse-this.gMouseStartX > -3 && _root._ymouse-this.gMouseStartY < 3 && _root._ymouse-this.gMouseStartY > -3)
				{
					var currentZoom=this.getZoom();
					if(currentZoom==-1) 
					{
						currentZoom=this.calculateScreenZoom();
					}
					var testZoom=400;
					while(testZoom > currentZoom)
					{
						testZoom/=2;
					}
					testZoom*=2;
					
					if(testZoom > this._maxZoom)
					{
						testZoom=this._maxZoom;
					}
					var x=0.5-(this.getWindowLeft()+(this.getWindowRight()-this.getWindowLeft())*(_root._xmouse-(this._x-this.gViewWidth/2))/this.gViewWidth);
					var y=0.5-(this.getWindowTop()+(this.getWindowBottom()-this.getWindowTop())*(_root._ymouse-(this._y-this.gViewHeight/2))/this.gViewHeight);

					this.setView(x,y,testZoom);
				}
				this.updateView();
			}
		}
	}
	for(var i=0;i<this.gMouseCallback.length;i++)
	{
		eval(this.gMouseCallback[i])(this,panEvent);
	}
};
flozwo ist offline   Mit Zitat antworten
Alt 02-08-2006, 17:48   #7 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Also da wird ja ein Interval gestartet, in der Funktion syncTierMotion ist
irgendwo eine Bedingung die deinen Anforderungen entsprechen.

Dort einfach this.MousePan("stop"); reinschreiben
sebastian ist offline   Mit Zitat antworten
Alt 02-08-2006, 18:40   #8 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
cool danke ich werde es gleich mal testen =)
flozwo ist offline   Mit Zitat antworten
Alt 02-08-2006, 21:42   #9 (permalink)
Nagelneuer User
 
Benutzerbild von hazy fantazy
 
Registriert seit: Dec 2005
Beiträge: 924
ActionScript:
  1. function b( onComplete: Function)
  2. {
  3.     //...
  4.     onComplete();
  5. }
  6. function a( onComplete : Function )
  7. {
  8.    //...
  9.    onComplete();
  10. }
  11. a( b );

mfg. h
__________________
The fact that you've got "Replica" written on the side of your gun and the fact that I've got "Desert Eagle written on the side of mine ... :D
hazy fantazy 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 13:32 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele