Packageorg.si.sion.utils.soundloader
Classpublic class SoundLoader
InheritanceSoundLoader Inheritance flash.events.EventDispatcher

Sound Loader. SoundLoader.setURL() to set loading url, SoundLoader.loadAll() to load all files and SoundLoader.hash to access all loaded files.

See also

setURL()
loadAll()
hash


Public Properties
 PropertyDefined By
  bytesLoaded : Number
[read-only] file size currently loaded
SoundLoader
  bytesTotal : Number
[read-only] total file size when complete all loadings.
SoundLoader
  hash : *
[read-only] Object to access all Sound instances.
SoundLoader
  loadedFileCount : int
[read-only] loaded file count
SoundLoader
  loadImgFileAsSoundFont : Boolean
true to load 'swf' and 'png' type file as 'ssf' and 'ssfpng'
SoundLoader
  loadingFileCount : int
[read-only] loading file count, this number is decreased when the file is loaded.
SoundLoader
  loadMP3FileAsBinary : Boolean
true to load 'mp3' type file as 'mp3bin'
SoundLoader
  rememberHistory : Boolean
true to check ID confirictoin
SoundLoader
Protected Properties
 PropertyDefined By
  _bytesLoaded : int
loaded file size
SoundLoader
  _bytesTotal : Number
total file size
SoundLoader
  _errorFileCount : int
error file count
SoundLoader
  _loaded : *
loaded sounds
SoundLoader
  _loadedFileCount : int
loaded file count
SoundLoader
  _loadedFileData : *
loaded file data
SoundLoader
  _loadImgFileAsSoundFont : Boolean
true to load 'swf' and 'png' type file as 'ssf' and 'ssfpng'
SoundLoader
  _loadingFileCount : int
loading file count
SoundLoader
  _loadMP3FileAsBinary : Boolean
true to load 'mp3' type file as 'mp3bin'
SoundLoader
  _preserveList : Vector.<SoundLoaderFileData>
loading url list
SoundLoader
  _rememberHistory : Boolean
true to remember history
SoundLoader
Public Methods
 MethodDefined By
  
SoundLoader(eventPriority:int = 0, loadImgFileAsSoundFont:Boolean = false, loadMP3FileAsBinary:Boolean = false, rememberHistory:Boolean = false)
Constructor.
SoundLoader
  
loadAll():int
load all files specifed by SoundLoder.setURL()
SoundLoader
  
setByteArrayImage(byteArray:ByteArray, id:String):SoundLoaderFileData
ByteArray convert to Loader (image and swf)
SoundLoader
  
setByteArraySound(byteArray:ByteArray, id:String):SoundLoaderFileData
ByteArray convert to Sound
SoundLoader
  
setURL(urlRequest:URLRequest, id:String = null, type:String = null, checkPolicyFile:Boolean = false):SoundLoaderFileData
set loading file's urls.
SoundLoader
  
toString():String
[override] output loaded file information
SoundLoader
Events
 Event Summary Defined By
  SoundLoader
  SoundLoader
  SoundLoader
Property Detail
_bytesLoadedproperty
protected var _bytesLoaded:int

loaded file size

_bytesTotalproperty 
protected var _bytesTotal:Number

total file size

_errorFileCountproperty 
protected var _errorFileCount:int

error file count

_loadedproperty 
protected var _loaded:*

loaded sounds

_loadedFileCountproperty 
protected var _loadedFileCount:int

loaded file count

_loadedFileDataproperty 
protected var _loadedFileData:*

loaded file data

_loadImgFileAsSoundFontproperty 
protected var _loadImgFileAsSoundFont:Boolean

true to load 'swf' and 'png' type file as 'ssf' and 'ssfpng'

The default value is false.

_loadingFileCountproperty 
protected var _loadingFileCount:int

loading file count

_loadMP3FileAsBinaryproperty 
protected var _loadMP3FileAsBinary:Boolean

true to load 'mp3' type file as 'mp3bin'

The default value is false.

_preserveListproperty 
protected var _preserveList:Vector.<SoundLoaderFileData>

loading url list

_rememberHistoryproperty 
protected var _rememberHistory:Boolean

true to remember history

The default value is false.

bytesLoadedproperty 
bytesLoaded:Number  [read-only]

file size currently loaded


Implementation
    public function get bytesLoaded():Number
bytesTotalproperty 
bytesTotal:Number  [read-only]

total file size when complete all loadings.


Implementation
    public function get bytesTotal():Number
hashproperty 
hash:*  [read-only]

Object to access all Sound instances.


Implementation
    public function get hash():*
loadedFileCountproperty 
loadedFileCount:int  [read-only]

loaded file count


Implementation
    public function get loadedFileCount():int
loadImgFileAsSoundFontproperty 
loadImgFileAsSoundFont:Boolean

true to load 'swf' and 'png' type file as 'ssf' and 'ssfpng'

The default value is false.


Implementation
    public function get loadImgFileAsSoundFont():Boolean
    public function set loadImgFileAsSoundFont(value:Boolean):void
loadingFileCountproperty 
loadingFileCount:int  [read-only]

loading file count, this number is decreased when the file is loaded.


Implementation
    public function get loadingFileCount():int
loadMP3FileAsBinaryproperty 
loadMP3FileAsBinary:Boolean

true to load 'mp3' type file as 'mp3bin'

The default value is false.


Implementation
    public function get loadMP3FileAsBinary():Boolean
    public function set loadMP3FileAsBinary(value:Boolean):void
rememberHistoryproperty 
rememberHistory:Boolean

true to check ID confirictoin

The default value is false.


Implementation
    public function get rememberHistory():Boolean
    public function set rememberHistory(value:Boolean):void
Constructor Detail
SoundLoader()Constructor
public function SoundLoader(eventPriority:int = 0, loadImgFileAsSoundFont:Boolean = false, loadMP3FileAsBinary:Boolean = false, rememberHistory:Boolean = false)

Constructor.

Parameters
eventPriority:int (default = 0) — priority of all events disopatched by this sound loader.
 
loadImgFileAsSoundFont:Boolean (default = false) — true to load 'swf' and 'png' type file as 'ssf' and 'ssfpng'
 
loadMP3FileAsBinary:Boolean (default = false) — true to load 'mp3' type file as 'mp3bin'
 
rememberHistory:Boolean (default = false) — true to check ID confirictoin,
Method Detail
loadAll()method
public function loadAll():int

load all files specifed by SoundLoder.setURL()

Returns
int — loading file count, 0 when no loading
setByteArrayImage()method 
public function setByteArrayImage(byteArray:ByteArray, id:String):SoundLoaderFileData

ByteArray convert to Loader (image and swf)

Parameters

byteArray:ByteArray — ByteArray to convert
 
id:String — access key of SoundLoder.hash

Returns
SoundLoaderFileData — SoundLoaderFileData instance. SoundLoaderFileData is information class of loading file.
setByteArraySound()method 
public function setByteArraySound(byteArray:ByteArray, id:String):SoundLoaderFileData

ByteArray convert to Sound

Parameters

byteArray:ByteArray — ByteArray to convert
 
id:String — access key of SoundLoder.hash

Returns
SoundLoaderFileData — SoundLoaderFileData instance. SoundLoaderFileData is information class of loading file.
setURL()method 
public function setURL(urlRequest:URLRequest, id:String = null, type:String = null, checkPolicyFile:Boolean = false):SoundLoaderFileData

set loading file's urls.

Parameters

urlRequest:URLRequest — requesting url
 
id:String (default = null) — access key of SoundLoder.hash. null to set same as file name (without path, with extension).
 
type:String (default = null) — file type, "mp3", "wav", "ssf", "ssfpng", "mid", "swf" or "mp3bin" is available, null to detect automatically by file extension. ("swf", "png", "gif", "jpg", "img", "bin", "txt" and "var" are available for non-sound files).
 
checkPolicyFile:Boolean (default = false) — LoaderContext.checkPolicyFile

Returns
SoundLoaderFileData — SoundLoaderFileData instance. SoundLoaderFileData is information class of loading file.
toString()method 
override public function toString():String

output loaded file information

Returns
String
Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

error Event  
Event Object Type: flash.events.ErrorEvent
ErrorEvent.type property = flash.events.ErrorEvent.ERROR

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