Loading a Bitmap A Loader object is a special version of a Sprite that pulls its data from an external source. You need to pair it up with a URLRequest, which handles the network file access. Here is a simple class that loads a single JPG file and places it on the screen. After creating a new Loader and a new URLRequest, we pair them with the load command. The entire process takes only three lines of code. Then, we use addChild to add the Loader object to the stage, just like a normal display object like a Sprite: package { import flash.display.*; import flash.net.URLRequest; public class BitmapExample extends MovieClip { public function BitmapExample() { var loader:Loader = new Loader(); var request:URLRequest = new URLRequest("myimage.jpg"); loader.load(request); addChild(loader); } } } It is positioned in the upper-left corner. Because the Loader object acts like a normal display object, we can also set its x and y position to center it on the sc...
Local shared Objecct are to Flash what cookies are to web browsers but more so. some developers because they allow you to store large amounts of data and store and retrieve.This is mainly using for saving "username" and "Passwords". var example:SharedObject = SharedObject.getLocal( "example" ); The static getLocal( )in shared object are both created and opened for reading. You want to add data to a SharedObject use the following code. // Store a username value to the example shared object. example.data.username = "myname"; You can store several datatypes to the shared object's data property, as follows. example.data.exampleArray = new Array( "a", "b", "c" ); example.data.exampleDate = new Date(); example.data.exampleObject = { key1: "example", key2: -12, key3: null }; You want to save data in a Shared Object to the client computer. var flushResult:String = example.flush( );
These videos are aimed at complete newcomers to programming and are primarily made for pre-university students. You are expected to have an understanding of Flash drawing/animation before completing these tutorials.