All pastes #468847 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-03 12:26 UTC
rendered paste body
		/**
		 * Bewegt die Bilder von links nach rechts
		 * in einer Endlosschleife.
		 * 
		 * @param	event
		 * 
		 */
		private function handleEnterFrame(event:Event):void 
		{
			// wenn nicht pausiert..
			if(!Thumb.pause)
			{
				// pool durchlaufen..
				for(var i:Number = 0; i < pool.length; i++)
				{
					// wenn letzes element...
					if(i == pool.length - 1 || pool.length == 1)
					{
						if(pool[i].clip.x >= 0)
						{
							// nächstes holen
							var next:Object = images.shift();
							
							// adden
							var clip:Sprite = imageHolder.addChild(next.clip);
							
							// positionieren
							clip.x = (clip.width + 1) * -1;
							
							// clip ersetzen
							next.clip = clip;
							
							// pool anhängen
							pool.push(next);
						}
					}
					
					// wenn erstes element...
					if(i == 0)
					{
						// wenn ausserhalb der bühne...
						if(pool[i].clip.x >= parent.stage.stageWidth)
						{
							// löschen
							imageHolder.removeChild(pool[i].clip);
							
							// images wieder anhängen
							images.push(pool.shift());
							
							// beenden
							break;
						}
					}
					
					pool[i].clip.x += 2;					
				}
			}
		}