| Package | ardisia.components.htmlFrame |
| Class | public class HtmlFrame |
| Inheritance | HtmlFrame spark.components.supportClasses.SkinnableComponent |
| Subclasses | HtmlDragDrop |
This component will NOT work within the AIR environment. For HTML support in AIR, try the native mx.controls.HTML and flash.html.HTMLLoader classes.
View the technical documentation on the Ardisia Labs website for more information.
TO DOs
NOTES
| Property | Defined By | ||
|---|---|---|---|
| frameId : String [read-only]
The html DOM id of the frame. | HtmlFrame | ||
| framePaddingBottom : Number
Padding used to inset the frame. | HtmlFrame | ||
| framePaddingLeft : Number
Padding used to inset the frame. | HtmlFrame | ||
| framePaddingRight : Number
Padding used to inset the frame. | HtmlFrame | ||
| framePaddingTop : Number
Padding used to inset the frame. | HtmlFrame | ||
| sourceURL : String [read-only]
Return the value of the "src" property on the frame, if any. | HtmlFrame | ||
| visible : Boolean [override]
Sets the visibility of the component for both the underlying Group and
the html frame. | HtmlFrame | ||
| Property | Defined By | ||
|---|---|---|---|
| _borderThickness : Number = 1 | HtmlFrame | ||
| _borderVisible : Boolean = true | HtmlFrame | ||
| CHECK_TEST_ID_CALLBACK : String = checkTestIdCallback | HtmlFrame | ||
| ONLOAD_CALLBACK : String = onloadCallback | HtmlFrame | ||
| RESIZE_CALLBACK : String = resizeCallback | HtmlFrame | ||
| stylesDirty : Boolean | HtmlFrame | ||
| Method | Defined By | ||
|---|---|---|---|
| HtmlFrame | |||
callFrameFunction(functionName:String, params:Array = null):*
Call the named function on the frame. | HtmlFrame | ||
dispose():void
Completely remove the frame and flex container. | HtmlFrame | ||
printFrame():void
Print the frame. | HtmlFrame | ||
setFrameRawHTML(markup:String):void
Set the raw html markup for the html frame to the passed string. | HtmlFrame | ||
setFrameSourceURL(url:String):void
Set the "src" property on the html frame. | HtmlFrame | ||
setStyleProperty(propertyName:String, value:String):void
Set a style property on the frame. | HtmlFrame | ||
| Method | Defined By | ||
|---|---|---|---|
addActionscriptCallbacks():void
Add the functions that the browser can call via javascript. | HtmlFrame | ||
addEmbeddedReference():void
Sets up and calls javascript code to store a reference to the embedded
swf on the browser window object. | HtmlFrame | ||
callQueuedFunctions():void
Call all the queued functions and reset the queue. | HtmlFrame | ||
createFrame():void
Create the html frame. | HtmlFrame | ||
eventHandler(event:Event):void
Handles events for the class. | HtmlFrame | ||
frameHandler(frameId:String):void [static]
Called by javascript code after a html frame fires the 'onload' event. | HtmlFrame | ||
isTestId(testString:String):Boolean
Called by the browser in javascript. | HtmlFrame | ||
layoutFrame():void
Layout the frame. | HtmlFrame | ||
removeIframe():void
Remove the iframe. | HtmlFrame | ||
resizeHandler():void [static]
Called by javascript code after the html frame window fires its 'resize'
event. | HtmlFrame | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the "onload" event is dispatched by the html frame. | HtmlFrame | |||
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
| _borderThickness | property |
protected var _borderThickness:Number = 1| _borderVisible | property |
protected var _borderVisible:Boolean = true| CHECK_TEST_ID_CALLBACK | property |
protected var CHECK_TEST_ID_CALLBACK:String = checkTestIdCallback| frameId | property |
frameId:String [read-only] The html DOM id of the frame.
The default value is "".
public function get frameId():String| framePaddingBottom | property |
framePaddingBottom:NumberPadding used to inset the frame.
The default value is 0.
public function get framePaddingBottom():Number public function set framePaddingBottom(value:Number):void| framePaddingLeft | property |
framePaddingLeft:NumberPadding used to inset the frame.
The default value is 0.
public function get framePaddingLeft():Number public function set framePaddingLeft(value:Number):void| framePaddingRight | property |
framePaddingRight:NumberPadding used to inset the frame.
The default value is 0.
public function get framePaddingRight():Number public function set framePaddingRight(value:Number):void| framePaddingTop | property |
framePaddingTop:NumberPadding used to inset the frame.
The default value is 0.
public function get framePaddingTop():Number public function set framePaddingTop(value:Number):void| ONLOAD_CALLBACK | property |
protected var ONLOAD_CALLBACK:String = onloadCallback| RESIZE_CALLBACK | property |
protected var RESIZE_CALLBACK:String = resizeCallback| sourceURL | property |
sourceURL:String [read-only] Return the value of the "src" property on the frame, if any.
The default value is "".
public function get sourceURL():String| stylesDirty | property |
protected var stylesDirty:Boolean| visible | property |
visible:Boolean[override] Sets the visibility of the component for both the underlying Group and the html frame.
The default value is true.
public function get visible():Boolean public function set visible(value:Boolean):void| HtmlFrame | () | Constructor |
public function HtmlFrame()| addActionscriptCallbacks | () | method |
protected function addActionscriptCallbacks():voidAdd the functions that the browser can call via javascript.
| addEmbeddedReference | () | method |
protected function addEmbeddedReference():voidSets up and calls javascript code to store a reference to the embedded swf on the browser window object.
Uses the swf reference to offset the iframe layout by the swf's offset from the upper-left corner (see the javascript layout code).
Also, the javascript code uses the reference to call actionscript callbacks on the "load" and "resize" window events.
| callFrameFunction | () | method |
public function callFrameFunction(functionName:String, params:Array = null):*Call the named function on the frame.
It is important to note that only functions defined on the window frame can be called via this method. If you need to access a function on a different object, create a function on the window object to access the deeper function.
Parameters
functionName:String — the name of the function to call
| |
params:Array (default = null) — an Array of parameters to pass to the function call
|
* — the data returned by the javascript call
|
| callQueuedFunctions | () | method |
protected function callQueuedFunctions():voidCall all the queued functions and reset the queue.
| createFrame | () | method |
protected function createFrame():voidCreate the html frame.
| dispose | () | method |
public function dispose():voidCompletely remove the frame and flex container.
| eventHandler | () | method |
protected function eventHandler(event:Event):voidHandles events for the class.
Parameters
event:Event — the Event that triggered the handler
|
| frameHandler | () | method |
protected static function frameHandler(frameId:String):voidCalled by javascript code after a html frame fires the 'onload' event.
Must be a class function because each HtmlFrame sets up a callback to the same named function in actionscript. As a result, if multiple HtmlFrame components are added, the latter callback will overwrite the earlier callback and as a result, the earlier frame will never be initialized.
The class handler will use the passed frameId param to determine which HtmlFrame instance fired the onload event.
Will set the frame visibility to 'visible', and call any queued functions.
Parameters
frameId:String — the frameId of the frame that fired the handler
|
| isTestId | () | method |
protected function isTestId(testString:String):BooleanCalled by the browser in javascript. Tests whether the passed string is the test string.
Parameters
testString:String — the string to test against
|
Boolean — true on success
|
| layoutFrame | () | method |
protected function layoutFrame():voidLayout the frame. Account for the borderStroke and framePadding.
| printFrame | () | method |
public function printFrame():voidPrint the frame. Note: this may fail for external URL's due to security limitations.
| removeIframe | () | method |
protected function removeIframe():voidRemove the iframe.
| resizeHandler | () | method |
protected static function resizeHandler():voidCalled by javascript code after the html frame window fires its 'resize' event.
Must be a class function because the window resize event will fire only once, so it needs to be applied to all instances after the unitary event is dispatched.
| setFrameRawHTML | () | method |
public function setFrameRawHTML(markup:String):voidSet the raw html markup for the html frame to the passed string. Will overwrite any existent markup.
Will not work if the frame has previously had its "src" property set. In other words, once a url is applied, this call no longer works.
Parameters
markup:String — the html to insert into the frame
|
| setFrameSourceURL | () | method |
public function setFrameSourceURL(url:String):voidSet the "src" property on the html frame.
Parameters
url:String — the string url
|
| setStyleProperty | () | method |
public function setStyleProperty(propertyName:String, value:String):voidSet a style property on the frame.
Parameters
propertyName:String — the property to change
| |
value:String — the property value represented as a String
|
| frameOnload | Event |
ardisia.components.htmlFrame.events.HtmlFrameEventardisia.components.htmlFrame.events.HtmlFrameEventDispatched when the "onload" event is dispatched by the html frame.