Package | ardisia.components.htmlDragDrop |
Class | public class HtmlDragDrop |
Inheritance | HtmlDragDrop HtmlFrame spark.components.supportClasses.SkinnableComponent |
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.
This component can accept multiple dropped files. When multiple files are dropped together, the "dragLoad" event will fire for each file dropped. Drops can be cancelled via the "dragDropStarting" event.
See the HtmlDragDropFile and HtmlDragDropEvent classes for the information available to the flex app during dragging and dropping.
View the technical documentation on the Ardisia Labs website for more information.
DESIGN 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 | ||
isDraggedOver : Boolean [read-only]
Return whether the user is dragging over the control via the HTML5 api. | HtmlDragDrop | ||
isDropping : Boolean [read-only]
Return whether a drag is being processed. | HtmlDragDrop | ||
isSupported : Boolean [read-only]
Return whether the ExternalInterface supports the HTML5 drag and drop
API. | HtmlDragDrop | ||
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 |
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 | ||
dragDropErrorHandler(frameId:String, error:String, file:Object):void
Handles error events returned by javascript. | HtmlDragDrop | ||
dragHandler(frameId:String, type:String, dataTransfer:Object, types:Array):Array
Handles the drag events. | HtmlDragDrop | ||
dropHandler(frameId:String, type:String, file:Object = null, data:* = null, progress:Object = null):Boolean
Handles drop events. | HtmlDragDrop | ||
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 dropped file was being read into a data buffer, but was aborted. | HtmlDragDrop | |||
Dispatched when the browser does not support file drag and drop. | HtmlDragDrop | |||
Dispatched immediately after a drop is initiated over the control. | HtmlDragDrop | |||
Dispatched when the user drags over the control. | HtmlDragDrop | |||
Dispatched when the user drags out of the control. | HtmlDragDrop | |||
Dispatched when a dropped file has been fully processed by both javascript and actionscript and is available as a ByteArray. | HtmlDragDrop | |||
Dispatched when a drop file is initially being read into memory. | HtmlDragDrop | |||
Dispatched continuously when the user is dragging over the control. | HtmlDragDrop | |||
Dispatched while the dropped file is being read into a buffer by the browser. | HtmlDragDrop | |||
Dispatched when the "onload" event is dispatched by the html frame. | HtmlFrame | |||
Dispatched when the dropped file was not found. | HtmlDragDrop | |||
Dispatched when the dropped file was not readable by the browser. | HtmlDragDrop | |||
Dispatched when the error was unknown. | HtmlDragDrop |
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.
isDraggedOver | property |
isDraggedOver:Boolean
[read-only] Return whether the user is dragging over the control via the HTML5 api.
The default value is false
.
public function get isDraggedOver():Boolean
isDropping | property |
isDropping:Boolean
[read-only] Return whether a drag is being processed.
The default value is false
.
public function get isDropping():Boolean
isSupported | property |
isSupported:Boolean
[read-only] Return whether the ExternalInterface supports the HTML5 drag and drop API.
The default value is false
.
public function get isSupported():Boolean
dragDropErrorHandler | () | method |
protected function dragDropErrorHandler(frameId:String, error:String, file:Object):void
Handles error events returned by javascript. Called by javascript.
Parameters
frameId:String — the frameId of the frame that fired the handler
| |
error:String — the String description of the error
| |
file:Object — the javascript File object
|
dragHandler | () | method |
protected function dragHandler(frameId:String, type:String, dataTransfer:Object, types:Array):Array
Handles the drag events. Called by javascript.
Parameters
frameId:String — the frameId of the frame that fired the handler
| |
type:String — the type of event
| |
dataTransfer:Object — the javascript dataTransfer object
| |
types:Array — the mime types of the dragged elements
|
Array — array of potentially changed dropEffect, effectAllowed
properties
|
dropHandler | () | method |
protected function dropHandler(frameId:String, type:String, file:Object = null, data:* = null, progress:Object = null):Boolean
Handles drop events. Called by javascript.
Parameters
frameId:String — the frameId of the frame that fired the handler
| |
type:String — the type of javascript event
| |
file:Object (default = null ) — the javascript File object
| |
data:* (default = null ) — file data
| |
progress:Object (default = null ) — the javascript Progress event
|
Boolean — true to cancel the drop, only for the "starting" event
|
abortErr | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
Dispatched when the dropped file was being read into a data buffer, but was aborted.
browserNoSupportErr | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
Dispatched when the browser does not support file drag and drop.
dragDropStarting | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched immediately after a drop is initiated over the control. Can be cancelled to prevent the drop. The first drop event to fire.
dragEnter | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched when the user drags over the control.
dragLeave | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched when the user drags out of the control.
dragLoad | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched when a dropped file has been fully processed by both javascript and actionscript and is available as a ByteArray.
The final drop event to fire.
dragLoadStart | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched when a drop file is initially being read into memory. The second drop event to fire.
dragOver | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched continuously when the user is dragging over the control.
dragProgress | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropEvent
Dispatched while the dropped file is being read into a buffer by the browser. This will not reflect the time it takes the flex app to decode the data buffer into a ByteArray.
The third drop event to fire. Returns the percent loaded.
notFoundErr | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
Dispatched when the dropped file was not found.
notReadableErr | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
Dispatched when the dropped file was not readable by the browser.
unknownErr | Event |
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
ardisia.components.htmlDragDrop.events.HtmlDragDropErrorEvent
Dispatched when the error was unknown.