Packagecom.dasflash.soundcloud.as3api
Classpublic class SoundcloudDelegate
InheritanceSoundcloudDelegate Inheritance flash.events.EventDispatcher

SoundcloudDelegate represents a single call to the API.

Usually you don't create instances of this class directly; they get returned by SoundcloudClient.sendRequest.

See also

SoundcloudClient.sendRequest


Protected Properties
 PropertyDefined By
  fileParameterName : String
SoundcloudDelegate
  fileReference : FileReference
SoundcloudDelegate
  responseFormat : String
SoundcloudDelegate
  urlLoader : URLLoader
SoundcloudDelegate
  urlRequest : URLRequest
SoundcloudDelegate
Public Methods
 MethodDefined By
  
SoundcloudDelegate(url:String, method:String, consumer:OAuthConsumer, token:OAuthToken = null, data:Object = null, responseFormat:String, dataFormat:String)
The constructor only builds the request object and adds response listeners.
SoundcloudDelegate
  
execute():void
Sends the actual request.
SoundcloudDelegate
Events
 Event Summary Defined By
  Dispatched when a call has failed.SoundcloudDelegate
  Progress event of file upload.SoundcloudDelegate
  Dispatched after the response has been downloaded and parsed successfully.SoundcloudDelegate
Protected Constants
 ConstantDefined By
  signatureMethod : IOAuthSignatureMethod
SoundcloudDelegate
Property Detail
fileParameterNameproperty
protected var fileParameterName:String

fileReferenceproperty 
protected var fileReference:FileReference

responseFormatproperty 
protected var responseFormat:String

urlLoaderproperty 
protected var urlLoader:URLLoader

urlRequestproperty 
protected var urlRequest:URLRequest

Constructor Detail
SoundcloudDelegate()Constructor
public function SoundcloudDelegate(url:String, method:String, consumer:OAuthConsumer, token:OAuthToken = null, data:Object = null, responseFormat:String, dataFormat:String)

The constructor only builds the request object and adds response listeners. The method execute must be called subsequently to send the actual request.

Parameters
url:String — The full URL, e.g. "http://api.soundcloud.com/user/userid/tracks"
 
method:String — GET, POST, PUT or DELETE. Note that FlashPlayer only supports GET and POST as of this writing. AIR supports all four methods.
 
consumer:OAuthConsumer — The OAuth consumer. This parameter is not optional, but the token can be empty if you only want to access public resources.
 
token:OAuthToken (default = null) — (optional) The OAuth token. If this parameter is omitted you can only access public resources.
 
data:Object (default = null) — (optional) the data to be sent. This can be a generic object containing request parameters as key/value pairs or a XML object
 
responseFormat:String — (optional) tells Soundcloud whether to render response as JSON or XML. Value must be SoundcloudResponseFormat.JSON, .XML or an empty String (default) which will also return XML
 
dataFormat:String — (optional) tells the URLLoader how to handle the returned data. Must be URLLoaderDataFormat.TEXT, .VARIABLES or .BINARY. If responseFormat is JSON or XML this parameter will be overriden with .TEXT
Method Detail
execute()method
public function execute():void

Sends the actual request.

Event Detail
fault Event
Event Object Type: com.dasflash.soundcloud.as3api.events.SoundcloudFaultEvent
SoundcloudFaultEvent.type property = com.dasflash.soundcloud.as3api.events.SoundcloudFaultEvent.FAULT

Dispatched when a call has failed.

progress Event  
Event Object Type: flash.events.ProgressEvent
ProgressEvent.type property = flash.events.ProgressEvent.PROGRESS

Progress event of file upload.

requestComplete Event  
Event Object Type: com.dasflash.soundcloud.as3api.events.SoundcloudEvent
SoundcloudEvent.type property = com.dasflash.soundcloud.as3api.events.SoundcloudEvent.REQUEST_COMPLETE

Dispatched after the response has been downloaded and parsed successfully.

Constant Detail
signatureMethodConstant
protected const signatureMethod:IOAuthSignatureMethod