ActionScript 3.0 Language and Components Reference
- Cue Points Understanding cue points
Loading images dynamically gives you the ability to change or update the graphic outside of flash.
The code displays how you can load and position an image in ActionScript 3.0 using the Loader class and the URLRequest and center it on the stage.
var myPic:String = "http://www.yoursite.com/images/myPic.jpg"; var urlRequest:URLRequest = new URLRequest(myPic); var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadImg); loader.load(urlRequest); addChild(loader); function loadImg(evt:Event):void { var target_mc:Loader = evt.currentTarget.loader as Loader; target_mc.x = (stage.stageWidth - target_mc.width) / 2; target_mc.y = (stage.stageHeight - target_mc.height) / 2;
The UILoader also dynamically loads GIF, PNG and SWF's into the flash player.
The Multitouch class manages and provides information about the current environment's support for handling contact from user input devices
Webcams can serve as a source of video data that you can use with ActionScript. The Camera class is built into ActionScript allowing you to build applications that include webcams.
import flash.media.Camera;
import flash.media.Video;
var camera:Camera = Camera.getCamera();
if (camera != null) {
myCam.attachCamera(camera);
} else {
trace("You need a camera.");
}
stop();
Camera — final class, package flash.media
Use the Camera class to capture video from the client system's camera.
CAMERA — Constant Static Property, class flash.system.SecurityPanelWhen passed to Security.showSettings(), displays the Camera panel in Flash Player Settings.
CameraRoll — class, package flash.mediaThe CameraRoll class allows you to save image data to a system's "camera roll." AIR profile support: This feature is supported on mobile devices, but it is not supported on desktop operating systems.
Learn how easy it is to track Flash content using the new Google Analytics Tracking For Adobe Flash feature with Brett Crosby, Group Manager Google Analytics, and Matthew McNeely, VP of Engineering at Sprout.
Google Code covers everything you need to know to set up Google Analytics Tracking for Adobe Flash for the Adobe Flash development environment.