404
ActionScript classes
Example
The following code displays the current width, height and FPS of a video instance in a Label
component instance on the Stage. Create a new video instance by selecting New Video from
the Library options menu. Add an instance to the Stage and give it the instance name
my_video
. Add a Label component instance to the Stage and give it the instance name
dimensions_lbl. Then add the following ActionScript to Frame 1 of the Timeline:
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
var dimensions_lbl:mx.controls.Label;
dimensions_lbl.setStyle("fontSize", 9);
dimensions_lbl.setStyle("fontWeight", "bold");
dimensions_lbl.setStyle("textAlign", "center");
dimensions_lbl.text = "width: "+my_cam.width+", height: "+my_cam.",
FPS: "+my_cam.fps;
See also the example for
Camera.setMode()
.
See also
height (Camera.height property)
,
setMode (Camera.setMode method)
capabilities (System.capabilities)
Object
|
+-System.capabilities
public class
capabilities
extends Object
The Capabilities class determines the abilities of the system and player hosting a SWF file,
which lets you tailor content for different formats. For example, the screen of a cell phone
(black and white, 100 square pixels) is different than the 1000-square-pixel color PC screen.
To provide appropriate content to as many users as possible, you can use the
System.capabilities
object to determine the type of device a user has. You can then either
specify to the server to send different SWF files based on the device capabilities or tell the
SWF file to alter its presentation based on the capabilities of the device.
You can send capabilities information using a
GET
or
POST
HTTP method. The following
example shows a server string for a computer that has MP3 support, 1600 x 1200 pixel
resolution, is running Windows XP, and Flash Player 8 (8.0.0.0):
A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t&
SB=f&DEB=t&V=WIN%208%2C0%2C0%2C0&M=Macromedia%20Windows&
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...