Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 24-04-2006, 12:31   #1 (permalink)
Neuer User
 
Registriert seit: Oct 2003
Beiträge: 100
Animation - wie würdet ihr das anfangen??

Hallo,

ich habe folgende Aufgabe:

280 Fotos sollen nacheinander eingeblendet werden, sie werden zunächst mit 100 % Ihrer Größe eingeblendet und werden dann immer kleiner und verblassen, so, als ob Sie nach hinten verschwinden.

Dabei soll Ihre Bewegung nicht jedesmal komplett gleich sein, sondern etwas variieren. (Zum Beispiel ob es nach hinten links oder rechts oben verschwindet etc.)

Da ich die Animation sonst händisch machen müsste, was wirklich eine Höllen-Arbeit ist, such ich nach einer Möglichkeit, das zu programmieren.

Wie könnte man eine solche Animation skripten??

Danke für Tips und Hilfe!
Seraphim ist offline   Mit Zitat antworten
Alt 24-04-2006, 14:33   #2 (permalink)
oEF(etischist)
 
Registriert seit: Dec 2003
Ort: muc
Beiträge: 664
onEnterFrame oder setInterval anschauen
_x und _y, sowie _xscale und _yscale anschauen
random-Funktion anschauen
Und die Tween-Klasse von Flash mal anschauen (*Name vergessen*)
__________________
Grüße,
solo

Die Antwort auf fast alle Fragen gibt es hier: AS-Referenz
Weitere Fehlerquellen sind:
Flasche Pfadangeben oder falsch versorgte Variablen. Beides kann man gut hiermit überprüfen.
Und den Debugger gibts ja auch noch :)
soloFlash ist offline   Mit Zitat antworten
Alt 25-04-2006, 20:27   #3 (permalink)
Neuer User
 
Registriert seit: Oct 2003
Beiträge: 100
Ich habe diese Slideshow hier bei flashkit gefunden, die hervorragend funktioniert und eigentlich schon fast zu viele Funktionen und Parameter bietet.

Wenn mir jemand sagen könnte, wie ich nun die Bilder (soweit ich das Skript verstehe, werden die Bilder immer in Instanzen des MCs "dropzone"+i geladen) nach hinten "weggehen" lassen also verkleinern kann, während sie ausblenden??

Code:
// Loop through all the images that have been loaded into the
// slideshow

for(var i=1; i<=numImages; i++){
	
	// Check to see if see if 'i' matches the current image to be shown
	if(i == _root.currentImage){
		
		// Check to see if the image to be shown is loaded or not
		if(_root["image_dropzone" + _root.currentImage].getBytesLoaded() >= _root["image_dropzone" + _root.currentImage].getBytesTotal()){
			
			// Check to see if the image to be shown is to high for the slideshow
			if(this["image_dropzone" + _root.currentImage]._height > (_root.movie_height - 20)){
				
				// Resize the image, by measuring height, to fit the slideshow
				var percent = 100 * ((_root.movie_height - 20) / this["image_dropzone" + _root.currentImage]._height);
				this["image_dropzone" + _root.currentImage]._xscale = percent;
				this["image_dropzone" + _root.currentImage]._yscale = percent;
			}
			
			// Check to see if the image to be shown is to wide for the slideshow
			if(this["image_dropzone" + _root.currentImage]._width > (_root.movie_width - 20)){
				
				// Resize the image, by measuring width, to fit the slideshow
				var percent = 100 * ((_root.movie_width - 20) / this["image_dropzone" + _root.currentImage]._width);
				this["image_dropzone" + _root.currentImage]._xscale = percent;
				this["image_dropzone" + _root.currentImage]._yscale = percent;
			}
			
			// Check to see if the image has been shown yet
			if(_root.imageShown == 0 && _root.currentImage != _root.oldImage){
				
				// Show the image and prep it for fading
				this["image_dropzone" + _root.currentImage]._visible = true;
				this["image_dropzone" + _root.currentImage]._alpha = 0;
				_root.imageShown = 1;
				
			// If the image has already been shown and preped
			} else {
				
				// Check to see if the images needs to be faded in
				if(_root.currentImage != _root.oldImage && _root.fade > 0){
					
					// Fade in the image
					this["image_dropzone" + _root.currentImage]._alpha = 100 * (_root.counter / (_root.fade * _root.second));
					
				// If the image does not need to be faded in
				} else {
					
					// Show the image
					this["image_dropzone" + _root.currentImage]._alpha = 100;
				}
				
				// Move the image to the middle of the slideshow screen
				this["image_dropzone" + _root.currentImage]._x = (_root.movie_width - this["image_dropzone" + _root.currentImage]._width) / 2;
				this["image_dropzone" + _root.currentImage]._y = (_root.movie_height - this["image_dropzone" + _root.currentImage]._height) / 2;
				
				// Check to see if captions should be shown
				if(_root.captions == true || _root.captions == "true"){
					
					// Make the captions box visible and load the caption text for the current image
					_root.caption._visible = true;
					_root.caption.tb_caption.text = xmlData.slideshow[1].images[i-1].image[1].caption.value;
					
				// If captions should not be shown
				} else {
					
					// Hide the captions box
					_root.caption._visible = false;
				}
				
				// Swap depths of caption box to make sure its on top of the current image shown
				_root.caption.swapDepths(numImages + 3);
			}
			
		// If the current image has not been fully loaded, hide it
		} else {
			this["image_dropzone" + i]._visible = false;
		}
		
	// Check to see if 'i' is the old image
	} else if(i == _root.oldImage && _root.fade > 0){
		
		// Fade the old image out
		this["image_dropzone" + _root.oldImage]._alpha = 100 - (100 * (_root.counter / (_root.fade * _root.second)));
		
	// If 'i' is not the current image or the old image, hide image 'i'
	}  else {
		this["image_dropzone" + i]._visible = false;
	}
}

// Increment the counter
_root.counter++;

// Check to see if the counter has exceeded the fade and time to show the image
if(_root.counter > ((_root.time + _root.fade) * _root.second)){
	
	// Reset the counter
	_root.counter = 0;
	
	// Set the current image as the old image
	_root.oldImage = _root.currentImage;

	// Increment the current image
	_root.currentImage++;
	
	// Check to see if the current image exceeds the number of images in the slideshow
	if(_root.currentImage > numImages){
		
		// Check to see if the slideshow should be repeated
		if(_root.repeat){
			
			// Set the current image back to the beginning
			_root.currentImage = 1;
			
		// If the slideshow is not to be repeated, hold on the last image
		} else {
			_root.currentImage = _root.numImages;
		}
	}
	
	// Set the current image as not shown
	_root.imageShown = 0;
}
Habe nach der "Tween"-Klasse gesucht, aber nichts gefunden. Kann mir jemande helfen?

Danke,
Philipp
Seraphim ist offline   Mit Zitat antworten
Alt 26-04-2006, 21:36   #4 (permalink)
Neuer User
 
Registriert seit: Oct 2003
Beiträge: 100
Kann mir nicht jemand helfen, wie die Programmierung aussehen müsste, um den MC "meinmc_1" innerhalb von 2 Sekunden zu verkleinern und auszublenden?
Seraphim 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 09:16 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele