| Package | flash.html |
| Class | public class HTMLControl |
| Inheritance | HTMLControl Sprite DisplayObjectContainer InteractiveObject DisplayObject EventDispatcher Object |
| Property | Defined by | ||
|---|---|---|---|
![]() | accessibilityProperties : AccessibilityProperties
The current accessibility options for this display object.
| DisplayObject | |
![]() | alpha : Number
Indicates the alpha transparency value of the object specified.
| DisplayObject | |
![]() | blendMode : String
A value from the BlendMode class that specifies which blend mode to use.
| DisplayObject | |
![]() | buttonMode : Boolean
Specifies the button mode of this sprite.
| Sprite | |
![]() | cacheAsBitmap : Boolean
If set to
true, Flash Player caches an internal bitmap representation of the
display object. | DisplayObject | |
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | contextMenu : ContextMenu
Specifies the context menu associated with this object.
| InteractiveObject | |
![]() | doubleClickEnabled : Boolean
Specifies whether the object receives
doubleClick events. | InteractiveObject | |
![]() | dropTarget : DisplayObject
Specifies the display object over which the sprite is being dragged, or on
which the sprite was dropped.
| Sprite | |
| exposeRuntime : Boolean
Determines if ActionScript definitions should be made available to JavaScript running in the HTMLControl.
| HTMLControl | ||
![]() | filters : Array
An indexed array that contains each filter object currently associated with the display object.
| DisplayObject | |
![]() | focusRect : Object
Specifies whether this object displays a focus rectangle.
| InteractiveObject | |
![]() | graphics : Graphics
Specifies the Graphics object that belongs to this sprite where vector
drawing commands can occur.
| Sprite | |
| height : Number
Specifies the height of the rectangle of the HTML canvas that is being rendered.
| HTMLControl | ||
![]() | hitArea : Sprite
Designates another sprite to serve as the hit area for a sprite.
| Sprite | |
| htmlHeight : Number
[read-only]
The height, in pixels, of the HTML content.
| HTMLControl | ||
| htmlWidth : Number
[read-only]
The width, in pixels, of the HTML content.
| HTMLControl | ||
| loaded : Boolean
[read-only]
Indicates whether the JavaScript load event corresponding to the previous call to the load or loadString method
has been delivered to the HTML DOM in the HTMLControl.
| HTMLControl | ||
![]() | loaderInfo : LoaderInfo
Returns a LoaderInfo object containing information about loading the file
to which this display object belongs.
| DisplayObject | |
| location : String
[read-only]
The URL for the content loaded in the HTMLControl object.
| HTMLControl | ||
![]() | 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 enabled.
| DisplayObjectContainer | |
![]() | mouseEnabled : Boolean
Specifies whether this object receives mouse messages.
| InteractiveObject | |
![]() | mouseX : Number
Indicates the x coordinate of the mouse position, in pixels.
| DisplayObject | |
![]() | mouseY : Number
Indicates the y coordinate of the mouse position, in pixels.
| DisplayObject | |
![]() | name : String
Indicates the instance name of the DisplayObject.
| DisplayObject | |
![]() | numChildren : int
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
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
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 | |
![]() | 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 | |
| scrollH : Number
The horizonal scroll position of the HTML content within the HTMLControl object.
| HTMLControl | ||
![]() | scrollRect : Rectangle
The scroll rectangle bounds of the display object.
| DisplayObject | |
| scrollV : Number
The vertical scroll position of the HTML content within the HTMLControl object.
| HTMLControl | ||
![]() | soundTransform : SoundTransform
Controls sound within this sprite.
| Sprite | |
![]() | stage : Stage
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 : TextSnapshot
Returns a TextSnapshot object for this DisplayObjectContainer instance.
| DisplayObjectContainer | |
![]() | transform : 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 mouse rolls
over a sprite in which the
buttonMode property is set to true. | Sprite | |
![]() | visible : Boolean
Whether or not the display object is visible.
| DisplayObject | |
| width : Number
Specifies the width of the rectangle of the HTML canvas that is being rendered.
| HTMLControl | ||
| window : JavaScriptObject
[read-only]
The global JavaScript object for the content loaded into the HTML control.
| HTMLControl | ||
![]() | 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 | |
| Method | Defined by | ||
|---|---|---|---|
|
Creates an HTMLControl object.
| HTMLControl | ||
![]() |
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 | |
|
cancelLoad():void
Cancels any load operation in progress.
| HTMLControl | ||
![]() |
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 a rectangle that defines the area of the display object relative to the coordinate system
of the
targetCoordinateSpace object. | DisplayObject | |
![]() |
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 | |
![]() |
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | |
![]() |
Evaluates the display object to see if it overlaps or intersects with 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 | |
|
load(urlRequestToLoad:URLRequest):void
Load the control with data from the site specified by urlRequest.
| HTMLControl | ||
|
loadString(htmlContent:String):void
Load the control with the HTML content contained in the HTML string.
| HTMLControl | ||
![]() |
Converts the
point object from the display object's (local) coordinates to the
Stage (global) coordinates. | DisplayObject | |
|
reload():void
Reloads the page from the current location.
| HTMLControl | ||
![]() |
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 a listener from the EventDispatcher object.
| EventDispatcher | |
![]() |
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 | |
![]() |
stopDrag():void
Ends the
startDrag() method. | 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 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 | ||
|---|---|---|---|---|
![]() | Dispatched when Flash Player 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 user presses and releases the main button of the user's pointing device over the same InteractiveObject. | InteractiveObject | ||
| Signals that the last load operation requested by loadString or load has completed. | HTMLControl | |||
![]() | Dispatched when Flash Player loses operating system focus and is becoming inactive. | EventDispatcher | ||
| Signals that the HTML DOM has be created in response to a load operation. | HTMLControl | |||
![]() |
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 | ||
![]() | Dispatched when the playhead is entering a new frame. | DisplayObject | ||
![]() | Dispatched after a display object gains focus. | InteractiveObject | ||
![]() | Dispatched after a display object loses focus. | InteractiveObject | ||
Signals the one or both of the htmlWidth and htmlHeight
properties have changed. | HTMLControl | |||
| Signals that the rendering of content in the HTMLControl object is fully up-to-date. | HTMLControl | |||
![]() | 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 | ||
Signals the location property of the HTMLControl object has changed. | HTMLControl | |||
![]() | Dispatched when a user presses the pointing device button over an InteractiveObject instance in the Flash Player window. | 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 in the Flash Player window. | InteractiveObject | ||
![]() | Dispatched when a user releases the pointing device button over an InteractiveObject instance in the Flash Player window. | InteractiveObject | ||
![]() | Dispatched when a mouse wheel is spun over an InteractiveObject instance in the Flash Player window. | 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 | ||
![]() | Dispatched when the display list is about to be updated and rendered. | DisplayObject | ||
![]() | 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 | ||
Signals that the scrollH or scrollV property have been changed
by the HTMLControl. | HTMLControl | |||
![]() |
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 | ||
| Signals that an uncaught JavaScript exception occurred in the HTMLControl. | HTMLControl | |||
| exposeRuntime | property |
exposeRuntime:Boolean [read-write]Determines if ActionScript definitions should be made available to JavaScript running in the HTMLControl. Defaults to false. Setting this property has no effect until after the next documentCreated event has been dispatched.
Implementation public function get exposeRuntime():Boolean
public function set exposeRuntime(value:Boolean):void
| height | property |
height:Number [read-write]
Specifies the height of the rectangle of the HTML canvas that is being rendered.
This is the height of the HTMLControl DisplayObject in pixels.
Changing this property will cause the HTMLControl to re-render the HTML document.
HTML_BOUNDS_CHANGE events may dispatched in response to changing this property.
When you set the width and
height property of an HTMLControl object, the bounds of the object change but
content is not scaled (as would happen with other types of display objects).
public function get height():Number
public function set height(value:Number):void
| htmlHeight | property |
htmlHeight:Number [read-only]The height, in pixels, of the HTML content.
Implementation public function get htmlHeight():Number
| htmlWidth | property |
htmlWidth:Number [read-only]The width, in pixels, of the HTML content.
Implementation public function get htmlWidth():Number
| loaded | property |
loaded:Boolean [read-only]Indicates whether the JavaScript load event corresponding to the previous call to the load or loadString method has been delivered to the HTML DOM in the HTMLControl. This property will be true before the COMPLETE event is dispatched. It is possible that this property will never become true. This happens in the same cases as when the COMPLETE event is never dispatched.
Implementation public function get loaded():Boolean
| location | property |
location:String [read-only]The URL for the content loaded in the HTMLControl object.
Implementation public function get location():String
| scrollH | property |
scrollH:Number [read-write]The horizonal scroll position of the HTML content within the HTMLControl object.
Implementation public function get scrollH():Number
public function set scrollH(value:Number):void
| scrollV | property |
scrollV:Number [read-write]The vertical scroll position of the HTML content within the HTMLControl object.
Implementation public function get scrollV():Number
public function set scrollV(value:Number):void
| width | property |
width:Number [read-write]
Specifies the width of the rectangle of the HTML canvas that is being rendered.
This is the width of the HTMLControl DisplayObject in pixels.
Changing this property will cause the HTMLControl to re-render the HTML document.
HTML_BOUNDS_CHANGE events may dispatched in response to changing this property.
When you set the width and
height property of an HTMLControl object, the bounds of the object change but
content is not scaled (as would happen with other types of display objects).
public function get width():Number
public function set width(value:Number):void
| window | property |
window:JavaScriptObject [read-only]The global JavaScript object for the content loaded into the HTML control.
Implementation public function get window():JavaScriptObject
| HTMLControl | () | constructor |
public function HTMLControl()Creates an HTMLControl object.
| cancelLoad | () | method |
public function cancelLoad():voidCancels any load operation in progress.
| load | () | method |
public function load(urlRequestToLoad:URLRequest):voidLoad the control with data from the site specified by urlRequest. Sets the loaded property to false. This method initiates an operation that always completes asynchronously. It is possible the COMPLETE event will never delivered. This will happen if any of the HTML content loaded into the HTMLControl never finishes downloaded. The most likely scenario is the HTML content references a URL to a CGI script that generates content forever. A call to this method implicitly cancels any pending previous load operation initiated with this method or the loadString method. The COMPLETE event for the previous load operation will never be delivered.
ParametersurlRequestToLoad:URLRequest — The URLRequest object containing information about the URL to
load. In addition to the URL to load, a URLRequest object contains properties that define
the HTTP form submission method (GET or POST), any data to be transmitted with the request,
and request headers.
|
See also
| loadString | () | method |
public function loadString(htmlContent:String):voidLoad the control with the HTML content contained in the HTML string. When rendering of the of the html in the string is complete, the COMPLETE event is dispatched. The COMPLETE event is always dispatched asynchronously. A call to this method implicitly cancels any pending previous load operation initiated with this method or the load method. The COMPLETE event for the previous load operation will never be delivered. If the HTML specified in the string has no references to external resources, then this method will synchronously render the HTML. However, the COMPLETE event will still be dispatched asynchronously. If the loaded property of this class is true immediately following a call to this function then the HTML content specified in htmlContent argument was rendered synchronously. It is possible the COMPLETE event will never delivered. This will happen if any of the HTML content loaded into the HTMLControl never finishes downloaded. The most likely scenario is the HTML content references a URL to a CGI script that generates content forever.
ParametershtmlContent:String — The string containing the HTML content to load into the HTMLControl object.
|
| reload | () | method |
public function reload():voidReloads the page from the current location.
| complete | event |
flash.events.Event
flash.events.Event.COMPLETE
Signals that the last load operation requested by loadString or load has completed. The event is dispatched AFTER the javascript load event has fired on the HTML DOM in the HTMLControl. Always dispatched asynchronously. The event handler for this event may call any method or access any property of the HTMLControl.
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. |
See also
| domInitialize | event |
flash.events.Event
Signals that the HTML DOM has be created in response to a load operation. The load()
and loadString() methods of the HTMLControl object throw an exception while
this event is being dispatched. Any property or method of any JavaScript object accessible from the
window property of the HTMLControl object that controls the URL that is loaded in
the HTMLControl object throws an exception if set or called while this event is dispatched.
For example, setting window.location via the window property of
the HTMLControl object will result in a JavaScript exception.
See also
| htmlBoundsChange | event |
flash.events.Event
Signals the one or both of the htmlWidth and htmlHeight
properties have changed. This may be result from a new image or other content loading,
for example. Event handlers may call any method or access any property
of the HTMLControl object.
The HTMLControl object may dispatch this event any time after a load operation is initiated.
The HTMLControl object may dispatch this event even after the object has dispatched the
complete event.
See also
| htmlRender | event |
flash.events.Event
Signals that the rendering of content in the HTMLControl object is fully up-to-date. This event can be dispatched quite frequentlywhenever any rendering change is made to the HTML content. For example, this event is dispatched when new content is displayed as a result of a user clicking a link or when JavaScript in the page renders HTML. Event listeners may call any method or access any property of the HTMLControl.
Handlers of this event should check the htmlWidth and htmlHeight
properties of the HTMLControl to update any scroll bars associated with the HTMLControl.
The HTMLControl object may dispatch this event any time after a load operation is initiated.
The HTMLControl object may dispatch this event even after the object has dispatched the
complete event.
| locationChange | event |
flash.events.Event
Signals the location property of the HTMLControl object has changed.
The event handler for this event may call any method or access any property of the
HTMLControl object.
See also
| scroll | event |
flash.events.Event
flash.events.Event.SCROLL
Signals that the scrollH or scrollV property have been changed
by the HTMLControl. The HTMLControl object dispatches this event when JavaScript running in the
HTMLControl invokes the scrollTo() method of the window object
and the desired location is not already visible. The event is not dispatched when ActionScript
code changes the scrollH or scrollV property.
Event handlers may call any method or access any property
of the HTMLControl object.
Event handlers for this event should check the scrollH and scrollV
properties to update any scroll bars associated with the HTMLControl object.
The HTMLControl object may dispatch this event any time after a load operation is initiated.
The HTMLControl object may dispatch this event even after the object has dispatched the
complete event.
Defines the value of the type property of a scroll 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 TextField object that has been scrolled.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event. |
| uncaughtJavaScriptException | event |
flash.events.HTMLUncaughtJavaScriptExceptionEvent
Signals that an uncaught JavaScript exception occurred in the HTMLControl. Event handlers may call any method or access any property of the HTMLControl object.
See also
package {
import flash.display.Sprite;
import flash.html.HTMLControl;
import flash.net.URLRequest;
public class HTMLControlExample extends Sprite
{
public function HTMLControlExample()
{
var html:HTMLControl = new HTMLControl();
var urlReq:URLRequest = new URLRequest("http://www.adobe.com/");
html.width = stage.stageWidth;
html.height = stage.stageHeight;
html.load(urlReq);
addChild(html);
}
}
}