Return to Snippet

Revision: 7790
at August 13, 2008 06:49 by 1man


Initial Code
package {
	import flash.display.Sprite;
	import flash.display.Loader;//Allows you to load an external file
	import flash.net.URLRequest;//This is used to reference the external file
	import flash.filters.DropShadowFilter;
	
	public class LoadingMethods extends Sprite {		
		public function LoadingMethods(){
			init();
		}
		private function init():void {
			/**
			Loading
			*/
			var loader:Loader = new Loader();
			loader.load(new URLRequest("kitten.jpg"));
			addChild(loader);
			loader.x = 150;
			loader.y = 150;
			//For the loaded
			var ds2:DropShadowFilter = new DropShadowFilter(10, 45, 0x00ff00,1,3,2);
			var filterArray2:Array = [ds2];
			loader.filters = filterArray2;
			
			/**
			Embedding
			**/
			//This is from importing the image into the lib and exporting for AS.
			var myImage:Kitten = new Kitten();
			addChild(myImage);
			
			//For the embed
			var ds:DropShadowFilter = new DropShadowFilter(10, 45, 0xff0000,1,3,2);
			var filterArray:Array = [ds];
			myImage.filters = filterArray;
		}
	}
}

Initial URL


Initial Description
Two different loading methods for external files.

Initial Title
Loading Methods for External Files

Initial Tags
file

Initial Language
ActionScript 3