|   | 
								SWiSH Forum Forum użytkowników programów SWiSH | 
								  | 
							 
						 
						 
						
						Skrypty do programu SWiSH2 i SWISHmax - Spin Gallery help! Wypas!! 
						
												 Han - Wto 26 Sie, 2008 08:43 Temat postu: Spin Gallery help! Wypas!! Witam. Od kilku dni szukalem skryptu fajnego menu typu spin    i znalazlem swietne jednak z moja wiedza (lub jej brakiem) nie bardzo umiem to przelozyc na swisha     podaje link do lookniecia sobie jak to wypasnie wyglada http://www.reflektions.co...link.asp?id=214
 
 
natomiast tutaj wklejam AS ktory jest zawarty na owej stronie. Prosba moja jest dosc oczywista    Czy ktos umialby to przelozyc na swi? pozdrawiam    TYLKO BŁAGAM nie piszcie ze w swishu sie tego zrobic nie da   
 
 
// import blur filter
 
import flash.filters.BlurFilter;
 
 
var numItems = 7; 				// Number of items    		
 
var focalLength = 500;			// environmental constant				
 
var centerX = Stage.width/2;	// Stage Center X
 
var centerY = Stage.height/2;	// Stage Center Y
 
var shiftAmount=0;				// Amount to shift for rotation
 
var selectedMC = 0;				// currently in front of user
 
var radius = 200;				// circle radius 
 
var maxSpeed = 80;				// circle animation speed
 
 
// Create 3D camera
 
this.initCamera = function(){
 
	
 
	// create camera object
 
	this.oCamera = new Object();
 
	
 
	// Set camera Properties  									
 
	this.oCamera.z = focalLength;  		// target camera z position
 
	this.oCamera.dz = 0;				// initial camera z position					
 
	this.oCamera.s = 10;				// camera zoom speed
 
 
	this.onEnterFrame = function(){
 
		// Move Camera
 
		with(this.oCamera){
 
			dz += (z-dz)/s;					
 
		}
 
		// shift angle of all clips
 
		shiftAmount = ( this["instance_mc_"+selectedMC].angle - 90)/maxSpeed;
 
	}
 
	
 
	// loop and create the numer of instances defined
 
	for(var i = 0; i<numItems;i++){
 
		
 
		// choose between 4 labrary items
 
		var itmeClip = random(4);
 
		
 
		// attach movie adn assign to variable
 
		clip =this.attachMovie(itmeClip, "instance_mc_"+i,i);
 
		
 
		// define initial properties	
 
		clip.x = 0;					 // initial x position
 
		clip.y = 0;		 		 // initial y position
 
		clip.angle = i*(360/numItems);	 // initial item angle
 
		
 
		// Add Blur
 
		var blur = new BlurFilter();
 
		clip.tempFilter = clip.filters;
 
		clip.tempFilter.push(blur);
 
		
 
		/// render
 
		clip.onEnterFrame = function(){
 
			
 
			// shift angle by adding value of x mouse position
 
			this.angle += (_xmouse - centerX)/maxSpeed;
 
 
			// prevents to go over 360 back to 0
 
			this.angle%=360;
 
			// prevent to go under 0 back to 360
 
			this.angle = (this.angle<0) ? 360 : this.angle;
 
			
 
			// Transform angle degrees to radian value
 
			var radian = (this.angle*Math.PI/180);
 
 
			// Calculate x position value
 
			this.x =   Math.cos(radian) * radius;
 
			// Calculate z position value
 
			this.z  = centerY - Math.sin(radian)*radius; 
 
			// tilt y position to reflect 3D
 
			this.y  = _root.yscroll * Math.sin(radian) - 50;
 
 
			// Calculating actual scale values according to scale = dz/(z+dz) formula
 
			var scale = (this._parent.oCamera.dz - _root.zscroll*5)/(focalLength+this.z);
 
			
 
			// Position
 
			this._x = (this.x*scale) + centerX;
 
			this._y = (this.y*scale) + centerY;
 
			
 
			// set perspective adjustement
 
			var adj = (this.z*12)/radius;
 
			
 
			// set size
 
			this._xscale = this._yscale = (scale*100)-adj;
 
			
 
			// Swap depths 
 
			this.swapDepths(scale*100);
 
			
 
			// alpha
 
			this._alpha = scale*100;
 
			
 
			// blur (max quality is 15)
 
			this.tempFilter[0].quality = 15 - (scale*100/5.2);
 
			this.filters = this.tempFilter;
 
		
 
		}
 
	}
 
}
 
 
// Initiate	instances in Camera
 
initCamera();	
 
		
 
stop();
 
 
/*
 
________________________________________________
 
2006, All rights reserved
 
Paul Ortchanian San Francisco CA
 
paul@reflektions.com
 
 
This code is free; you can redistribute it and/or modify
 
it under the terms of the GNU General Public License as 
 
published by the Free Software Foundation.
 
________________________________________________
 
*/
 
 
 
 
Moje drugie pytanie dotyczy tego ze gdzies sie natknalem na filtr flasha ktorego nie znam    nazywa sie matrix i wyglada naprawde ladnie (przynajmniej tak sie nazywa w programie 3d flash animator -> tam sample script -> blur 1 i blur 2) czy ktos wie jak go uzywac?
												 sl01k - Wto 26 Sie, 2008 09:44
  http://www.swishzone.com/...ed&link_id=2365 tu masz cos podobnego ... w swishu
												 Han - Wto 26 Sie, 2008 10:04
  nooo powiem szczerze nie wyglada to zle!dzieki sl01k, ale moze ktos by zrobil jednak tamto    przyda sie nie tylko mi ale i potomnym    pomysl sl01k nie zostanie jako alternatywa
 
 
 
EDIT: poza tym ja chcialbym zamiast napisow wstawic ikonki... a widze ze po ich wstawieniu one sie obracaja co wyglada... nieladnie     dlatego wolalbym tamten blurowy 
 
 
[ Dodano: Pon 01 Wrz, 2008 15:32 ]
 
jakos sobie radze z ta animacja    tzn zrobilem sobie cos podobnego     ale mam prosta prosbe do kogos milego    potrzebuje pliku swi z kwadracikiem po srodku animacji po bokach (lewo i prawo) guziki. Kwadracik ma efekt "przesuń" powiedzmy 30 klatkowy o 300pix w prawo i na starcie animacja kwadratu jest zatrzymana na klatce 15 (po srodku). Jezeli nacisnie sie i przytrzyma guzik prawy to kwadracik sie przesuwa w prawo a jezeli lewy to w lewo. Fajnie by bylo gdyby dzialalo to na zasadzie nextframeandplay czy cos takiego    a nie na _x=wartosc. dziekuje z gory jak malo ktory   
												 
					 | 
				 
			 
		 |