Macromedia Flash 8-components Language Reference
|
|
Bookmark Macromedia Flash 8-components Language Reference |
ActionScript 2.0 language reference for Macromedia Flash 8 [Book]By Francis Cheng - Macromedia Press (2006) - Paperback - 1370 pages - ISBN 0321384040
The "ActionScript 2.0 Language Reference for Macromedia Flash 8" is a comprehensive reference manual that describes the application programming interface (API) for Macromedia Flash Player, the most pervasive client runtime environment in the world. It includes valuable syntax and usage information; detailed descriptions of classes, functions, properties, and events; and copy-and-paste code samples for every element in the ActionScript language. The "ActionScript 2.0 Language Refer... Read more [ Report abuse or wrong photo | Share your Macromedia Flash 8-components Language Reference photo ]
Manual
Download
(English)Macromedia Flash 8-components Language Reference, size: 10.5 MB |
Macromedia Flash 8-components Language Reference
User reviews and opinions
| basillefe |
5:52am on Sunday, October 24th, 2010 ![]() |
| Music Skipped The card was faster than my Sandisk Class 2 16BG card. Very Fast MicroSD card I think if anyone owns an Android phone, they should upgrade to a class 6 micro sd card. | |
| behraad |
8:21am on Wednesday, October 6th, 2010 ![]() |
| "First dlsr, sony a200 and this works very well. When I use the camera in jpj. mode I can shoot and store up to 990 pictures. "I have been using this guy for more than a year now Closer to 2 i think. I spend a lot of time in the great outdoors, and up in Northern Minnesota. | |
| User10293 |
9:12am on Friday, October 1st, 2010 ![]() |
| Been using for over a month now and absolutely love the boost in performance this offers my gaming laptop. for SDHC to work in a wii you need firm 4.0 or higher holds a bunch of games in my soft modded wii, roms ect tad slow | |
| Bruce Hicks |
11:09pm on Wednesday, July 14th, 2010 ![]() |
| I used digital camara. Easy To Use Capability Issues Easy to find and order product - company is great. Easy To Use","Reliable Performance None Amazing what the mediaware can offer these days. This is fast, and value for the money is excellent. | |
| cris59 |
4:17am on Saturday, July 10th, 2010 ![]() |
| Keep making good stuff What can I say. Keep fitting more data onto little devices like this and the hard drive will one day be obsolete. Oh. Very fast works amazing for GBA EMU carts. Games I play from my gba4two are faster than actually using the real carts thanks to this memory card. | |
| ohenneberg |
7:13am on Saturday, July 3rd, 2010 ![]() |
| If all the cards come with the same product packaging, then it is a little hard to open without a scissor! Everything is well made. the ultra is 5 times faster than the regular memory cards, its great if you dont want to miss a moment. | |
| m4rk_ugc |
6:11am on Saturday, May 29th, 2010 ![]() |
| I just got a new Digital SLR Camera, 15.1 megapixels. This card writes and reads those large files great. Writes/Reads fast Long Cycle This product is great exactly what i was looking for fast and a lot of space.. i use this product in my camcorder in it works perfect... Easy To Use,... It works just fine with a Canon underwater camera. I bought two of these and have had no problems. Large Capacity | |
| Markpatterson557 |
7:03pm on Thursday, April 22nd, 2010 ![]() |
| Holds quite a heavy lot of stuffs. I really doubt if carrying music or instant storing can get easier than this. WE PURCHASED A NEW CAMERA AND MEMORY CARD. WHILE WE ENJOY BOTH ITEMS NOW. I use these cards in my Nikon D90 and they work perfectly. Gives me about 350 exposes RAW+JPEG(fine), and video looks very smooth.... | |
| agoldenquill |
6:28am on Wednesday, March 31st, 2010 ![]() |
| cheap Bought 3 all failed replace all failed again low price, good performance, CF Type I versatility not USB enabled (for use in JumpShot ect.), actual capacity Super Fast None what so ever | |
Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.
Documents

falseDisabledIconEmphasized The icon disabled state of an emphasized button. trueUpIconEmphasized trueOverIconEmphasized trueDownIconEmphasized trueDisabledIconEmphasized
The icon toggled state of an emphasized button. The icon over-toggled state of an emphasized button. The icon pressed-toggled state of an emphasized button. The icon disabled-toggled state of an emphasized button.
The default value for all skin properties ending in Skin is ButtonSkin, and the default for all Icon properties is undefined. The properties with the Skin suffix provide a background and border, whereas those with the Icon suffix provide a small icon.
In addition to the icon skins, the Button component also supports a standard icon property. The difference between the standard property and style property is that through the style property you can set icons for the individual states, whereas with the standard property only one icon can be set and it applies to all states. If a Button instance has both the icon property and icon style properties set, the instance may not behave as anticipated. To see an interactive demo showing when each skin is used, see Using ActionScript 2.0 Components Help.
Using ActionScript to draw Button skins
The default skins in both the Halo and Sample themes use the same skin element for all states and draw the actual graphics through ActionScript. The Halo implementation uses an extension of the RectBorder class and some custom drawing code to draw the states. The Sample implementation uses the same skin and the same ActionScript class as the Halo theme, with different properties set in ActionScript to alter the appearance of the Button. To create an ActionScript class to use as the skin and provide different states, the skin can read the borderStyle style property of the skin and emphasized property of the parent to determine the state. The following table shows the border style that is set for each skin:
To create an ActionScript customized Button skin:
import mx.skins.RectBorder; import mx.core.ext.UIObjectExtensions; class RedGreenBlueSkin extends RectBorder { static var symbolName:String = "RedGreenBlueSkin"; static var symbolOwner:Object = RedGreenBlueSkin;
function size():Void { var c:Number; // color var borderStyle:String = getStyle("borderStyle"); switch (borderStyle) { case "falseup": case "falserollover": case "falsedisabled": c = 0x7777FF; break; case "falsedown": c = 0x77FF77; break; case "trueup": case "truedown": case "truerollover": case "truedisabled": c = 0xFF7777; break; } clear(); var thickness = _parent.emphasized ? 2 : 0; lineStyle(thickness, 0, 100); beginFill(c, 100); drawRect(0, 0, __width, __height); endFill(); } // Required for skins. static function classConstruct():Boolean { UIObjectExtensions.Extensions(); _global.skinRegistry["ButtonSkin"] = true; return true; } static var classConstructed:Boolean = classConstruct(); static var UIObjectExtensionsDependency = UIObjectExtensions; }
Provide a drill-down mechanism for detailed data. The DataGrid component interface allows users to search quickly so that they can search for more details. Provide only the data needed to perform the initial search, and.detailed information for any particular row or cell can be provided in a second search step. This process minimizes not only the initial data required to fill the data grid but also minimizes the amount of information that users must read to locate what they are looking for. When a row or item of interest is selected in the data grid, a second call can be made to the data source to get related details. Those details can be appear better in some other UI mechanism, such as a collection of multiline text fields and graphics.
Avoid cycles of data manipulation between the data source and the data grid. If it is possible, and if it meets long-term database needs, storing the data in much the same format and order in which it appears can avoid unnecessary memory allocation and processing time on the users computer and speed up data-grid response time.
Avoid queries that return every row in the database. Users rarely want to see every record that is available every time they access the data. Its important to understand what the consumers of your data are looking for and give them the means to narrow down their search. If they usually look only at the most recent records for a given week for a particular subject, display that smaller group of data as a default, with the ability to widen the view of the data. Consider paging potentially large amounts of data to limit its size by providing a subset of data that might normally be returned from a query. For instance, rather than viewing all 10,000 rows of data that might be returned by a query from your database, a subset of the first 20 rows might be called for, and additional navigation buttons might trigger a call to fill the data grid with the next 20 records.
Separate data processing from CellRenderer processing. The CellRenderer API lets you display custom cell content in a data grid. A functional requirement might require that you populate the data grid with a ComboBox component or other UI control conditionally. For example, based on a selection in column two, you may repopulate or auto-select options in column four. Whenever possible, it is important to separate this conditional logic and repopulating of controls from the process of rendering the content of the cell. Each time the mouse rolls over the cell, the cell is selected, or data is changed, the content of the cell or the entire cell is likely to be redrawn to keep it up to date. This means that any code you put in CellRenderer is run over and over again, so you should keep processing in CellRenderer as light as possible. If you do have to add code to CellRenderer, it is better to call a function from CellRenderer that detects what updates need to be made and makes them in the most efficient manner.
myDP.removeItemAt(3);
DataProvider.replaceItemAt()
myDP.replaceItemAt(index, item)
A number greater than or equal to 0. This number is the index of the item to change.
An object that is the new item.
Method; replaces the content of the item at the specified index. This method triggers the modelChanged event with the event name updateItems.
This example replaces the item at index 3 with the item labeled new label:
myDP.replaceItemAt(3, {label : "new label"});
DataProvider.sortItems()
myDP.sortItems([compareFunc], [optionsFlag])
A reference to a function that compares two items to determine their sort order. For more information, see the Array.sort() method in ActionScript 2.0 Language Reference. This parameter is optional. Lets you perform multiple, different types of sorts on a single array without having to replicate the entire array or resort it repeatedly. This parameter is optional. The following are possible values for optionsFlag:
which sorts highest to lowest. which sorts case-insensitively.
Array.NUMERIC, which sorts numerically if the two elements being compared are numbers. If they arent numbers, use a string comparison (which can be case-insensitive if that flag is specified). Array.UNIQUESORT, which returns an error code (0) instead of a sorted array if two objects in the array are identical or have identical sort fields.
Method; sorts the items in the data provider according to the specified compare function or according to one or more specified sort options. This method triggers the modelChanged event with the event name sort.
myList.sortItems(upperCaseFunc); function upperCaseFunc(a,b){ return a.label.toUpperCase() > b.label.toUpperCase(); }
myDP.sortItemsBy(fieldName, optionsFlag) myDP.sortItemsBy(fieldName, order)
A string that specifies the name of the field to use for sorting. This value is usually "label" or "data".
A string that specifies whether to sort the items in ascending order ("ASC") or descending order ("DESC").
Lets you perform multiple, different types of sorts on a single array without having to replicate the entire array or resort it repeatedly. This parameter is optional. The following are possible values for optionsFlag:
Array.DESCENDINGsorts
highest to lowest. case-insensitively.
Array.CASEINSENSITIVEsorts
Array.NUMERICsorts numerically if the two elements being compared are numbers. If they arent numbers, use a string comparison (which can be case-insensitive if that flag is specified). Array.UNIQUESORTif
two objects in the array are identical or have identical sort fields, this method returns an error code (0) instead of a sorted array.
The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only. The height of the object, in pixels. Read-only. The left edge of the object, in pixels. Read-only. The position of the right edge of the object, relative to the right edge of its parent. Read-only. A number indicating the scaling factor in the x direction of the object, relative to its parent. A number indicating the scaling factor in the y direction of the object, relative to its parent.
The position of the top edge of the object, relative to its parent. Read-only. A Boolean value indicating whether the object is visible (true) or not (false). The width of the object, in pixels. Read-only. The left edge of the object, in pixels. Read-only. The top edge of the object, in pixels. Read-only.
The following table lists the properties the DateChooser class inherits from the UIComponent class. When accessing these properties from the DateChooser object, use the form dateChooserInstance.propertyName.
Event summary for the DateChooser class
The following table lists the events that are exclusive to the DateChooser class.
DateChooser.change DateChooser.scroll
Broadcast when a date is selected. Broadcast when the month buttons are clicked.
The following table lists the events the DateChooser class inherits from the UIObject class.
Broadcast when an object is about to draw its graphics. Broadcast when an objects state changes from visible to invisible. Broadcast when subobjects are being created. Broadcast when the object has moved.
Broadcast when an object has been resized. Broadcast when an objects state changes from invisible to visible. Broadcast when the subobjects are being unloaded.
The following table lists the events the DateChooser class inherits from the UIComponent class.
DateChooser.change
var listenerObject:Object = new Object(); listenerObject.change = function(eventObject:Object) { //. }; dateChooserInstance.addEventListener("change", listenerObject);
on (change) { //. }
Event; broadcast to all registered listeners when a date is selected. The first usage example uses a dispatcher/listener event model. A component instance (dataChooserInstance) dispatches an event (in this case, change) and the event is handled by a function, also called a handler, on a listener object (listenerObject) that you create. You define a method with the same name as the event on the listener object; the method is called when the event is triggered. When the event is triggered, it automatically passes an event object (eventObject) to the listener object method. Each event object has properties that contain information about the event. You can use these properties to write code that handles the event. Finally, you call the EventDispatcher.addEventListener() method on the component instance that broadcasts the event to register the listener with the instance. When the instance dispatches the event, the listener is called. For more information, see EventDispatcher class on page 495. The second usage example uses an on() handler and must be attached directly to a DateChooser instance. The keyword this, used inside an on() handler attached to a component, refers to the component instance. For example, the following code, attached to the date chooser my_dc, sends _level0.my_dc to the Output panel:
DataSet.saveToSharedObj()
DataSet.locateById()
dataSetInstance.locateById(id)
A string identifier for the item in the collection to be located.
Method; positions the current iterator on the collection item whose ID matches id. This method returns true if the specified ID can be matched to an item in the collection; otherwise, it returns false.
To test this example, drag a DataSet component to the Stage, and give it an instance name of student_ds. Add two properties, name (String) and id (Number) to the DataSet by using the Schema tab of the Component inspector. If you dont already have a copy of the DataBindingClasses compiled clip in your library, drag a copy of the compiled clip from the Classes library (Window > Common Libraries > Classes). Add the following ActionScript to Frame 1 of the main timeline:
DataSet.applyUpdates(), DataSet.find(), DataSet.getItemId()
dataSetInstance.logChanges
Property; a Boolean value that specifies whether changes made to the data set, or to its items, should (true) or should not (false) be recorded in DataSet.deltaPacket.
When this property is set to true, operations performed at the collection level and item level are logged. Collection-level changes include the addition and removal of items from the collection. Item-level changes include property changes made to items and method calls made on items by means of the DataSet component.
The following example disables logging for the DataSet object named userData.
user_ds.logChanges = false;
DataSet.modelChanged
var listenerObject:Object = new Object(); listenerObject.modelChanged = function (eventObj:Object):Void { //. }; dataSetInstance.addEventListener("modelChanged", listenerObject);
on (modelChanged) { //. }
Event; broadcast when the collection changes in some wayfor example, when items are removed or added to the collection, when the value of an items property changes, or when the collection is filtered or sorted. The event object (eventObj) contains the following properties:
The index (number) of the first item in the collection that was affected by
the change.
lastItem
The index (number) of the last item in the collection that was affected by the change (equals firstItem if only one item was affected). A string that contains the name of the field being affected. This property is unless the change was made to a property of the DataSet object.
my_df.pullDown._visible = false; my_df.pullDown.setSize(300, 300);
DateField.scroll
var listenerObject:Object = new Object(); listenerObject.scroll = function(eventObject:Object) { //. }; dateFieldInstance.addEventListener("scroll", listenerObject);
Event; broadcast to all registered listeners when a month button is clicked.
The first usage example uses a dispatcher/listener event model. A component instance (dateFieldInstance) dispatches an event (in this case, scroll) and the event is handled by a function, also called a handler, on a listener object (listenerObject) that you create. You define a method with the same name as the event on the listener object; the method is called when the event is triggered. When the event is triggered, it automatically passes an event object (eventObject) to the listener object method. Each event object has properties that contain information about the event. You can use these properties to write code that handles the event. The scroll events event object has an additional property, detail, that can have one of the following values: nextMonth, previousMonth, nextYear, previousYear. Finally, you call the EventDispatcher.addEventListener() method on the component instance that broadcasts the event to register the listener with the instance. When the instance dispatches the event, the listener is called. For more information, see EventDispatcher class on page 495. The second usage example uses an on() handler and must be attached directly to a DateField instance. The keyword this, used inside an on() handler attached to a component, refers to the component instance. For example, the following code, attached to the date field my_df, sends _level0.my_df to the Output panel:
The following example, written on a frame of the timeline, sends a message to the Output panel when a user clicks a month button on a DateField instance called my_df. The first line of code creates a listener object called dfListener. The second line defines a function for the scroll event on the listener object. Inside the function is a trace() statement that uses the event object that is automatically passed to the function, in this example evt_obj, to generate a message. The target property of an event object is the component that generated the eventin this example, my_df The last line calls EventDispatcher.addEventListener() from my_df and passes it the scroll event and the dfListener listener object as parameters.
var listenerObject:Object = new Object(); listenerObject.resize = function(eventObject:Object):Void { // insert event-handling code here }; my_FLVplybk.addEventListener("resize", listenerObject);
Event; dispatched when video is resized. This occurs when you set the visibleVideoPlayerIndex property and switch to a video player with different dimensions. The event object has the properties auto, x, y, width, height and vp, which is the index number of the video player to which the event applies. For more information on the vp property, see FLVPlayback.activeVideoPlayerIndex on page 545 and FLVPlayback.visibleVideoPlayerIndex on page 684.
The auto property is true when the resizing is automatic because the autoSize or maintainAspectRatio property is true. In this case, the event might be dispatched for a video player other than the visible video player. The event might be dispatched even if the dimensions do not actually change after an attempt to automatically resize the component occurs. When the auto property is false, the event always applies to the visible video player. The vp property still appears but will always be equal to the visibleVideoPlayerIndex property. The component dispatches the event (with auto set to false) when you set the visibleVideoPlayerIndex property if you are switching to a video player with different dimensions than the currently visible player.
The following example plays two FLV files. It adds an ActionScript cue point to the first FLV file and, when the cuePoint event occurs, it switches to a second, smaller video player to play the second FLV file. When it sets the visibleVideoPlayerIndex property for the video player, it triggers the resize event, which displays the size and location of the current video player. Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/** Requires: - FLVPlayback component on the Stage with an instance name of my_FLVPlybk */ import mx.video.*; // turn off autoSize and maintainAspectRatio my_FLVPlybk.autoSize = false; my_FLVPlybk.maintainAspectRatio = false; // play this FLV my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/ clouds.flv"; // add a cue point my_FLVPlybk.addASCuePoint(3, "switch_here"); var listenerObject:Object = new Object();// create listener listenerObject.cuePoint = function(eventObject:Object):Void { // add a second video player my_FLVPlybk.activeVideoPlayerIndex = 1; // play this FLV my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/ water.flv";
Using the Loader component
You can use a loader whenever you need to retrieve content from a remote location and pull it into a Flash application. For example, you could use a loader to add a company logo (JPEG file) to a form. You could also use a loader to leverage Flash work that has already been completed. For example, if you had already built a Flash application and wanted to expand it, you could use the loader to pull the old application into a new application, perhaps as a section of a tab interface. In another example, you could use the loader component in an application that displays photos. Use Loader.load(), Loader.percentLoaded, and Loader.complete to control the timing of the image loads and display progress bars to the user during loading.
If you load certain components into a SWF file or into the Loader component, the components may not work correctly. These components include the following: Alert, ComboBox, DateField, Menu, MenuBar, and Window. Use the _lockroot property when calling loadMovie() or loading into the Loader component. If youre using the Loader component, add the following code:
myLoaderComponent.content._lockroot = true;
If youre using a movie clip with a call to loadMovie(), add the following code:
myMovieClip._lockroot = true;
If you dont set _lockroot to true in the loader movie clip, the loader only has access to its own library, but not the library in the loaded movie clip. Flash Player 7 supports the _lockroot property. For information about this property, see the MovieClip._lockroot property in ActionScript 2.0 Language Reference. Components such as Loader, ScrollPane and Window have events to determine when content has finished loading. So, if you want to set properties on the content of a Loader, ScrollPane, or Window, add the property statement within a complete event handler, as shown in the following example:
loadtest = new Object(); loadtest.complete = function(eventObject){ content_mc._rotation= 45; } my_loader.addEventListener("complete", loadtest)
For more information, see Loader.complete on page 821.
Loader parameters
You can set the following authoring parameters for each Loader component instance in the Property inspector or in the Component inspector (Window > Component Inspector menu option):
autoload indicates whether the content should load automatically (true), or wait to load until the Loader.load() method is called (false). The default value is true. contentPath
an absolute or relative URL indicating the file to load into the loader. A relative path must be relative to the SWF file loading the content. The URL must be in the same subdomain as the URL where the Flash content currently resides. For use in Flash Player or in test mode, all SWF files must be stored in the same folder, and the filenames cannot include folder or disk drive specifications. The default value is undefined until the load starts.
Right-click (Windows) or Control-click (Macintosh) the mySale_mc movie clip in the library, select Linkage, and select Export for ActionScript. Make sure the Linkage Identifier is correctly named. This places the movie clip in your runtime library.
14. Remove
the text box from the Stage.
The text box only needs to be in the Library.
15. Add
the following ActionScript to Frame 1. This code creates a listener to open a pop-up window informing the user that the movie is on sale.
// Import the classes necessary to create the pop-up window dynamically. import mx.containers.Window; import mx.managers.PopUpManager; // Create a listener object to open sale pop-up. var saleListener:Object = new Object(); saleListener.cuePoint = function(eventObj:Object) { var saleWin:MovieClip = PopUpManager.createPopUp(_root, Window, false, {closeButton:true, title:"Movie Sale", contentPath:"mySale_mc"}); // Enlarge the window so that the content fits. saleWin.setSize(80, 80); var delSaleWin:Object = new Object(); delSaleWin.click = function(eventObj:Object) { saleWin.deletePopUp(); } saleWin.addEventListener("click", delSaleWin); } myMedia.addEventListener("cuePoint", saleListener);
Select Control > Test Movie to test the SWF file. When the application reaches the playback time of the cuePointName cue point, a window pops up to show your message.
Using the MediaDisplay and MediaController components
If you want a lot of control over the look and feel of your media display, you may want to use the MediaDisplay and MediaController components together. The following example creates a Flash application that displays your CD and DVD preview media.
Select File > New and choose Flash File (ActionScript 2.0). From the Components panel, drag a MediaController and a MediaDisplay component to the Stage. Select the MediaDisplay instance and enter the instance name myDisplay in the Property inspector. Select the MediaController instance and enter the instance name myController in the Property inspector. Select the MediaDisplay instance, and open the Component inspector, Parameters tab. Set your media type according to the type of media that will be streaming (MP3 or FLV). If you selected FLV, enter the duration of the video in the Video Length text boxes using the format HH:MM:SS. Enter the location of your preview video in the URL text box. For example, you might enter www.helpexamples.com/flash/video/clouds.flv. Set the desired options for the Automatically Play, Use Preferred Media Size, and Respect Aspect Ratio check boxes. Select the MediaController instance and, in the Component inspector, Parameters tab, set your orientation to vertical by setting the horizontal property to false. the Component inspector, Parameters tab, set backgroundStyle to none. This specifies that the MediaController instance should not draw a background but should instead fill the media between the controls. Next, youll use a behavior to associate the MediaController and MediaDisplay instances so that the MediaController instance accurately reflects the playhead movement and other settings in the MediaDisplay instance, and so that the MediaDisplay instance responds to user clicks.
The following example sets the current value of the NumericStepper instance to 10 and sends the value to the Output panel. Drag an instance of the NumericStepper component onto the Stage, and enter the instance name my_nstep in the Property inspector. Add the following code to Frame 1 of the timeline:
/** Requires: - NumericStepper component on Stage (instance name: my_nstep) */ var my_nstep:mx.controls.NumericStepper; my_nstep.value = 10; my_nstep.maximum = 100; trace(my_nstep.value); // 10
CHAPTER 33
PopUpManager class
mx.managers.PopUpManager
The PopUpManager class lets you create overlapping windows that can be modal or nonmodal. (A modal window doesnt allow interaction with other windows while its active.) You use the methods of this class to create and destroy pop-up windows.
The PopupManager class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings.
Method summary for the PopUpManager class
The following table lists the methods of the PopUpManager class.
PopUpManager.createPopUp() PopUpManager.deletePopUp()
Creates a pop-up window. Deletes a pop-up window created by a call to PopUpManager.createPopUp().
PopUpManager.createPopUp()
PopUpManager.createPopUp(parent, class, modal [, initobj, outsideEvents])
parent class modal initobj
A reference to a window to pop-up over. A reference to the class of object you want to create. A Boolean value indicating whether the window is modal (true) or not (false). An object containing initialization properties. This parameter is optional.
outsideEvents
A Boolean value indicating whether an event is triggered if the user clicks outside the window (true) or not (false). This parameter is optional.
A reference to the object that was created. If the class parameter is Window and a window component is in the library, the returned reference is a Window.
Method; if modal, a call to createPopUp() finds the topmost parent window starting with parent and creates an instance of class. If nonmodal, a call to createPopUp() creates an instance of the class as a child of the parent window.
The following code creates a modal window when the button is clicked:
lo = new Object(); lo.click = function(){ mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true); } button.addEventListener("click", lo);
PopUpManager.deletePopUp()
Flash MX 2004 and Flash MX Professional 2004
windowInstance.deletePopUp();
Method; deletes a pop-up window and removes the modal state. It is the responsibility of the overlapped window to call PopUpManager.deletePopUp() when the window is being destroyed.
The following code creates a modal window named win with a close button, and deletes the window when the close button is clicked:
import mx.managers.PopUpManager import mx.containers.Window win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true}); lo = new Object(); lo.click = function(){ win.deletePopUp(); } win.addEventListener("click", lo);
CHAPTER 34
ProgressBar component
The ProgressBar component displays the progress of loading content. The ProgressBar is useful for displaying the status of loading images and pieces of an application. The loading process can be determinate or indeterminate. A determinate progress bar is a linear representation of a tasks progress over time and is used when the amount of content to load is known. An indeterminate progress bar is used when the amount of content to load is unknown. You can add a label to display the progress of the loading content.
A ProgressBar component is supported for both ActionScript 2.0 and ActionScript 3.0. This document discusses the version 2 component. If you are using the version 3 component, see Using the ProgressBar in Using ActionScript 3.0 Components.
The ProgressBar component contains a left cap, a right cap, and a progress track. The caps are simply the ends of the progress bar, where the progress track visually ends. A live preview of each ProgressBar instance reflects changes made to parameters in the Property inspector or Component inspector during authoring. The following parameters are reflected in the live preview: conversion, direction, label, labelPlacement, mode, and source.
Using the ProgressBar component
A progress bar lets you display the progress of content as it loads. This is essential feedback for users as they interact with an application. There are several modes in which to use the ProgressBar component; you set the mode with the mode parameter. The most commonly used modes are event mode and polled mode. These modes use the source parameter to specify a loading process that either emits progress and complete events (event and polled mode), or exposes getBytesLoaded() and getsBytesTotal() methods (polled mode). You can also use the ProgressBar component in manual mode by manually setting the maximum, minimum, and indeterminate properties along with calls to the ProgressBar.setProgress() method.
trackColor
Using skins with the ProgressBar component
The ProgressBar component uses skins to represent the progress bar track, the completed bar, and an indeterminate bar. To skin the ProgressBar component while authoring, modify symbols in the Flash UI Components 2/Themes/MMDefault/ProgressBar Elements folder. For more information, see About skinning components in Using ActionScript 2.0 Components. The track and bar graphics are each made up of three skins corresponding to the left and right caps and the middle. The caps are used as is, and the middle is resized horizontally to fit the width of the ProgressBar instance. The indeterminate bar is used when the ProgressBar instances indeterminate property is set to true. The skin is resized horizontally to fit the width of the progress bar. A ProgressBar component supports the following skin properties:
progTrackMiddleName
The expandable middle of the track. The default value is ProgTrackMiddle. The fixed-size left cap. The default value is ProgTrackLeft. The fixed-size right cap. The default value is ProgTrackRight. The expandable middle bar graphic. The default value is ProgBarMiddle. The fixed-size left bar cap. The default value is ProgBarLeft. The fixed-size right bar cap. The default value is ProgBarRight. The indeterminate bar graphic. The default value is ProgIndBar.
progTrackLeftName progTrackRightName progBarMiddleName
progBarLeftName progBarRightName progIndBarName
To create movie clip symbols for ProgressBar skins:
In the themes Library panel, expand the Flash UI Components 2/Themes/MMDefault folder and drag the ProgressBar Assets folder to the library for your document. Expand the ProgressBar Assets/Elements folder in the library of your document. Open the symbols you want to customize for editing. For example, open the ProgIndBar symbol.
1000 ProgressBar component
Customize the symbol as desired. For example, flip the track horizontally. Repeat steps 5-6 for all symbols you want to customize. Click the Back button to return to the main timeline. Drag a ProgressBar component to the Stage. To view the skins modified in this example, use ActionScript to set the indeterminate property to true.
ProgressBar class
MovieClip > UIObject class > ProgressBar mx.controls.ProgressBar
Setting a property of the ProgressBar class with ActionScript overrides the parameter of the same name set in the Property inspector or Component inspector. Each component class has a version property, which is a class property. Class properties are available only on the class itself. The version property returns a string that indicates the version of the component. To access this property, use the following code:
TextInput.restrict
textInputInstance.restrict
Property; indicates the set of characters that a user can enter in the text field. The default value is undefined. If this property is null or an empty string (""), a user can enter any character. If this property is a string of characters, the user can enter only characters in the string; the string is scanned from left to right. You can specify a range by using a dash (-). If the string begins with ^, all characters that follow the ^ are considered unacceptable characters. If the string does not begin with ^, the characters in the string are considered acceptable. The ^ can also be used as a toggle between acceptable and unacceptable characters. For example, the following code allows A-Z except X and Q:
When you enter the \ character in the Actions panel within double quotation marks, it has a special meaning for the Actions panels double-quote interpreter. It signifies that the character following the \ should be treated as is. For example, you could use the following code to enter a single quotation mark:
The Actions panels restrict interpreter also uses \ as an escape character. Therefore, you may think that the following should work:
However, since this expression is surrounded by double quotation marks, the following value is sent to the restrict interpreter: 0-9-^\, and the restrict interpreter doesnt understand this value.
Because you must enter this expression within double quotation marks, you must not only provide the expression for the restrict interpreter, but you must also escape the Actions panels built-in interpreter for double quotation marks. To send the value 0-9\-\^\\ to the restrict interpreter, you must enter the following code:
myText.restrict = "0-9\\-\\^\\\\";
The following example provides three different uses of the restrict property. The first usage restricts input to uppercase characters A through Z, spaces, and numbers. The second usage allows any characters except the lowercase characters a through z. The third usage allows only numbers, -, ^, and \. You must first drag a TextInput component to the Stage and give it an instance name of

To remove the duplicate movie clip, you could add this code for a button called myButton_btn.
this.myButton_btn.onRelease = function(){
removeMovieClip(newImg_mc); };
removeMovieClip function, duplicateMovieClip (MovieClip.duplicateMovieClip method), removeMovieClip (MovieClip.removeMovieClip method)
escape function
escape(expression:String) : String
Converts the parameter to a string and encodes it in a URL-encoded format, where all nonalphanumeric characters are replaced with % hexadecimal sequences. When used in a URL-encoded string, the percentage symbol (%) is used to introduce escape characters, and is not equivalent to the modulo operator (%). Parameters
expression:String
- The expression to convert into a string and encode in a URL-encoded
format. Returns
- URL-encoded string.
Example The following code produces the result someuser%40somedomain%2Ecom:
var email:String = "someuser@somedomain.com"; trace(escape(email));
In this example, the at symbol (@) was replaced with %40 and the dot symbol (.) was replaced with %2E. This is useful if you're trying to pass information to a remote server and the data has special characters in it (for example, & or ?), as shown in the following code:
var redirectUrl = "http://www.somedomain.com?loggedin=true&username=Gus"; getURL("http://www.myothersite.com?returnurl="+ escape(redirectUrl));
unescape function
eval function
eval(expression:Object) : Objecteval(expression:String) : Object
Accesses variables, properties, objects, or movie clips by name. If expression is a variable or a property, the value of the variable or property is returned. If expression is an object or movie clip, a reference to the object or movie clip is returned. If the element named in expression cannot be found, undefined is returned. In Flash 4, eval() was used to simulate arrays; in Flash 5 or later, you should use the Array class to simulate arrays. In Flash 4, you can also use eval() to dynamically set and retrieve the value of a variable or instance name. However, you can also do this with the array access operator ([]). In Flash 5 or later, you cannot use eval() to dynamically set and retrieve the value of a variable or instance name, because you cannot useeval() on the left side of an equation. For example, replace the code
where it was stopped, instead of restarting from the beginning. */ var numSecondsOffset:Number = (bg_sound.position/1000); bg_sound.start(numSecondsOffset); }; this.stop_mc.onRelease = function() { stopAllSounds(); };
stopDrag function
stopDrag() : Void
Stops the current drag operation. Note: This method is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true. Example The following code, placed in the main Timeline, stops the drag action on the movie clip instance my_mc when the user releases the mouse button:
my_mc.onPress = function () { startDrag(this); } my_mc.onRelease = function() { stopDrag(); }
startDrag function, _droptarget (MovieClip._droptarget property), startDrag (MovieClip.startDrag method), stopDrag (MovieClip.stopDrag method)
String function
String(expression:Object) : String
Returns a string representation of the specified parameter, as described in the following list:
If expression is a number, the return string is a text representation of the number. If expression is a string, the return string is expression.
If expression is an object, the return value is a string representation of the object generated by calling the string property for the object or by calling Object.toString() if no such property exists. If expression is a Boolean value, the return string is "true" or "false". If expression is a movie clip, the return value is the target path of the movie clip in slash (/) notation. In files published for Flash Player 6 or earlier, the result is an empty string (""). In files published for Flash Player 7 or later, the result is undefined.
If expression is undefined, the return values are as follows:
Note:Slash notation is not supported by ActionScript 2.0.
- An expression to convert to a string.
Example In the following example, you use ActionScript to convert specified expressions to a string:
var string1:String = String("3"); var string2:String = String("9"); trace(string1+string2); // output: 39
Because both parameters are strings, the values are concatenated rather than added. See also
toString (Number.toString method), toString (Object.toString method), String, " string delimiter operator
<<= (bitwise left shift and assignment) ~ (bitwise NOT)
| (bitwise OR)
|= (bitwise OR assignment) >> (bitwise right shift)
>>= (bitwise right shift and assignment) >>> (bitwise unsigned right shift)
>>>= (bitwise unsigned right shift and assignment) ^ (bitwise XOR)
Converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits in expression1 or expression2 , but not both, are 1. Assigns expression1 the value of expression1 ^ expression2. Indicates one or more lines of script comments. Evaluates expression1 , then expression2 , and so on.
^= (bitwise XOR assignment) /* (block comment delimiter) , (comma)
add (concatenation (strings))
Deprecated since Flash Player 5. Adobe recommends you use the addition (+) operator when creating content for Flash Player 5 or later. Note: Flash Lite 2.0 also deprecates the add operator in favor of the addition (+) operator. Concatenates two or more strings. Instructs Flash to evaluate expression1 , and if the value of expression1 is true , it returns the value of expression2 ; otherwise it returns the value of expression3. A pre-decrement and post-decrement unary operator that subtracts 1 from the expression. Divides expression1 by expression2. Assigns expression1 the value of expression1 / expression2. Used to navigate movie clip hierarchies to access nested (child) movie clips, variables, or properties. Tests two expressions for equality. Deprecated since Flash Player 5. This operator was deprecated in favor of the == (equality) operator. Returns true if the string representation of expression1 is equal to the string representation of expression2, false otherwise. Compares two expressions and determines whether expression1 is greater than expression2; if it is, the operator returns true. Deprecated since Flash Player 5. This operator was deprecated in favor of the > (greater than) operator. Compares the string representation of expression1 with the string representation of expression2 and returns true if expression1 is greater than expression2, false otherwise. Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false). Deprecated since Flash Player 5. This operator was deprecated in favor of the >= (greater than or equal to) operator. Returns true if expression1 is greater than or equal to expression2, false otherwise. A pre-increment and post-increment unary operator that adds 1 to expression. Tests for the exact opposite of the equality (== ) operator.
or logical OR operator
condition1 or condition2
Deprecated since Flash Player 5. This operator was deprecated in favor of the || OR) operator.
Evaluates condition1 and condition2, and if either expression is true, the whole expression is true. Operands
condition1 : Boolean condition2 : Boolean
- An expression that evaluates to true or false. - An expression that evaluates to true or false.
|| logical OR operator, | bitwise OR operator
expression1 % expression2
Calculates the remainder of expression1 divided by expression2. If either of the expression parameters are non-numeric, the modulo (%) operator attempts to convert them to numbers. The expression can be a number or string that converts to a numeric value. The sign of the result of modulo operation matches the sign of the dividend (the first number). For example, -4 % 3 and -4 % -3 both evaluate to -1. Operands
- A number or expression that evaluates to a number. - A number or expression that evaluates to a number.
- The result of the arithmetic operation.
Example The following numeric example uses the modulo (%) operator:
trace(12%5); // traces 2 trace(4.3%2.1); // traces 0.0999999999999996 trace(4%4); // traces 0
The first trace returns 2, rather than 12/5 or 2.4, because the modulo (% ) operator returns only the remainder. The second trace returns 0.0999999999999996 instead of the expected 0.1 because of the limitations of floating-point accuracy in binary computing. See also
/ division operator, round (Math.round method)
%= modulo assignment operator
expression1 %= expression2
Assigns expression1 the value of expression1 statements are equivalent:
x %= y; and x = x % y;
% expression2.
The following two
Example The following example assigns the value 4 to the variable x:
var x:Number = 14; var y:Number = 5; trace(x %= y); // output: 4
* multiplication operator
expression1 * expression2
Multiplies two numerical expressions. If both expressions are integers, the product is an integer. If either or both expressions are floating-point numbers, the product is a floatingpoint number. Operands
- An integer or floating-point number.
Example Usage 1: The following statement multiplies the integers 2 and 3:
trace(2*3); // output: 6
The result, 6, is an integer. Usage 2: This statement multiplies the floating-point numbers 2.0 and 3.1416:
trace(2.0 * 3.1416); // output: 6.2832
GetPlatform
GetPowerSource
GetSignalLevel GetSoftKeyLocation
Flash Lite.
GetTotalPlayerMemory Returns the total amount of heap memory, in kilobytes, allocated to
GetVolumeLevel Quit ResetSoftKeys SetFocusRectColor SetInputTextType SetSoftKeys StartVibrate StopVibrate
Returns the current volume level of the device as a numeric value. Causes the Flash Lite Player to stop playback and exit. Resets the soft keys to their original settings. Sets the color of the focus rectangle to any color. Specifies the mode in which the input text field should be opened. Remaps the softkeys of a mobile device. Starts the phone's vibration feature. Stops the current vibration, if any.
ExtendBacklightDuration fscommand2 Command
ExtendBacklightDuration
Extends the duration of a backlight for a specified period of time. If the duration is greater than zero, this command specifies the amount of time in seconds (maximum of 60 seconds) that the backlight should be kept on. If the time elapses without an additional call to this command, the backlight behavior reverts to the default duration. If duration is zero, the backlight behavior immediately reverts to the default behavior. Note: This feature is system dependent. For example, some systems limit the total duration that the backlight can be extended. Note: This command is not supported for BREW devices.
ExtendBacklight Duration
duration The backlight duration, in seconds. Maximum value of 60 seconds.
Value Returned
-1: Not supported 0: An error occurred, and the operation could not be completed. 1: Success
Example The following example extends the duration of the backlight for 45 seconds:
status = FSCommand2("ExtendBacklightDuration", 45)
FullScreen fscommand2 Command
FullScreen
Sets the size of the display area to be used for rendering. The size can be a defined variable or a constant string value, with one of these values: true (full screen) or false (less than full screen). Any other value is treated as the value false. Note: This command is supported only when Flash Lite is running in stand-alone mode. It is not supported when the player is running in the context of another application (for example, as a plug-in to a browser).
-1: Not supported0: Supported
Example The following example sets the size of the display area to the full screen:
status = fscommand2("FullScreen", true);
GetBatteryLevel fscommand2 Command
GetBatteryLevel
Returns the current battery level. It is a numeric value that ranges from 0 to the maximum value returned by the GetMaxBatteryLevel variable. Note: This command is not supported for BREW devices.
A non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1. Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.
Example The following code explains how the length property is updated. The initial length is 0, and then updated to 1, 2, and 10. If you assign a value to the length property that is shorter than the existing length, the array will be truncated:
var my_array:Array = new Array(); trace(my_array.length); // initial length is 0 my_array[0] = "a"; trace(my_array.length); // my_array.length is updated to 1 my_array[1] = "b"; trace(my_array.length); // my_array.length is updated to 2 my_array[9] = "c"; trace(my_array.length); // my_array.length is updated to 10 trace(my_array); // displays: // a,b,undefined,undefined,undefined,undefined,undefined,undefined,undefine d,c // if the length property is now set to 5, the array will be truncated my_array.length = 5; trace(my_array.length); // my_array.length is updated to 5 trace(my_array); // outputs: a,b,undefined,undefined,undefined
NUMERIC (Array.NUMERIC property)
public static NUMERIC : Number
Represents numeric sorting instead of string-based sorting. String-based sorting, which is the default setting, treats numbers as strings when sorting them. For example, string-based sorting places 10 before 3. A numeric sort treats the elements as numbers so that 3 will be placed before 10. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 16. See also
pop (Array.pop method)
public pop() : Object
Removes the last element from an array and returns the value of that element. Returns
- The value of the last element in the specified array.
Example The following code creates the array myPets_array array containing four elements, and then removes its last element:
var myPets_array:Array = new Array("cat", "dog", "bird", "fish"); var popped:Object = myPets_array.pop(); trace(popped); // Displays fish. trace(myPets_array); // Displays cat,dog,bird.
push (Array.push method), shift (Array.shift method), unshift (Array.unshift method)
push (Array.push method)
public push(value:Object) : Number
Adds one or more elements to the end of an array and returns the new length of the array. Parameters
public static hasAccessibility : Boolean [read-only]
A Boolean value that is true if the player is running in an environment that supports communication between Flash Player and accessibility aids; false otherwise. The server string is ACC. Note: For Flash Lite 2.0, the value returned is always false. Example The following example traces the value of this read-only property:
trace(System.capabilities.hasAccessibility);
hasAudio (capabilities.hasAudio property)
public static hasAudio : Boolean [read-only]
Specifies if the system has audio capabilities. A Boolean value that is true if the player is running on a system that has audio capabilities; false otherwise. The server string is A. Example The following example traces the value of this read-only property:
trace(System.capabilities.hasAudio);
hasAudioEncoder (capabilities.hasAudioEncoder property)
public static hasAudioEncoder : Boolean [read-only]
Specifies if the Flash Player can encode an audio stream. A Boolean value that is true if the player can encode an audio stream, such as that coming from a microphone; false otherwise. The server string is AE. Note: For Flash Lite 2.0, the value returned is always false. Example The following example traces the value of this read-only property:
trace(System.capabilities.hasAudioEncoder);
hasCMIDI (capabilities.hasCMIDI property)
public static hasCMIDI : Boolean [read-only]
Returns true if the mobile device can play sound data in the CMIDI audio format. Otherwise,this property returns false. Example The following example traces the value of this read-only property:
trace(System.capabilities.hasCMIDI);
hasCompoundSound (capabilities.hasCompoundSound property)
public static hasCompoundSound : Boolean [read-only]
Returns true if the Flash Lite player can process compound sound data. Otherwise, it returns false. Example The following example traces the value of this read-only property:
trace(System.capabilities.hasCompoundSound);
hasDataLoading (capabilities.hasDataLoading property)
public static hasDataLoading : Boolean [read-only]
Returns true if the Flash Lite player can dynamically load additional data through calls to specific functions. You can call the following specific functions:
name (Error.name property)
public name : String
Contains the name of the Error object. By default, the value of this property is "Error". Example In the following example, a function throws a specified error depending on the two numbers that you try to divide. Add the following ActionScript to Frame 1 of the Timeline:
function divideNumber(numerator:Number, denominator:Number):Number { if (isNaN(numerator) || isNaN(denominator)) { throw new Error("divideNum function requires two numeric parameters."); } else if (denominator == 0) { throw new DivideByZeroError(); } return numerator/denominator; } try { var theNum:Number = divideNumber(1, 0); trace("SUCCESS! "+theNum); // output: DivideByZeroError -> Unable to divide by zero. } catch (e_err:DivideByZeroError) { // divide by zero error occurred trace(e_err.name+" -> "+e_err.toString()); } catch (e_err:Error) { // generic error occurred trace(e_err.name+" -> "+e_err.toString()); }
To add a custom error, add the following code to a.AS file called DivideByZeroError.as and save the class file in the same directory as your FLA document.
class DivideByZeroError extends Error { var name:String = "DivideByZeroError"; var message:String = "Unable to divide by zero."; }
toString (Error.toString method)
Returns the string "Error" by default or the value contained in Error.message, if defined. Returns
- A String
message (Error.message property), throw statement, try.catch.finally statement
ExtendedKey
Object | +-ExtendedKey public class ExtendedKey extends Object
Provides extended key codes that can be returned from the Key.getCode() method. Example
Key.getCode()
The following example creates a listener that is called when a key is pressed. It uses the method to get the key code for the key that was pressed:
var myListener = new Object(); myListener.onKeyDown = function() { var code = Key.getCode(); switch(code) { case 50: trace("number 2 down"); break; case Key.ENTER: trace("enter down"); break; case ExtendedKey.SOFT1: trace("soft1 down"); break; default: trace(code + " down"); break; } } myListener.onKeyUp = function() { text2 = "onKeyUp called"; } Key.addListener(myListener);
getCode (Key.getCode method)
static static static static static static static static static static static static
SOFT1:String SOFT10:String SOFT11:String SOFT12:String SOFT2:String SOFT3:String SOFT4:String SOFT5:String SOFT6:String SOFT7:String SOFT8:String SOFT9:String
The key code value for the SOFT1 soft key. The key code value for the SOFT10 soft key. The key code value for the SOFT11 soft key. The key code value for the SOFT12 soft key. The key code value for the SOFT2 soft key. The key code value for the SOFT3 soft key. The key code value for the SOFT4 soft key. The key code value for the SOFT5 soft key. The key code value for the SOFT6 soft key. The key code value for the SOFT7 soft key. The key code value for the SOFT8 soft key. The key code value for the SOFT9 soft key.
loadMovie (MovieClip.loadMovie method), removeMovieClip (MovieClip.removeMovieClip method), duplicateMovieClip function
enabled (MovieClip.enabled property)
A Boolean value that indicates whether a movie clip is enabled. The default value of enabled is true. If enabled is set to false, the movie clip's callback methods and onaction event handlers are no longer invoked, and the Over, Down, and Up frames are disabled. The enabled property does not affect the Timeline of the movie clip; if a movie clip is playing, it continues to play. The movie clip continues to receive movie clip events (for example, mouseDown, mouseUp, keyDown, and keyUp). The enabled property only governs the button-like properties of a movie clip. You can change the enabled property at any time; the modified movie clip is immediately enabled or disabled. The enabled property can be read out of a prototype object. If enabled is set to false, the object is not included in automatic tab ordering. Example The following example disables the circle_mc movie clip when the user clicks it:
circle_mc.onRelease = function() { trace("disabling the "+this._name+" movie clip."); this.enabled = false; };
endFill (MovieClip.endFill method)
public endFill() : Void
Applies a fill to the lines and curves added since the last call to beginFill() or beginGradientFill(). Flash uses the fill that was specified in the previous call to beginFill() or beginGradientFill(). If the current drawing position does not equal the previous position specified in a moveTo() method and a fill is defined, the path is closed with a line and then filled. Example The following example creates a square with red fill on the Stage:
beginFill (MovieClip.beginFill method), beginGradientFill (MovieClip.beginGradientFill method), moveTo (MovieClip.moveTo method)
focusEnabled (MovieClip.focusEnabled property)
public focusEnabled : Boolean
If the value is undefined or false, a movie clip cannot receive input focus unless it is a button. If the focusEnabled property value is true, a movie clip can receive input focus even if it is not a button. Example The following example sets the focusEnabled property for the movie clip my_mc to false:
this.createEmptyMovieClip("box_mc", 1); box_mc._x = 100; box_mc._y = 100; with (box_mc) { lineStyle(1, 0xCCCCCC); beginFill(0xEEEEEE); moveTo(0, 0); lineTo(80, 0); lineTo(80, 60); lineTo(0, 60); lineTo(0, 0); endFill(); }; box_mc.onRollOver = function() { this._x -= this._width/2; this._y -= this._height/2; this._xscale = 200; this._yscale = 200; }; box_mc.onRollOut = function() { this._xscale = 100; this._yscale = 100; this._x += this._width/2; this._y += this._height/2; };
_x (MovieClip._x property), _y (MovieClip._y property), _yscale (MovieClip._yscale property), _width (MovieClip._width property)
_y (MovieClip._y property)
Sets the y coordinate of a movie clip relative to the local coordinates of the parent movie clip. If a movie clip is in the main Timeline, its coordinate system refers to the upper-left corner of the Stage.as (0,0). If the movie clip is inside another movie clip that has transformations, the movie clip is in the local coordinate system of the enclosing movie clip. Thus, for a movie clip rotated 90 counterclockwise, the movie clip's children inherit a coordinate system that is rotated 90 counterclockwise. The movie clip's coordinates refer to the registration point position. See also
_x (MovieClip._x property), _xscale (MovieClip._xscale property), _yscale (MovieClip._yscale property)
_ymouse (MovieClip._ymouse property)
Indicates the y coordinate of the mouse position. Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is true or System.capabilities.hasStylus is true. Example The following example returns the current x and y coordinates of the mouse on the Stage (_level0) and in relation to a movie clip on the Stage called my_mc.
Mouse, _xmouse (MovieClip._xmouse property)
_yscale (MovieClip._yscale property)
Sets the vertical scale (percentage) of the movie clip as applied from the registration point of the movie clip. The default registration point is (0,0). Scaling the local coordinate system affects the _x and _y property settings, which are defined in whole pixels. For example, if the parent movie clip is scaled to 50%, you set the _x property to move an object in the movie clip by half the number of pixels that it would if the movie were at 100%. Example The following example creates a movie clip at runtime called box_mc. The Drawing API is used to draw a box in this instance, and when the mouse rolls over the box, horizontal and vertical scaling is applied to the movie clip. When the mouse rolls off the instance, it returns to the previous scaling.
_x (MovieClip._x property), _xscale (MovieClip._xscale property), _y (MovieClip._y property), _height (MovieClip._height property)
this.createTextField("first_mc", this.getNextHighestDepth(), 10, 10, 100, 22); this.createTextField("second_mc", this.getNextHighestDepth(), 10, 10, 100, 22); for (var prop in this) { if (this[prop] instanceof TextField) { var this_txt:TextField = this[prop]; trace(this_txt._name+" is a TextField at depth: "+this_txt.getDepth()); } }
getNewTextFormat (TextField.getNewTextFormat method)
public getNewTextFormat() : TextFormat
Returns a TextFormat object containing a copy of the text field's text format object. The text format object is the format that newly inserted text, such as text entered by a user, receives. When getNewTextFormat() is invoked, the TextFormat object returned has all of its properties defined. No property is null. Returns
TextFormat
- A TextFormat object.
Example The following example displays the specified text field's (my_txt) text format object.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120); var my_fmt:TextFormat = my_txt.getNewTextFormat(); trace("TextFormat has the following properties:"); for (var prop in my_fmt) { trace(prop+": "+my_fmt[prop]); }
getTextFormat (TextField.getTextFormat method)
public getTextFormat([beginIndex:Number], [endIndex:Number]) : TextFormat
Returns a TextFormat object for a character, for a range of characters, or for an entire TextField object.
Usage 1:my_textField.getTextFormat() Returns a TextFormat object containing formatting information for all text in a text field. Only properties that are common to all text in the text field are set in the resulting TextFormat object. Any property which is mixed, meaning that it has different values at different points in the text, has a value of null.
Usage 2:my_textField.getTextFormat(beginIndex:Number) Returns a TextFormat object containing a copy of the text field's text format at the beginIndex position.
Usage 3:my_(extField.getTextFormat(beginIndex:Number,endIndex:Number)
Returns a TextFormat object containing formatting information for the span of text from beginIndex to endIndex. Only properties that are common to all of the text in the specified range is set in the resulting TextFormat object. Any property that is mixed (it has different values at different points in the range) has its value set to null. Parameters
for (var aNode:XMLNode = rootNode.firstChild; aNode != null; aNode = aNode.nextSibling) { trace(aNode); }
firstChild (XMLNode.firstChild property), appendChild (XMLNode.appendChild method), insertBefore (XMLNode.insertBefore method), removeNode (XMLNode.removeNode method), XML
nodeName (XMLNode.nodeName property)
public nodeName : String
A string representing the node name of the XML object. If the XML object is an XML element (nodeType == 1), nodeName is the name of the tag that represents the node in the XML file. For example, TITLE is the nodeName of an HTML TITLE tag. If the XML object is a text node (nodeType == 3), nodeName is null.
Example The following example creates an element node and a text node, and checks the node name of each:
// create an XML document var doc:XML = new XML(); // create an XML node using createElement() var myNode:XMLNode = doc.createElement("rootNode"); // place the new node into the XML tree doc.appendChild(myNode); // create an XML text node using createTextNode() var myTextNode:XMLNode = doc.createTextNode("textNode"); // place the new node into the XML tree myNode.appendChild(myTextNode); trace(myNode.nodeName); trace(myTextNode.nodeName); // output: // rootNode // null
The following example creates a new XML packet. If the root node has child nodes, the code loops over each child node to display the name and value of the node. Add the following ActionScript to your FLA or AS file:
The following node names are displayed in the Output panel:
nodeType (XMLNode.nodeType property)
public nodeType : Number [read-only]
A nodeType value, either 1 for an XML element or 3 for a text node. The nodeType is a numeric value from the NodeType enumeration in the W3C DOM Level 1 recommendation: www.w3.org/tr/1998/REC-DOM-Level-1-19981001/level-onecore.html. The following table lists the values:
Integer value
Defined constant
ELEMENT_NODE ATtrIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE NTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INStrUCTION_N ODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NO DE NOTATION_NODE
Now that the onConnect() handler is defined, the connect() method is invoked to attempt to establish the connection. If the connect() method returns a value of false, the SWF file is sent directly to the frame labeled connectionFailed, and onConnect() is never invoked. If the connect() method returns true, the SWF file jumps to a frame labeled waitForConnection, which is the "Please wait" screen. The SWF file remains on the waitForConnection frame until the onConnect() handler is invoked, which happens at some point in the future depending on network latency.
if (!socket.connect(null, 2000)) { gotoAndStop("connectionFailed"); } else { gotoAndStop("waitForConnection"); }
connect (XMLSocket.connect method), function statement
onData (XMLSocket.onData handler)
Invoked when a message is downloaded from the server and terminated by a zero (0) byte. You can override the XMLSocket.onData event handler to intercept data that the server sends without parsing it as XML. This capability is useful if you're transmitting arbitrarily formatted data packets, and you'd prefer to manipulate the data directly when it arrives, rather than have Flash Player parse the data as XML. By default, the XMLSocket.onData method invokes the XMLSocket.onXML method. If you override XMLSocket.onData with custom behavior, XMLSocket.onXML is not called unless you call it in your implementation of XMLSocket.onData. Parameters
- A string containing data that the server sends.
Example In this example, the src parameter is a string containing XML text downloaded from the server. The zero (0) byte terminator is not included in the string.
XMLSocket.prototype.onData = function (src) { this.onXML(new XML(src)); }
onXML (XMLSocket.onXML handler)
onXML = function(src:XML) {}
Invoked by the Flash Lite player when the specified XML object containing an XML document arrives over an open XMLSocket connection. An XMLSocket connection can be used to transfer an unlimited number of XML documents between the client and the server. Each document is terminated with a zero (0) byte. When the Flash Lite player receives the zero byte, it parses all the XML received since the previous zero byte or since the connection was established if this is the first message received. Each batch of parsed XML is treated as a single XML document and passed to the onXML() method. The default implementation of this method performs no actions. To override the default implementation, you must assign a function containing actions that you define. Parameters
Technical specifications
Full description
The "ActionScript 2.0 Language Reference for Macromedia Flash 8" is a comprehensive reference manual that describes the application programming interface (API) for Macromedia Flash Player, the most pervasive client runtime environment in the world. It includes valuable syntax and usage information; detailed descriptions of classes, functions, properties, and events; and copy-and-paste code samples for every element in the ActionScript language. The "ActionScript 2.0 Language Reference for Macromedia Flash 8" will help you: - Learn how to use specific APIs efficiently and effectively - Understand the range and variety of functionality ActionScript offers - Repurpose Macromedia-tested code in your own applications Powerful development and design tools require thorough and authoritative technical advice and documentation. When it comes to Macromedia Flash, no one is more authoritative than Macromedia Development and writing teams. Now their official documentation is available to you in printed book form. As you work, keep this guide by your side for ready access to valuable information on using Flash. We've designed it so that it's easy to annotate as you progress.
Tags
SA-706 Spitfire Versamail CDX-497 TD-W8920G HT-X710 MFX-1330 SRT 5126 KX-TG2480 Kyosho KF01 MP-C641 Motorola C651 Gateway MT 800 HP-302 DCS-5635 P6VAA STA-800 DI2011 W1934S-BN LBT-ZX80D TMS320F2812 GA-EP43-ud3L SP0802N-CNG CMT-DX2D Amplifier M12 LG-ED47M Figure AL2017 SR-S2229C 2 Gold D-40 Zoom Fireworks 159710 ASF645 HS-20 Universal B-2 PRO Jenga Review SC-HT892 BHP452 Ist DS Siemens A57 Photosmart 8453 RX-884R ZBB6286 Dpsv55 ADC514E - 1995 LE37A656 Router 510 L1246EL MS9138E II Cyclad Music 2 CDX-757MX Workcentre 118 Sibelius 3 JA-S11G Tamd31 Depth 42PM4M-WA Windows 7 AR-405 HSK30-70 Avic-X1BT CDX-GT434U 212G 140 Hundred DMR-BS750EB Privileg 470 DAV-DZ680 VP-D964W VSX-515-K Filter Electronic Kyocera K127 Canon T90 LN40C550j1M RX-V650 DTH8000 RX-V490 C3212 Audio Nokia 7270 VP-700 Impression 5 N2025 Chalugaz ICN 650 96-12 Center 500 Edition-2008 FE-350 BX610FW T8196A M1310 PD-M427 Guitar
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101










