Packageorg.apache.flex.net
Classpublic class BinaryUploader
InheritanceBinaryUploader Inheritance EventDispatcher Inheritance flash.events.EventDispatcher
Implements IStrand, IBead

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The BinaryUploader class is a class designed to upload binary data over HTTP.

Default MXML Propertybeads



Public Properties
 PropertyDefined By
  beads : Array
The array property that is used to add additional beads to an MXML tag.
BinaryUploader
  binaryData : BinaryData
The data to be uploaded.
BinaryUploader
  contentType : String
The content-type of the binary data.
BinaryUploader
  data : *
[read-only] Sometimes, after the upload, the server returns useful information which will be available after the COMPLETE event.
BinaryUploader
  headers : Array
The HTTP headers to be sent with the upload.
BinaryUploader
  id : String
An id property for MXML documents.
BinaryUploader
  method : String
The HTTP method for the upload.
BinaryUploader
  responseHeaders : Array
[read-only] The HTTP headers that were received from the server if any.
BinaryUploader
  responseURL : String
[read-only] The value of the responseURL header, if any.
BinaryUploader
  status : int
[read-only] The http status code from the server, if any.
BinaryUploader
  strand : IStrand
[write-only]
BinaryUploader
  timeout : Number
A timeout value for server response.
BinaryUploader
  url : String
The url of the server.
BinaryUploader
Public Methods
 MethodDefined By
  
Constructor.
BinaryUploader
  
addBead(bead:IBead):void
Add a bead to the strand.
BinaryUploader
  
getBeadByType(classOrInterface:Class):IBead
Find a bead on the strand.
BinaryUploader
  
Remove a bead from the strand.
BinaryUploader
  
send():void
Starts the upload to the server.
BinaryUploader
Protected Methods
 MethodDefined By
  
completeHandler(event:Event):void
The handler for the COMPLETE event.
BinaryUploader
  
ioErrorHandler(event:IOErrorEvent):void
The handler for the IO_ERROR event.
BinaryUploader
  
statusHandler(event:HTTPStatusEvent):void
The handler for HTTP_STATUS and/or HTTP_RESPONSE_STATUS events
BinaryUploader
Events
 Event Summary Defined By
  Dispatched when the upload is complete.BinaryUploader
  Dispatched if Adobe AIR is able to detect and return the status code for the request.BinaryUploader
  Dispatched when an httpStatus code is received from the server.BinaryUploader
  Dispatched if an error occurs in the upload.BinaryUploader
Public Constants
 ConstantDefined By
  HTTP_METHOD_DELETE : String = DELETE
[static] The DELETE request method.
BinaryUploader
  HTTP_METHOD_GET : String = GET
[static] The GET request method.
BinaryUploader
  HTTP_METHOD_POST : String = POST
[static] The POST request method.
BinaryUploader
  HTTP_METHOD_PUT : String = PUT
[static] The PUT request method.
BinaryUploader
Property Detail
beadsproperty
public var beads:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The array property that is used to add additional beads to an MXML tag. From ActionScript, just call addBead directly.

binaryDataproperty 
binaryData:BinaryData

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The data to be uploaded. Note the type of this property is org.apache.flex.utils.BinaryData. This class abstracts the way binary data is handled in the browser.


Implementation
    public function get binaryData():BinaryData
    public function set binaryData(value:BinaryData):void
contentTypeproperty 
contentType:String

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The content-type of the binary data.

The default value is application/octet-stream.


Implementation
    public function get contentType():String
    public function set contentType(value:String):void
dataproperty 
data:*  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Sometimes, after the upload, the server returns useful information which will be available after the COMPLETE event.


Implementation
    public function get data():*
headersproperty 
headers:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The HTTP headers to be sent with the upload.


Implementation
    public function get headers():Array
    public function set headers(value:Array):void
idproperty 
id:String

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

An id property for MXML documents.


Implementation
    public function get id():String
    public function set id(value:String):void
methodproperty 
method:String

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The HTTP method for the upload.

The default value is POST.


Implementation
    public function get method():String
    public function set method(value:String):void
responseHeadersproperty 
responseHeaders:Array  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The HTTP headers that were received from the server if any.


Implementation
    public function get responseHeaders():Array
responseURLproperty 
responseURL:String  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The value of the responseURL header, if any.


Implementation
    public function get responseURL():String
statusproperty 
status:int  [read-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The http status code from the server, if any.


Implementation
    public function get status():int
strandproperty 
strand:IStrand  [write-only]

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6


Implementation
    public function set strand(value:IStrand):void
timeoutproperty 
timeout:Number

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

A timeout value for server response.


Implementation
    public function get timeout():Number
    public function set timeout(value:Number):void
urlproperty 
url:String

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The url of the server.


Implementation
    public function get url():String
    public function set url(value:String):void
Constructor Detail
BinaryUploader()Constructor
public function BinaryUploader()

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Constructor.

Method Detail
addBead()method
public function addBead(bead:IBead):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a bead to the strand.

Parameters

bead:IBead — The bead to be added.

completeHandler()method 
protected function completeHandler(event:Event):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The handler for the COMPLETE event.

Parameters

event:Event

getBeadByType()method 
public function getBeadByType(classOrInterface:Class):IBead

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Find a bead on the strand.

Parameters

classOrInterface:Class — The class or interface to use to search for the bead

Returns
IBead — The bead.
ioErrorHandler()method 
protected function ioErrorHandler(event:IOErrorEvent):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The handler for the IO_ERROR event.

Parameters

event:IOErrorEvent

removeBead()method 
public function removeBead(value:IBead):IBead

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Remove a bead from the strand.

Parameters

value:IBead — bead The bead to be removed.

Returns
IBead
send()method 
public function send():void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Starts the upload to the server. Events are dispatched as the upload progresses.

statusHandler()method 
protected function statusHandler(event:HTTPStatusEvent):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The handler for HTTP_STATUS and/or HTTP_RESPONSE_STATUS events

Parameters

event:HTTPStatusEvent

Event Detail
complete Event
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched when the upload is complete.

httpResponseStatus Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched if Adobe AIR is able to detect and return the status code for the request. Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.

httpStatus Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched when an httpStatus code is received from the server.

ioError Event  
Event Object Type: org.apache.flex.events.Event

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Dispatched if an error occurs in the upload.

Constant Detail
HTTP_METHOD_DELETEConstant
public static const HTTP_METHOD_DELETE:String = DELETE

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The DELETE request method.

HTTP_METHOD_GETConstant 
public static const HTTP_METHOD_GET:String = GET

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The GET request method.

HTTP_METHOD_POSTConstant 
public static const HTTP_METHOD_POST:String = POST

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The POST request method.

HTTP_METHOD_PUTConstant 
public static const HTTP_METHOD_PUT:String = PUT

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The PUT request method.