ActionScript Reference - AS3


Properties

preloaderText
autoStart
loaderBarColor
loaderBackgroundColor
loaderTextColor
loaderBarAlpha
loaderBackgroundAlpha
valign
halign
loaderVCustPos
loaderHCustPos
loaderLabelSpace
loaderLabelAlign
loaderStyle
loaderPrcntStep
showLoaderBar
showLoaderLabel
showLabelBorder
loaderWidth
loaderHeight
loaderLabelWidth
loaderCache
getFileBT
getFileBL
getFilePrcnt
getFileName
getTargetMovie
customPreloader
bounceDuration
showLabelBackground
labelBackgroundColor
labelFormat



Methods

loadFile
afterLoad
setStreaming
unloadFile

 

PROPERTIES

preloaderText

Sets the text for the preloader's label.Have several regular expressions:
%pl% - percents loaded
%bl% - bytes loaded
%bt% - bytes total

myLoader.preloaderText 
top

autoStart

A Booloean value which indicates wether to start loading automatically or not.

myLoader.autoStart 


top

loaderBarColor

Sets the loader bar color.

myLoader.loaderBarColor


top

loaderBackgroundColor

Sets the loader background color.

myLoader.loaderBackgroundColor



top

loaderTextColor

Sets loader's text color.

myLoader.loaderTextColor



top

loaderBarAlpha

Sets the alpha of the loader.

myLoader.loaderBarAlpha
top

loaderBackgroundAlpha

Sets the alpha of the loader's background.

myLoader.loaderBackgroundAlpha
top

valign

Iindicates the vertical alignment of the preloader, represented as a string. If "top", the preloader is top-aligned. If "center", the preloader is centered. If "bottom", the preloader is bottom-aligned. if "custom", the preloader is aligned to the values set by loaderVCustPos. The default value is "top".

myLoader.valign
top

halign

Indicates the horizontal alignment of the preloader, represented as a string. If "left", the preloader is left-aligned. If "center", the preloader is centered. If "right", the preloader is right-aligned. if "custom", the preloader is aligned to the value set by loaderHCustPos. The default value is "left".

myLoader.halign
top

loaderVCustPos

Sets the custom vertical position of the preloader.

myLoader.loaderVCustPos
top

loaderHCustPos

Sets the custom horizontal position of the preloader.

myLoader.loaderHCustPos
top

loaderLabelSpace

Sets the vertical space between preloader bar and text label.

myLoader.loaderLabelSpace
top

loaderLabelAlign

Vertical align of the loader label. (above/below the preloader bar)

myLoader.loaderLabelAlign
top

loaderStyle

Sets different styles for preloader bar. The options are "basic", "bounce", "thermo", "pie", "equalize", "glass", "fill", "custom".

myLoader.loaderStyle
top

loaderPrcntStep

Step to display the progress in the preloader bar while loading the content.

myLoader.loaderPrcntStep
top

showLoaderBar

A Boolean value shows/hides preloader bar.

myLoader.showLoaderBar
top

showLoaderLabel

A Boolean value shows/hides preloader label.

myLoader.showLoaderLabel
top

showLabelBorder

a Boolean value shows/hides preloader text's border.

myLoader.showLabelBorder
top

loaderWidth

Width/scaleX of the preloader bar(scaleX is for glass and thermo styles, diameter is for pie style)

myLoader.loaderWidth
top

loaderHeight

Height/scaleY of the preloader bar(scaleY is for glass and thermo styles)

myLoader.loaderHeight
top

loaderLabelWidth

Width of the label text field.

myLoader.loaderLabelWidth
top

loaderCache

A Boolean value which indicates wether to cache the loaded file or not.

myLoader.loaderCache
top

getFileBT

A read-only property. Returns the total bytes of a file inside a custom preloader function.

myLoader.getFileBT
top

getFileBL

A read-only property. Returns the loaded bytes of a file inside a custom preloader function.

myLoader.getFileBL
top

getFilePrcnt

A read-only property. Returns the loaded percents of a file inside a custom preloader function.

myLoader.getFilePrcnt
top

getFileName

A read-only property. Returns the file name inside a custom preloader function.

myLoader.getFileName
top

getTargetMovie

A read-only property. Returns the target movieclip object inside a custom preloader function.

myLoader.getTargetMovie
top

customPreloader

Executes the defined function. You can use this handler if you want to create a custom preloader for your uniLoader. Will be executed only if the loaderStyle is set to "custom".

myLoader.customPreloader
top

bounceDuration

Specifies the duration of the motion.

myLoader.bounceDuration
top

showLabelBackground

A Boolean value shows/hides preloader label background.

myLoader.showLabelBackground
top

labelBackgroundColor

Sets the label background color.

myLoader.labelBackgroundColor
top

 

METHODS

loadFile

loads the file. This is very similar to the loadMovie method.

myLoader.loadFile("my_image.jpg", trgt, "jpg");
top

afterLoad

Sets the action after loading the content.

myLoader.afterLoad(type_of_action, value); 

Parameters

Type of action - several options - "play", "nextFrame", "gotoAndStop", "gotoAndPlay", "handler"
Value - could be frame label, frame number or handler name.

top

setStreaming

Sets the streaming properties.

myLoader.setStreaming(type_of_stream, value);

Parameters

Type of stream - several options - "loadUpToFrame", "bytesToLoad", "prcntToLoad", "fullLoad"
Value - could be number of frames, number of bytes, or percentage number.

Please note that setStreaming method is not working when preloading AS2.0 movies.

top

unloadFile

unloadFile function is used for unloading preloaded SWFs and JPEGs and for interrupting the preload process.

myLoader.unloadFile();
top

labelFormat

Property; Sets the format of the uniLoader's label.

myLoader.labelFormat:TextFormat
top