Package | fl.video |
Class | public class FLVPlaybackCaptioning |
Inheritance | FLVPlaybackCaptioning Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
It updates the ActionScript 3.0 Language and Components Reference for the FLVPlaybackCaptioning class to include the following properties and methods which were added to improve the component's accessibility.
Make sure you are including the " with Accessibility" version of the component in your project before attempting to access the new properties or methods.
The FLVPlaybackCaptioning component downloads a Timed Text (TT) XML file and applies those captions to an FLVPlayback component to which this component is partnered.
For more information on Timed Text format, see http://www.w3.org/AudioVideo/TT/. The FLVPlaybackCaptioning component supports a subset of the Timed Text 1.0 specification. For detailed information on the supported subset, see Timed Text Tags. The following is a brief example:
<?xml version="1.0" encoding="UTF-8"?> <tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1" xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling"> <head> <styling> <style id="1" tts:textAlign="right"/> <style id="2" tts:color="transparent"/> <style id="3" style="2" tts:backgroundColor="white"/> <style id="4" style="2 3" tts:fontSize="20"/> </styling> </head> <body> <div xml:lang="en"> <p begin="00:00:00.50" dur="500ms">Four score and twenty years ago</p> <p begin="00:00:02.50"><span tts:fontFamily="monospaceSansSerif,proportionalSerif,TheOther"tts:fontSize="+2">our forefathers</span> brought forth<br /> on this continent</p> <p begin="00:00:04.40" dur="10s" style="1">a <span tts:fontSize="12 px">new</span> <span tts:fontSize="300%">nation</span></p> <p begin="00:00:06.50" dur="3">conceived in <span tts:fontWeight="bold" tts:color="#ccc333">liberty</span> <span tts:color="#ccc333">and dedicated to</span> the proposition</p> <p begin="00:00:11.50" tts:textAlign="right">that <span tts:fontStyle="italic">all</span> men are created equal.</p> <p begin="15s" style="4">The end.</p> </div> </body> </tt>
Property | Defined By | ||
---|---|---|---|
accessibilityImplementation : AccessibilityImplementation
The current accessibility implementation (AccessibilityImplementation)
for this InteractiveObject instance. | InteractiveObject | ||
accessibilityProperties : AccessibilityProperties
The current accessibility options for this display object. | DisplayObject | ||
alpha : Number
Indicates the alpha transparency value of the object specified. | DisplayObject | ||
autoLayout : Boolean
Determines whether the FLVPlaybackCaptioning component
automatically moves and resizes the TextField object for captioning. | FLVPlaybackCaptioning | ||
blendMode : String
A value from the BlendMode class that specifies which blend mode to use. | DisplayObject | ||
blendShader : Shader [write-only]
Sets a shader that is used for blending the foreground and background. | DisplayObject | ||
buttonMode : Boolean
Specifies the button mode of this sprite. | Sprite | ||
cacheAsBitmap : Boolean
If set to true, Flash runtimes cache an internal bitmap representation of the
display object. | DisplayObject | ||
cacheAsBitmapMatrix : Matrix
If non-null, this Matrix object defines how a display object is rendered when
cacheAsBitmap is set to true. | DisplayObject | ||
captionButton : Sprite
Defines the captionButton FLVPlayback custom UI component instance
which provides toggle capabilities to turn captioning on and off. | FLVPlaybackCaptioning | ||
captionTarget : DisplayObject
Sets the DisplayObject instance in which to display captions. | FLVPlaybackCaptioning | ||
captionTargetName : String
The instance name of the TextField object or MovieClip enclosing a Textfield object
that contains the captions. | FLVPlaybackCaptioning | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
contextMenu : NativeMenu
Specifies the context menu associated with this object. | InteractiveObject | ||
doubleClickEnabled : Boolean
Specifies whether the object receives doubleClick events. | InteractiveObject | ||
dropTarget : DisplayObject [read-only]
Specifies the display object over which the sprite is being dragged, or on
which the sprite was dropped. | Sprite | ||
filters : Array
An indexed array that contains each filter object currently associated with the display object. | DisplayObject | ||
flvPlayback : FLVPlayback
Sets the FLVPlayback instance to caption. | FLVPlaybackCaptioning | ||
flvPlaybackName : String
Sets an FLVPlayback instance name for the FLVPlayback instance
that you want to caption. | FLVPlaybackCaptioning | ||
focusRect : Object
Specifies whether this object displays a focus rectangle. | InteractiveObject | ||
graphics : Graphics [read-only]
Specifies the Graphics object that belongs to this sprite where vector
drawing commands can occur. | Sprite | ||
height : Number
Indicates the height of the display object, in pixels. | DisplayObject | ||
hitArea : Sprite
Designates another sprite to serve as the hit area for a sprite. | Sprite | ||
loaderInfo : LoaderInfo [read-only]
Returns a LoaderInfo object containing information about loading the file
to which this display object belongs. | DisplayObject | ||
mask : DisplayObject
The calling display object is masked by the specified mask object. | DisplayObject | ||
mouseChildren : Boolean
Determines whether or not the children of the object are mouse, or user input device, enabled. | DisplayObjectContainer | ||
mouseEnabled : Boolean
Specifies whether this object receives mouse, or other user input, messages. | InteractiveObject | ||
mouseX : Number [read-only]
Indicates the x coordinate of the mouse or user input device position, in pixels. | DisplayObject | ||
mouseY : Number [read-only]
Indicates the y coordinate of the mouse or user input device position, in pixels. | DisplayObject | ||
name : String
Indicates the instance name of the DisplayObject. | DisplayObject | ||
needsSoftKeyboard : Boolean
Specifies whether a virtual keyboard (an on-screen, software keyboard) should display
when this InteractiveObject instance receives focus. | InteractiveObject | ||
numChildren : int [read-only]
Returns the number of children of this object. | DisplayObjectContainer | ||
opaqueBackground : Object
Specifies whether the display object is opaque with a certain background color. | DisplayObject | ||
parent : DisplayObjectContainer [read-only]
Indicates the DisplayObjectContainer object that contains this display object. | DisplayObject | ||
prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | ||
root : DisplayObject [read-only]
For a display object in a loaded SWF file, the root property is the
top-most display object in the portion of the display list's tree structure represented by that SWF file. | DisplayObject | ||
rotation : Number
Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. | DisplayObject | ||
rotationX : Number
Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container. | DisplayObject | ||
rotationY : Number
Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container. | DisplayObject | ||
rotationZ : Number
Indicates the z-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container. | DisplayObject | ||
scale9Grid : Rectangle
The current scaling grid that is in effect. | DisplayObject | ||
scaleX : Number
Indicates the horizontal scale (percentage) of the object as applied from the registration point. | DisplayObject | ||
scaleY : Number
Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. | DisplayObject | ||
scaleZ : Number
Indicates the depth scale (percentage) of an object as applied from the registration point of the object. | DisplayObject | ||
scrollRect : Rectangle
The scroll rectangle bounds of the display object. | DisplayObject | ||
showCaptions : Boolean
Used to display captions; true = display captions,
false = do not display captions. | FLVPlaybackCaptioning | ||
simpleFormatting : Boolean
Limits formatting instructions
from the Timed Text file when set to true. | FLVPlaybackCaptioning | ||
softKeyboardInputAreaOfInterest : Rectangle
Defines the area that should remain on-screen when a soft keyboard is displayed. | InteractiveObject | ||
soundTransform : flash.media:SoundTransform
Controls sound within this sprite. | Sprite | ||
source : String
URL of the Timed Text XML file that contains caption information (required property). | FLVPlaybackCaptioning | ||
stage : Stage [read-only]
The Stage of the display object. | DisplayObject | ||
tabChildren : Boolean
Determines whether the children of the object are tab enabled. | DisplayObjectContainer | ||
tabEnabled : Boolean
Specifies whether this object is in the tab order. | InteractiveObject | ||
tabIndex : int
Specifies the tab ordering of objects in a SWF file. | InteractiveObject | ||
textSnapshot : flash.text:TextSnapshot [read-only]
Returns a TextSnapshot object for this DisplayObjectContainer instance. | DisplayObjectContainer | ||
track : uint
Support for multiple language tracks. | FLVPlaybackCaptioning | ||
transform : flash.geom:Transform
An object with properties pertaining to a display object's matrix, color transform, and pixel bounds. | DisplayObject | ||
useHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the pointer rolls
over a sprite in which the buttonMode property is set to true. | Sprite | ||
videoPlayerIndex : uint
Connects the captioning to a specific VideoPlayer in the
FLVPlayback component. | FLVPlaybackCaptioning | ||
visible : Boolean
Whether or not the display object is visible. | DisplayObject | ||
width : Number
Indicates the width of the display object, in pixels. | DisplayObject | ||
x : Number
Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of
the parent DisplayObjectContainer. | DisplayObject | ||
y : Number
Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of
the parent DisplayObjectContainer. | DisplayObject | ||
z : Number
Indicates the z coordinate position along the z-axis of the DisplayObject
instance relative to the 3D parent container. | DisplayObject |
Method | Defined By | ||
---|---|---|---|
Creates a new FLVPlaybackCaptioning instance. | FLVPlaybackCaptioning | ||
Adds a child DisplayObject instance to this DisplayObjectContainer instance. | DisplayObjectContainer | ||
Adds a child DisplayObject instance to this DisplayObjectContainer
instance. | DisplayObjectContainer | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Indicates whether the security restrictions
would cause any display objects to be omitted from the list returned by calling
the DisplayObjectContainer.getObjectsUnderPoint() method
with the specified point point. | DisplayObjectContainer | ||
Determines whether the specified display object is a child of the DisplayObjectContainer instance or
the instance itself. | DisplayObjectContainer | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Returns an array of FLVPlayback component cuepoints whose caption text contains the search string. | FLVPlaybackCaptioning | ||
Returns a rectangle that defines the area of the display object relative to the coordinate system
of the targetCoordinateSpace object. | DisplayObject | ||
Returns an array of FLVPlayback component cuepoints that contain the captions. | FLVPlaybackCaptioning | ||
Returns a string containing all captions as an HTML-formatted transcript. | FLVPlaybackCaptioning | ||
Returns the child display object instance that exists at the specified index. | DisplayObjectContainer | ||
Returns the child display object that exists with the specified name. | DisplayObjectContainer | ||
Returns the index position of a child DisplayObject instance. | DisplayObjectContainer | ||
Returns an array of objects that lie under the specified point and are children
(or grandchildren, and so on) of this DisplayObjectContainer instance. | DisplayObjectContainer | ||
Returns a rectangle that defines the boundary of the display object,
based on the coordinate system defined by the targetCoordinateSpace
parameter, excluding any strokes on shapes. | DisplayObject | ||
Converts the point object from the Stage (global) coordinates
to the display object's (local) coordinates. | DisplayObject | ||
Converts a two-dimensional point from the Stage (global) coordinates to a
three-dimensional display object's (local) coordinates. | DisplayObject | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Evaluates the bounding box of the display object to see if it overlaps or intersects with the
bounding box of the obj display object. | DisplayObject | ||
Evaluates the display object to see if it overlaps or intersects with the
point specified by the x and y parameters. | DisplayObject | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Converts a three-dimensional point of the three-dimensional display
object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates. | DisplayObject | ||
Converts the point object from the display object's (local) coordinates to the
Stage (global) coordinates. | DisplayObject | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. | DisplayObjectContainer | ||
Removes a child DisplayObject from the specified index position in the child list of
the DisplayObjectContainer. | DisplayObjectContainer | ||
Removes one or more child DisplayObject instances from the DisplayObjectContainer instance. | DisplayObjectContainer | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Raises a virtual keyboard. | InteractiveObject | ||
Returns a number of seconds as a timecode string. | FLVPlaybackCaptioning | ||
Changes the position of an existing child in the display object container. | DisplayObjectContainer | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Lets the user drag the specified sprite. | Sprite | ||
Lets the user drag the specified sprite on a touch-enabled device. | Sprite | ||
Ends the startDrag() method. | Sprite | ||
Ends the startTouchDrag() method, for use with touch-enabled devices. | Sprite | ||
Swaps the z-order (front-to-back order) of the two specified child objects. | DisplayObjectContainer | ||
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the
child list. | DisplayObjectContainer | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
Dispatched when a display object is added to the display list. | DisplayObject | |||
Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained. | DisplayObject | |||
Dispatched when a caption is added or removed from the caption target text field. | FLVPlaybackCaptioning | |||
Dispatched after the captionTarget property is created, but before any captions are added (the captionTarget property is empty). | FLVPlaybackCaptioning | |||
Dispatched when the user selects 'Clear' (or 'Delete') from the text context menu. | InteractiveObject | |||
Dispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject. | InteractiveObject | |||
Dispatched after all of the Timed Text XML data is loaded. | FLVPlaybackCaptioning | |||
Dispatched when a user gesture triggers the context menu associated with this interactive object in an AIR application. | InteractiveObject | |||
Dispatched when the user activates the platform-specific accelerator key combination for a copy operation or selects 'Copy' from the text context menu. | InteractiveObject | |||
Dispatched when the user activates the platform-specific accelerator key combination for a cut operation or selects 'Cut' from the text context menu. | InteractiveObject | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true. | InteractiveObject | |||
[broadcast event] Dispatched when the playhead is entering a new frame. | DisplayObject | |||
[broadcast event] Dispatched when the playhead is exiting the current frame. | DisplayObject | |||
Dispatched after a display object gains focus. | InteractiveObject | |||
Dispatched after a display object loses focus. | InteractiveObject | |||
[broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run. | DisplayObject | |||
Dispatched when the user moves a point of contact over the InteractiveObject instance on a touch-enabled device (such as moving a finger from left to right over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user creates a point of contact with an InteractiveObject instance, then taps on a touch-enabled device (such as placing several fingers over a display object to open a menu and then taps one finger to select a menu item on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user performs a rotation gesture at a point of contact with an InteractiveObject instance (such as touching two fingers and rotating them over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user performs a swipe gesture at a point of contact with an InteractiveObject instance (such as touching three fingers to a screen and then moving them in parallel over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user presses two points of contact over the same InteractiveObject instance on a touch-enabled device (such as presses and releases two fingers over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user performs a zoom gesture at a point of contact with an InteractiveObject instance (such as touching two fingers to a screen and then quickly spreading the fingers apart over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched if a call to the URLLoader.load() event attempts to access a Timed Text XML file over HTTP and the current Flash Player environment is able to detect and return the status code for the request. | FLVPlaybackCaptioning | |||
This event is dispatched to any client app that supports inline input with an IME | InteractiveObject | |||
Dispatched if a call to the URLLoader.load() event results in a fatal error that terminates the download of the Timed Text XML file. | FLVPlaybackCaptioning | |||
Dispatched when the user presses a key. | InteractiveObject | |||
Dispatched when the user attempts to change focus by using keyboard navigation. | InteractiveObject | |||
Dispatched when the user releases a key. | InteractiveObject | |||
Dispatched when a user presses and releases the middle button of the user's pointing device over the same InteractiveObject. | InteractiveObject | |||
Dispatched when a user presses the middle pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when a user presses the pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when the user attempts to change focus by using a pointer device. | InteractiveObject | |||
Dispatched when a user moves the pointing device while it is over an InteractiveObject. | InteractiveObject | |||
Dispatched when the user moves a pointing device away from an InteractiveObject instance. | InteractiveObject | |||
Dispatched when the user moves a pointing device over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when a mouse wheel is spun over an InteractiveObject instance. | InteractiveObject | |||
Dispatched by the drag initiator InteractiveObject when the user releases the drag gesture. | InteractiveObject | |||
Dispatched by the target InteractiveObject when a dragged object is dropped on it and the drop has been accepted with a call to DragManager.acceptDragDrop(). | InteractiveObject | |||
Dispatched by an InteractiveObject when a drag gesture enters its boundary. | InteractiveObject | |||
Dispatched by an InteractiveObject when a drag gesture leaves its boundary. | InteractiveObject | |||
Dispatched by an InteractiveObject continually while a drag gesture remains within its boundary. | InteractiveObject | |||
Dispatched at the beginning of a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call. | InteractiveObject | |||
Dispatched during a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call. | InteractiveObject | |||
Dispatched when the download operation to load the Timed Text XML file begins, following a call to the URLLoader.load() method. | FLVPlaybackCaptioning | |||
Dispatched when the user activates the platform-specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu. | InteractiveObject | |||
Dispatched when data is received as the download of the Timed Text XML file progresses. | FLVPlaybackCaptioning | |||
Dispatched when the user lowers an active stylus past the proximity detection threshold of the screen. | InteractiveObject | |||
Dispatched when the user lifts an active stylus above the proximity detection threshold of the screen. | InteractiveObject | |||
Dispatched when the user moves an active stylus over the screen while remaining within the proximity detection threshold. | InteractiveObject | |||
Dispatched when the user moves an active stylus away from this InteractiveObject while remaining within the proximity detection threshold of the screen. | InteractiveObject | |||
Dispatched when the user moves an active stylus directly above this InteractiveObject while remaining within the proximity detection threshold of the screen. | InteractiveObject | |||
Dispatched when the user moves an active stylus away from this InteractiveObject and any of its children while remaining within the proximity detection threshold of the screen. | InteractiveObject | |||
Dispatched when the user moves an active stylus over this InteractiveObject from outside the object's tree of descendents in the display list (while remaining within the proximity detection threshold of the screen). | InteractiveObject | |||
Dispatched when a display object is about to be removed from the display list. | DisplayObject | |||
Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained. | DisplayObject | |||
[broadcast event] Dispatched when the display list is about to be updated and rendered. | DisplayObject | |||
Dispatched when a user presses and releases the right button of the user's pointing device over the same InteractiveObject. | InteractiveObject | |||
Dispatched when a user presses the pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when a user releases the pointing device button over an InteractiveObject instance. | InteractiveObject | |||
Dispatched when the user moves a pointing device away from an InteractiveObject instance. | InteractiveObject | |||
Dispatched when the user moves a pointing device over an InteractiveObject instance. | InteractiveObject | |||
Dispatched if a call to the URLLoader.load() event attempts to load a Timed Text XML file from a server outside the security sandbox. | FLVPlaybackCaptioning | |||
Dispatched when the user activates the platform-specific accelerator key combination for a select all operation or selects 'Select All' from the text context menu. | InteractiveObject | |||
Dispatched immediately after the soft keyboard is raised. | InteractiveObject | |||
Dispatched immediately before the soft keyboard is raised. | InteractiveObject | |||
Dispatched immediately after the soft keyboard is lowered. | InteractiveObject | |||
Dispatched when the value of the object's tabChildren flag changes. | InteractiveObject | |||
Dispatched when the object's tabEnabled flag changes. | InteractiveObject | |||
Dispatched when the value of the object's tabIndex property changes. | InteractiveObject | |||
Dispatched when a user enters one or more characters of text. | InteractiveObject | |||
Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user moves the point of contact with a touch-enabled device (such as drags a finger across a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user moves the point of contact away from InteractiveObject instance on a touch-enabled device (such as drags a finger from one display object to another on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user moves the point of contact away from an InteractiveObject instance on a touch-enabled device (such as drags a finger from over a display object to a point outside the display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject | |||
Dispatched when the user lifts the point of contact over the same InteractiveObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen). | InteractiveObject |
Constant | Defined By | ||
---|---|---|---|
SHORT_VERSION : String = "2.0" [static]
State variable indicating the short version number of the component. | FLVPlaybackCaptioning | ||
VERSION : String = "2.0.0.39" [static]
State variable indicating the long version number of the component. | FLVPlaybackCaptioning |
autoLayout | property |
autoLayout:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Determines whether the FLVPlaybackCaptioning component automatically moves and resizes the TextField object for captioning.
If the autoLayout
property is set to true
, the DisplayObject instance or
the TextField object containing the captions displays 10 pixels from the bottom
of the FLVPlayback instance. The captioning area covers the width of
the FLVPlayback instance, maintaining a margin of 10 pixels on each side.
When this property is set to true
, the DisplayObject instance
or TextField object displays directly over the FLVPlayback instance.
If you are creating your own TextField object, you should set
autoLayout
to false
.
If wordWrap = false
, the captioning area centers over the FLVPlayback
instance, but it can be wider than the FLVPlayback instance.
To control layout, you need to listen for the captionChange
event to
determine when the TextField object instance is created.
The default value is true.
Implementation
public function get autoLayout():Boolean
public function set autoLayout(value:Boolean):void
Related API Elements
captionButton | property |
captionButton:Sprite
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Defines the captionButton FLVPlayback custom UI component instance which provides toggle capabilities to turn captioning on and off.
The captionButton
property functions similarly to the FLVPlayback
properties playButton
,
pauseButton
, muteButton
, and so on.
Implementation
public function get captionButton():Sprite
public function set captionButton(value:Sprite):void
Related API Elements
captionTarget | property |
captionTarget:DisplayObject
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Sets the DisplayObject instance in which to display captions.
If you set the instance as a TextField object, it is targeted directly. If you set the instance as a DisplayObjectContainer containing one or more TextField objects, the captions display in the TextField object with the lowest display index.
The DisplayObjectContainer
method supports a movie-clip like object
with a scale-9 background, which can be scaled when the TextField object size changes.
For more complex scaling and drawing, write code to have the
DisplayObjectContainer
method listen for a captionChange
event.
Note If the captionTargetName
or the captionTarget
property
is not set, the FLVPlaybackCaptioning instance creates a text field set by the
captionTarget
property with this formatting:
- black background (background =
true
; backgroundColor =0x000000
;) - white text (textColor =
0xFFFFFF
) - autoSize =
TextFieldAutoSize.LEFT
- multiLine =
true
- wordWrap =
true
- font =
"_sans"
- size =
12
To customize these values, listen for the captionTargetCreated
event.
Implementation
public function get captionTarget():DisplayObject
public function set captionTarget(value:DisplayObject):void
Related API Elements
captionTargetName | property |
captionTargetName:String
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
The instance name of the TextField object or MovieClip enclosing a Textfield object that contains the captions.
To specify no target, set this property to an empty string (that is, no target specified)
or auto
. This property is primarily used
in the Component inspector. If you are writing code, use the
captionTarget
property instead.
The default value is auto.
Implementation
public function get captionTargetName():String
public function set captionTargetName(value:String):void
Related API Elements
flvPlayback | property |
flvPlayback:FLVPlayback
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Sets the FLVPlayback instance to caption. The FLVPlayback instance must have the same parent as the FLVPlaybackCaptioning instance.
If the
flvPlaybackName
or
flvPlayback
property is not set, the
FLVPlaybackCaptioning instance will look for a FLVPlayback
instance with the same parent and caption the first one it
finds.
Implementation
public function get flvPlayback():FLVPlayback
public function set flvPlayback(value:FLVPlayback):void
Related API Elements
flvPlaybackName | property |
flvPlaybackName:String
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Sets an FLVPlayback instance name for the FLVPlayback instance that you want to caption.
To specify no target, set this to an empty string or auto
.
The FLVPlayback instance must have the same
parent as the FLVPlaybackCaptioning instance.
The FLVPlayback instance name is primarily used in
the Component inspector. If you are writing code,
use the flvPlayback
property.
If the flvPlaybackName
or
the flvPlayback
property is not set or set to auto
,
the FLVPlaybackCaptioning instance searches for a FLVPlayback
instance with the same parent and captions the first one it finds.
The default value is auto.
Implementation
public function get flvPlaybackName():String
public function set flvPlaybackName(value:String):void
Related API Elements
showCaptions | property |
showCaptions:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Used to display captions; true
= display captions,
false
= do not display captions.
If you use the captionButton
property to allow the
user to turn captioning on and off, set the showCaptions
property to false
.
The default value is true.
Implementation
public function get showCaptions():Boolean
public function set showCaptions(value:Boolean):void
Related API Elements
simpleFormatting | property |
simpleFormatting:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Limits formatting instructions
from the Timed Text file when set to true
.
The following styles are not supported if the simpleFormatting
property is set to true
:
- tts:backgroundColor
- tts:color
- tts:fontSize
- tts:fontFamily
- tts:wrapOption
The following styles are supported if the simpleFormatting
property is set to true
:
- tts:fontStyle
- tts:fontWeight
- tts:textAlign
Implementation
public function get simpleFormatting():Boolean
public function set simpleFormatting(value:Boolean):void
source | property |
track | property |
track:uint
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Support for multiple language tracks.
The best utilization of the track
property
is to support multiple language tracks with
embedded cue points.
You must follow the supported formats for FLVPlaybackCaptioning cue points.
If the track
property is set to something other than 0
,
the FLVPlaybackCaptioning component searches for a text<n> property on the cue point,
where n is the track value.
For example, if track == 1
, then the FLVPlayBackCaptioning component
searches for the parameter text1
on the cue point. If
no matching parameter is found, the text property in the cue point parameter is used.
The default value is 0.
Implementation
public function get track():uint
public function set track(value:uint):void
videoPlayerIndex | property |
videoPlayerIndex:uint
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Connects the captioning to a specific VideoPlayer in the FLVPlayback component.
If you want to use captioning in
multiple video players (using the activeVideoPlayerIndex
and visibleVideoPlayerIndex
properties in the FLVPlayback
component), you
should create one instance of the FLVPlaybackCaptioning
component for each VideoPlayer
that you will be using and set
this property to correspond to the index.
The VideoPlayer index defaults to 0 when only one video player is used.
Implementation
public function get videoPlayerIndex():uint
public function set videoPlayerIndex(value:uint):void
Related API Elements
FLVPlaybackCaptioning | () | Constructor |
public function FLVPlaybackCaptioning()
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Creates a new FLVPlaybackCaptioning instance.
findInCaptions | () | method |
public function findInCaptions(searchString:String):Array
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Returns an array of FLVPlayback component cuepoints whose caption text contains the search string.
Parameters
searchString:String — A string to search for in the captions text.
|
Array — Array An array of FLVPlayback component cuepoints
|
getCaptionsAsArray | () | method |
getCaptionsAsTranscript | () | method |
public function getCaptionsAsTranscript(preserveFormatting:Boolean = false):String
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Returns a string containing all captions as an HTML-formatted transcript.
Each caption is contained within a p
tag with the class
attribute "fl_video_caption,"
a unique id
attribute starting with the string "fl_video_caption_2_0_,"
and a title
attribute indicating the timecode at which the caption appears in the video.
Following is a brief example of the HTML returned:
<div id="fl_video_transcript" class="fl_video_transcript"> <p class="fl_video_caption" id="fl_video_caption_2_0_1" title="0:00.50"><i>( speaking French ): </i><br/><b>George: </b> Bonjour, Marie.</p> <p class="fl_video_caption" id="fl_video_caption_2_0_2" title="0:01.75"><b>Marie: </b> Bonjour, George.</p> <p class="fl_video_caption" id="fl_video_caption_2_0_3" title="0:03.75">VoilÀ une sucette.</p> <p class="fl_video_caption" id="fl_video_caption_2_0_4" title="0:05.50"><b>George: </b> C'est pour moi?</p> <p class="fl_video_caption" id="fl_video_caption_2_0_5" title="0:06.50"><b>Marie: </b> Oui, c'est pour toi.</p> <p class="fl_video_caption" id="fl_video_caption_2_0_6" title="0:08.00"><b>George: </b> Merci, Marie!</p> <p class="fl_video_caption" id="fl_video_caption_2_0_7" title="0:09.50"><b>Marie: </b> De rien, George.</p> </div>
Parameters
preserveFormatting:Boolean (default = false ) — Preserves the HTML tags used to format the caption text in Flash
|
String — String A string containing all captions as an HTML-formatted transcript
|
secondsToTime | () | method |
captionChange | Event |
fl.video.CaptionChangeEvent
property CaptionChangeEvent.type =
fl.video.CaptionChangeEvent.CAPTION_CHANGE
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when a caption is added or removed from the caption target text field.
The event is also dispatched when the following conditions are true:
- the
captionTargetName
property is not set - the
captionTarget
property is not set - the FLVPlaybackCaptioning instance creates a TextField object automatically for captioning.
The captionChange
event has the constant
CaptionChangeEvent.CAPTION_CHANGE
.
type
property of a captionChange
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
added | A Boolean that indicates whether the caption was added or removed from the display. |
captionCuePointObject | The cue point object for this caption. |
Related API Elements
captionTargetCreated | Event |
fl.video.CaptionTargetEvent
property CaptionTargetEvent.type =
fl.video.CaptionTargetEvent.CAPTION_TARGET_CREATED
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched after the captionTarget
property is created,
but before any captions are added (the captionTarget
property
is empty).
If the captionTarget
property is set with a custom
DisplayObject, or if the captionTargetName
property is
set, this event does not dispatch.
Listen for this event if you are customizing the
properties of the TextField object, for example, the defaultTextFormat
property.
The captionTargetCreated
event has the constant
CaptionTargetEvent.CAPTION_TARGET_CREATED
.
CaptionTargetEvent.CAPTION_TARGET_CREATED
constant defines the value of the
type
property of a captionTargetCreated
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
captionTarget | A display object that is from the captionTarget
property of the FLVPlaybackCaptioning instance. |
Related API Elements
complete | Event |
flash.events.Event
property Event.type =
flash.events.Event.COMPLETE
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched after all of the Timed Text XML data is loaded.
TheEvent.COMPLETE
constant defines the value of the type
property of a complete
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object that has completed loading. |
Related API Elements
httpStatus | Event |
flash.events.HTTPStatusEvent
property HTTPStatusEvent.type =
flash.events.HTTPStatusEvent.HTTP_STATUS
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched if a call to the URLLoader.load()
event attempts to access a Timed Text XML file
over HTTP and the current Flash Player environment is able to detect
and return the status code for the request.
HTTPStatusEvent.HTTP_STATUS
constant defines the value of the
type
property of a httpStatus
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
status | The HTTP status code returned by the server. |
target | The network object receiving an HTTP status code. |
Related API Elements
ioError | Event |
flash.events.IOErrorEvent
property IOErrorEvent.type =
flash.events.IOErrorEvent.IO_ERROR
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched if a call to the URLLoader.load()
event results in a fatal error
that terminates the download of the Timed Text XML file.
If this event is not handled, it will throw an error.
Defines the value of thetype
property of an ioError
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
errorID | A reference number associated with the specific error (AIR only). |
target | The network object experiencing the input/output error. |
text | Text to be displayed as an error message. |
Related API Elements
open | Event |
flash.events.Event
property Event.type =
flash.events.Event.OPEN
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when the download operation to load the Timed Text XML file
begins, following a call to the URLLoader.load()
method.
Event.OPEN
constant defines the value of the type
property of an open
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object that has opened a connection. |
Related API Elements
progress | Event |
flash.events.ProgressEvent
property ProgressEvent.type =
flash.events.ProgressEvent.PROGRESS
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched when data is received as the download of the Timed Text XML file progresses.
Defines the value of thetype
property of a progress
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
bytesLoaded | The number of items or bytes loaded at the time the listener processes the event. |
bytesTotal | The total number of items or bytes that ultimately will be loaded if the loading process succeeds. |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object reporting progress. |
Related API Elements
securityError | Event |
flash.events.SecurityErrorEvent
property SecurityErrorEvent.type =
flash.events.SecurityErrorEvent.SECURITY_ERROR
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
Dispatched if a call to the URLLoader.load()
event attempts to load a
Timed Text XML file from a server outside the security sandbox.
If this event is not handled, it will throw an error.
TheSecurityErrorEvent.SECURITY_ERROR
constant defines the value of the type
property of a securityError
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object reporting the security error. |
text | Text to be displayed as an error message. |
Related API Elements
SHORT_VERSION | Constant |
public static const SHORT_VERSION:String = "2.0"
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following trace into the FLA file:
trace (FLVPlaybackCaptioning.SHORT_VERSION);
The SHORT_VERSION
variable includes only the major
and minor version numbers, for example, 2.0. The version
variable includes
the major and minor version numbers as well as the revision and build numbers,
for example, 2.0.0.xx.
Related API Elements
VERSION | Constant |
public static const VERSION:String = "2.0.0.39"
Language Version: | ActionScript 3.0 |
Runtime Versions: | AIR 1.0, Flash Player 9.0.28.0 |
State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following trace into the FLA file:
trace (FLVPlaybackCaptioning.VERSION);
The VERSION
variable includes
the major and minor version numbers as well as the revision and build numbers,
for example, 2.0.0.xx. The SHORT_VERSION
variable includes only the major
and minor version numbers, for example, 2.0.
Related API Elements
To run the example, follow these steps:
- Open a new Flash File (ActionScript 3.0).
- Place the FLVPlayback component on the Stage at 0,0 and provide the instance name: player.
- Place the FLVPlaybackCaptioning component on the stage at 0,0 and provide the instance name: captioning.
- Place the CaptionButton component on the Stage.
- Save the FLA file and give it a name - e.g. captionEx.
- Open a new ActionScript file.
- Paste the following class example code into a new ActionScript file and save it as FLVPlaybackCaptioningExample.as in the same directory as your FLA file.
- In the FLA file (e.g. captionEx), in the Properties inspector set the Document class entry to FLVPlaybackCaptioningExample.
- Select Control > Test Movie.
package { import fl.video.CaptionChangeEvent; import fl.video.FLVPlayback; import fl.video.FLVPlaybackCaptioning; import flash.display.Sprite; import flash.text.TextField; public class FLVPlaybackCaptioningExample extends Sprite { private var videoPath:String = "http://www.helpexamples.com/flash/video/caption_video.flv"; private var captioningPath:String = "http://www.helpexamples.com/flash/video/caption_video.xml"; public function FLVPlaybackCaptioningExample() { player.source = videoPath; player.skin = "SkinOverAllNoCaption.swf"; player.skinBackgroundColor = 0x666666; player.skinBackgroundAlpha = 0.5; captioning.flvPlayback = player; captioning.source = captioningPath; captioning.autoLayout = false; captioning.addEventListener(CaptionChangeEvent.CAPTION_CHANGE, onCaptionChange); } private function onCaptionChange(e:CaptionChangeEvent):void { var tf:* = e.target.captionTarget; var player:FLVPlayback = e.target.flvPlayback; // move the caption below the video tf.y = 210; } } }
Mon Nov 28 2011, 06:48 AM -08:00