In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: 3D tag cloud for FP10

/**
 * Copyright hacker_umrq_bua ( http://wonderfl.net/user/hacker_umrq_bua )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/qQfS
 */

// forked from peko's 3D tag cloud for FP10
package
{
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.utils.setTimeout;
	
	import gs.TweenMax;
	import gs.easing.Back;
	
	[SWF(width="465", height="465")]
	public class tags extends Sprite {
		
		private var tagsString:String ="Aalborg Universitet	\
Aalesund University College	\
Aberystwyth University	\
Academy IDT	\
Accademia Navale	\
Accademia Navale di Livorno	\
Adulta Oy	\
AGH w Krakowie	\
Ain Shams University	\
Akademia Górniczo Hutnicza	\
Akademia Morska w Szczecinie	\
Alessandro Ventura	\
Alexandria University	\
American School of Classical Studies	\
American University in Cairo	\
American University of Beirut	\
American University of Dubai	\
American University of Sharjah	\
Anadolu Universitesi	\
Anadolu Unversity	\
AngloGold Ashanti Limited	\
Archeologický ústav AV ČR,	\
Architectural Association	\
Arkitekthogskolen i Oslo	\
Arkitektskolen Aarhus	\
Athlone Institute of Technology	\
Atilim Universitesi	\
Belgorod State University	\
Berlin Institute of Technology	\
Berufskolleg der Stadt Köln, BK 10	\
Bilsan Informática	\
Bogazici Universitesi	\
BS Rendsburg GTL	\
Budapest Uni of Technology & Economics	\
C.C.I	\
Caledonian College of Engineering	\
Canterbury College	\
Catholic Education Office	\
Central TAFE	\
Centrale Technische Scholen	\
Centro de Estudios Aeronauticos	\
Centro de Estudios Cientificos	\
Centro de informacion	\
Centro Nacional de Formacion	\
Centros Culturales de Mexico, A.C.	\
Ceska zemedelska univerzita v Praze	\
České vysoké učení technické v Praze	\
CFP Villagio del Ragazzo	\
CFPA de Saint-Nazaire	\
Challenger TAFE	\
Charles Darwin University	\
Christchurch Polytechnic	\
CISITA	\
CISITA	\
City of Westminster College	\
Comitato Regionale Dell'ENFAP	\
Coomera Anglican College	\
Cooperativa FCL	\
Copenhagen University College of	\
Cork Institute of Technology	\
CSA Centro Servizi	\
Curtin University	\
CVUT	\
Cyprus University of Technology	\
De Vakschool Schoonhoven	\
Deakin University	\
Democrition University of Thrace	\
Dokuz Eylul Universitesi	\
Dubai Men's College	\
Dubai Silicon Oasis Authority	\
Dublin Institute of Technology	\
Ecole d'Architecture	\
Ecole Polytechnique d'Orléans	\
Edith Cowan University	\
Eesti Maaülikool	\
Eidg. Forschungsanstalt für Wald,	\
EIVD	\
ELCAD - Infundo Consulting	\
ENFAP	\
English Heritage - Architecture Survey	\
English Heritage Metric Survey Team	\
ENSG	\
EPFL - ENAC-IT1, station 2	\
EPS Edificacion Barcelona	\
Erahariduskeskus	\
ESAT	\
Escola Politecnica Pernambuco	\
Escola Superior de Agueda	\
Escola Superior de Tecnologia e Gestão d	\
Escola Superior Tecnologia E Gestao	\
Escola Universitaria Salesiana de Sarria	\
Escuela de Artes Decorativas	\
Escuela de Sobreestants	\
ESIB-Saint Joseph University	\
Estonian Academy of Arts	\
ETH Zurich	\
ETSAV	\
EUC Vest	\
Fachhochschule Aachen	\
Fachhochschule Biberach/Riss	\
Fachhochschule Bochum	\
Fachhochschule FFM, FB 1	\
Fachhochschule für	\
Fachhochschule Köln	\
Fachhochschule München	\
Fachhochschule Nordwestschweiz	\
Fachhochschule Oldenburg	\
Faculdades Católicas	\
FEDERACION DE EMPRESARIOS	\
FH Braunschweig Wolfsburg	\
FH Gelsenkirchen	\
FH Giessen	\
FH Oberösterreich Studienbetriebs GmbH	\
FH Osnabrück	\
FH Wiesbaden	\
Fundacion Imdea-Agua	\
Fundacion Metal de Asturias	\
Fundación Universidad de las Américas,	\
Gaziantep Universitesi	\
General Directorate of Mil.Survey	\
Geodaetisches Institut RWTH	\
Geodeettinen laitos	\
Georgian Technical University	\
Gewerbeschule III Luebeck	\
Glasgow Caledonian University	\
Glasgow School of Art	\
Graz University of Technology	\
GRETA Avallon Tonnerre	\
Groupe GIMFIM	\
Guilford Young College	\
Haagse Hogeschool	\
HEH - Haute Ecole Du Hainaut	\
Heinrich-Heine-Universität	\
Helsinki Metropolia University of Applie	\
Heriot Watt University	\
Hochschule fur Technik + Wirtschaft	\
Hochschule München	\
Hochschule Ulm	\
Hogeschool INHOLLAND Alkmaar	\
Hogeschool Larenstein	\
Hogeschool Rotterdam	\
Hogeschool voor Arnhem en Nijmegen	\
Hogeschool Windesheim	\
Hogeschool Zuyd	\
Högskolan i Gävle	\
Høgskolen i Akershus	\
Høgskolen i Bergen	\
HRAKK	\
Hvanneyri	\
HWK Oberfranken	\
I.E.S. As Fontiñas	\
IBBS, Universität Leipzig	\
Informatica Quinta Generacion SL	\
Ingeniørhøjskolen i Århus	\
Insa	\
Insitiute of anthropological & spatial	\
Inspired Interfaces Ltd.	\
Institut IGH	\
Instituto de Estudios Superiores	\
Instituto Politecnico de Leiria	\
Instituto Presbiteriano Mackenzie	\
Instituto Professionale	\
IST - MARETEC	\
Istituto Nazionale di	\
ITESM	\
ITESO AC	\
Joensuun yliopisto	\
Johannes Gutenberg Universitat Mainz	\
JSCSC (defence academy)	\
Jubail Technical Institute	\
Kabinet Modelového Projektování	\
Katholieke Universiteit Leuven	\
Katholieke Universiteit Leuven	\
Kehtna Economy and	\
Kemi-Tornio Polytechnic	\
Kiev National University	\
King Abdul Aziz University	\
King Khalid University	\
Københavns Tekniske Skole	\
Krajinak o.s.	\
Krajinak o.s.	\
Kunsthøgskolen i Oslo	\
Kuwait University	\
Kwame Nkrumah University of Science	\
Laboratorio Nacional de Engenharia Civil	\
Landesamt für Denkmalpflege	\
Landesdenkmalamt	\
Leeds City College	\
Leibniz Universität Hannover	\
Liceo scientifico F. Cecioni	\
Logodata - PCS	\
London Metropolitan University	\
London South Bank University	\
Loughborough University	\
Luleå tekniska universitet	\
Manchester Metropolitan University	\
Mendeleev University	\
Mendelova univerzita v Brně	\
Middle East Technical University	\
MORAVSKÉ ZEMSKÉ MUZEUM	\
Moscow Bauman University	\
Moscow State Building University (MGSU)	\
Moscow State Mining University	\
Moscow State University	\
N.T.U.A	\
Nackademin Yrkeshögskola	\
Napier University	\
National Assembly for Wales	\
NC Computercad	\
NHTV Breda	\
Northumbria University	\
North-West University	\
Nottingham Trent University	\
NTNU	\
NUI Maynooth	\
Omsk State Technical University	\
Ordnance Survey Research	\
Oslo University College	\
Ostravska Universita	\
Oulu Polytechnic	\
Oxford Brookes University	\
Panevezys College	\
Państwowa Wyższa Szkoła Zawodowa	\
Pärnumaa Kutsehariduskeskus	\
Peabody Trust - Finance Department	\
Pedagogical Institute of Salzburg	\
Pluskompetens Utbildning I	\
Plymouth Marine Laboratory	\
Politechnika Krakowska	\
Politechnika Poznańska	\
Politechnika Warszawska	\
Politechnika Wrocławska	\
Politecnico di Milano	\
Politecnico di Torino	\
Pontificia Universidad Javeriana	\
Port Macquarie TAFE	\
Public University of Navarre	\
Rheinisches Amt für Denkmalpflege	\
RIGA Technical University	\
RMIT-Spatial Info. Architecture 	\
RU - Radboud Universiteit	\
RWTH Aachen	\
SAICE	\
Saint Ignatius' College - Riverview	\
Saint Stephen's College	\
SAV Archeologicky ustav	\
Saxion Hogeschool Enschede	\
Scheppersinstituut	\
Sheffield Hallam University	\
Shenkar College	\
Siberian Federal University	\
Siberian State Academy of Geodesy	\
Slovenska technicka univerzita	\
Sør-Trøndelag University College	\
Southampton Solent University	\
SPŠ Stavební	\
SPS Zememericka	\
Staatliche Gewerbeschule G17	\
Stredni odborná skola elektrotechnika	\
Surgut Oil & Gas Institute	\
Swansea University	\
Swedish University of Agricultural Scien	\
Taideteollinen korkeakoulu	\
Tallinn College of Engineering	\
Tallinna Tehnikaülikool	\
Tampere University of Technology	\
Tartu Ülikool	\
Technical University of Constructions	\
Technical University of Denmark	\
Technische Fachhochschule Berlin	\
Technische Universitaet Wien	\
Technische Universitat Braunschweig	\
Technische Universität Chemnitz	\
Technische Universitat Darmstadt	\
Technische Universität Graz	\
Technische Universität München	\
Technische Universität Wien	\
Technische Universiteit Eindhoven	\
Teken Techniek	\
Teknillinen korkeakoulu	\
Teknologisk Institut	\
The Aristotle University	\
The London College	\
The Scots College	\
Tomas Bata University	\
Tomsk Polytechnic University	\
Tomskiy Politechnical University	\
Trakhees-PCFC - 	\
TU Bergakademie Freiberg	\
TU Bergakademie Freiberg	\
TU Berlin Fak. 6, Sekr. A16	\
TU Clausthal	\
TU Darmstadt	\
TU Delft	\
TU Dresden Fakultaet Architektur	\
TU München	\
TU Munich	\
Turun Ammatti-Instituutti	\
Tyumen State Oil and Gas University	\
U.P.C. Arquitectura de Barcelona	\
UIA	\
UNESP -Universidade Estadual Paulista	\
Uni Bonn	\
União Brasileira de Educação e Cult	\
UNITAU Univ de Taubate	\
Univ. Algarve - Esc. Sup. Tec.	\
Univ. Aut. Cd. Juarez Chih	\
Univ. Catolica de San Antonio	\
Univ. León - Serv.Cartografia	\
Universidad Anahuac	\
Universidad Autonoma de Puebla	\
Universidad Autonoma de San Luis Po	\
Universidad Autonoma Metropolitana	\
Universidad de Barcelona	\
Universidad de Cantabria	\
Universidad de Castilla la Mancha	\
Universidad de Chile	\
Universidad de Guadalajara	\
Universidad de Jaen	\
Universidad de la Rioja	\
Universidad de La Salle	\
Universidad de las Palmas de Gran Canari	\
Universidad de los Andes	\
Universidad de Oviedo	\
Universidad de Salamanca	\
Universidad de Santiago	\
Universidad de Valencia	\
Universidad de Vigo	\
Universidad Distrital	\
Universidad Libre de Pereira	\
Universidad Marista de Mérida AC	\
Universidad Mayor	\
Universidad Miguel Hernandez	\
Universidad Nacional de Rosario	\
Universidad Politecnica de Madrid	\
Universidad Politecnica de Valencia	\
Universidad Pontificia Bolivariana	\
Universidad Publica de Navarra	\
Universidad Tecnologica Nacional	\
Universidade de Coimbra	\
Università degli studi di Cagliari	\
Università di Bologna	\
Università di Brescia	\
Universita di Genova	\
Università di Pisa	\
Universita di Trieste	\
Universita Roma Tre, Architettura	\
Universitat de Girona	\
Universität Hohenheim	\
Universität Innsbruck	\
Universität Karlsruhe	\
Universität Karlsruhe (TH)	\
Universität Stuttgart	\
Universität Würzburg Rechenzentrum	\
Universite de Nantes	\
Universite Jean Moulin Lyon 3	\
Universiteit Gent	\
Universitetet i Oslo	\
University College Cork	\
University College London	\
University Liverpool, Architecture	\
University Minho	\
University of Applied Arts	\
University of Applied Sciences	\
University of Auckland	\
University of Balamand	\
University of Bath	\
University of Belgrade	\
University of Brighton	\
University of Cambridge	\
University of Cape Town	\
University of Central Lancashire	\
University of Durham	\
University of East London	\
University of Glamorgan	\
University of Helsinki	\
University of Johannesburg	\
University of Latvia	\
University of Leeds	\
University of Life Sciences	\
University of Lincoln	\
University of Ljubljana	\
University of Melbourne	\
University of Natal	\
University of New South Wales	\
University of Newcastle upon Tyne	\
University Of Nottingham	\
UNIVERSITY OF PADUA	\
University of Patras	\
University of Queensland	\
University of Salford	\
University of Sarajevo	\
University of Sheffield	\
University of Sunderland	\
University of Surrey	\
University of Sydney	\
University of Technology - Sydney	\
University of Teeside	\
University of the Witwatersrand	\
University of Thessalia	\
University of Ulster	\
University of west Hungary	\
University of Western Sydney	\
University of Westminster	\
University of Witwatersrand	\
University of Zagreb	\
Univerzita Pardubice	\
Uniwersytet Przyrodniczy	\
Uniwersytet Przyrodniczy w Lublinie	\
Uniwersytet Rolniczy	\
Uniwersytet Warmińsko-Mazurski	\
Uppsala Universitet	\
Ural State Technical University	\
Ústav archeologické památkové	\
Vaasa University of Applied Sciences	\
Vasarhelyi Pal	\
VIA University College	\
Victoria University	\
VITO Hoogstraten	\
Volgograd State	\
Vysoka Skola Banska - Technical	\
VYSOKÁ ŠKOLA BÁŇSKÁ - TECHNICKÁ	\
Vysoké Učení Technické v Brně	\
VZW Don Bosco Onderwijscentrum	\
Wellington Institute of Technology	\
Welsh School of Architecture	\
Western Sydney Institute	\
Wollongong TAFE	\
Woodleigh School	\
Wydział Inżynierii Lądowej	\
Wyższa Szkoła Humanistyczna	\
Z&P Schulung	\
Zespół Szkół Budowlanych	\
Zilinska univerzita	\
Zoning Authority Development Control Dep	\
";
		private var tagNamesArray:Array = tagsString.split(" ");
		private var tagsArray:Array = []
		
		
		public function tags() {
			super();
			addEventListener(Event.ADDED_TO_STAGE, function (e:Event):void {
				stage.scaleMode = StageScaleMode.NO_SCALE;
				stage.align = StageAlign.TOP_LEFT;
				
				for each (var tagName:String in tagNamesArray) {
					var tag:Sprite = new Sprite;
					var t:TextField = new TextField;
					t.defaultTextFormat = new TextFormat("Trebuchet MS", 20, 0x888888);
					t.text = tagName;
					t.autoSize = TextFieldAutoSize.LEFT;
					t.selectable = false;
					t.x = -t.width/2;
					t.cacheAsBitmap = true;
					tag.addChild(t)
					addChild(tag)
					tagsArray.push(tag);
				}
				
				setTimeout(function():void {for (var i:int = 0; i<30; i++) foolAround()}, 1000);
				//setTimeout(function():void {Wonderfl.capture(stage)}, 30000);
				stage.addEventListener(Event.RESIZE,resize);
				resize();
				stage.addEventListener(MouseEvent.MOUSE_MOVE, function(e:MouseEvent):void {
					var xx:Number = mouseX/stage.stageWidth -0.5;
					var yy:Number = mouseY/stage.stageHeight-0.5;
					for each (var t:Sprite in tagsArray ) {
						t.rotationY =  -xx*45 + 30*t.getRect(t).x/stage.stageWidth;
						t.rotationX =   yy*45 - 30*t.getRect(t).y/stage.stageHeight;
					}
				});
			});
		}
		
		public function resize(e:Event = null):void {
			for each (var t:Sprite in tagsArray ) {
				t.x = stage.stageWidth/2;
				t.y = stage.stageHeight/2;
				t.getChildAt(0).x = stage.stageWidth  *(Math.random()-Math.random());
				t.getChildAt(0).y = stage.stageHeight *(Math.random()-Math.random());
				t.getChildAt(0).z = Math.random()*1000;
				t.getChildAt(0).alpha = 0.5+(1- t.getChildAt(0).z/1000)/2;
			}
		}
		
		public function foolAround():void {
			var zz:Number = Math.random()*1000;
			var i:int = Math.floor(Math.random()*tagsArray.length);
			TweenMax.to(
				tagsArray[i].getChildAt(0), 
				Math.random()*5+2,
				{
					ease:Back.easeInOut,
					
					x: stage.stageWidth  *(Math.random()-Math.random()),
					y: stage.stageHeight *(Math.random()-Math.random()),
					z: zz,
					alpha:0.5+(1- zz/1000)/2,
					
//					blur: {blurX: zz/100, blurY: zz/100},
					
					onComplete: foolAround
					
//					onUpdateParams: [i],
//					onUpdate: onUpdate
					
				}
			);
		
		}
		
		public function onUpdate(...arguments):void {
			var i:Number = arguments[0];
 			var r:Rectangle = tagsArray[(i+1) < tagsArray.length ? i+1 : 0].getChildAt(0).getBounds(tagsArray[i]);
 			var g:Graphics = tagsArray[i].graphics;
 			g.clear();
 			g.lineStyle(1,0,0.5);
 			g.lineTo(r.x, r.y);
		}
		
	}
}