GreenSock animation platform learning notes (4) LoaderMax-ImageLoader

Source: Internet
Author: User
Tags vars

ImageLoader

Constructor ImageLoader (urlOrRequest: *, vars: Object = null)

Parameter: urlOrRequest: url (String type) or URLRequest of the image to be loaded

Vars: attribute object. It can be written as a {} style or directly transmitted as an ImageLoaderVars object.

Attributes of The vars object (same for ImageLoaderVars)

Attribute Type Function
Name String Used to identify the ImageLoader instance.LoaderMax.getLoader()OrLoaderMax.getContent()Can be trace at any time, must be unique, if no display settings, will be automatically created, such as "loader21"
Container DisplayObject
Container
ContentDisplay (a sprite) representing the image content will be added to the container specified by this parameter
Smoothing Boolean If this parameter is set to true, the image edge is smoothed out. Otherwise, the image may be scaled out of the image.
Width Number Sets the width of ContentDisplay. If no value is set, it indicates the width of the image to be loaded.
Heigth Number Sets the height of ContentDisplay. If no value is set, it indicates the height of the image to be loaded.
CenterRegistration Boolean If it is true, the registration point of ContentDisplay will be in the center
ScaleMode String When the height and width of ContentDisplay are set, this parameter determines how the image to be loaded adapts to this region. The following modes are available:
"Stretch", default value, the image will be fully adapted to the height and width
"ProportionalInside", the image scales proportionally to fit the height and width, and never exceeds this area.
"ProportionalOutside", the image scales proportionally to fit the height and width, and some of it exceeds this area.
"WidthOnly", only applicable to width
"HeightOnly", only applicable to high
"None", the image will keep the original size
HAlign String After defining the height and width of ContentDisplay, this parameter determines how the image is aligned horizontally in ContentDisplay. the following values are available:
"Center", default value, center alignment
"Left", left aligned
"Right", right alignment
VAlign String After defining the height and width of ContentDisplay, this parameter determines how the image is aligned in the vertical direction of ContentDisplay. the following values are available:
"Center", default value, center alignment
"Top", alignment on
"Bottom", bottom alignment
Crop Boolean When the height and width of ContentDisplay are set, content beyond this part of the image will be dropped.
X Number Set the x coordinate of ContentDisplay
Y Number Set y coordinates of ContentDisplay
ScaleX Number Set the scaleX value of ContentDisplay
ScaleY Number Set the scaleY value of ContentDisplay
Rotation Number Set ContentDisplay Rotation
Alpha Number Sets the transparency of ContentDisplay.
Visible Boolean Set ContentDisplay visibility
BlendMode String Set blendMode of ContentDisplay
BgColor Uint The color of the rectangle in ContentDisplay. This rectangle is automatically added and transparent by default.
BgAlpha Number Transparency of the rectangle in ContentDisplay
Context LoaderContext  
EstimatedBytes Uint  
AlternateUrl String Optional image url. If the initial url fails to be loaded, the url will be loaded.
NoCache Boolean If true, the image cache is disabled.
RequireWithRoot DisplayObject LoaderMax supports subloding, that is, the loading process of an object can be added to the loading process of its parent object to become part of the parent element loading process, if you want this ImageLoader to be part of its parent SWFLoader's loading process, set this value to your root swf
AutoDispose Boolean If this parameter is set to true, the ImageLoader object is automatically destroyed after loading. The default value is false.
     
OnOpen Function The function called when loading starts.LoaderEventEvent object parameters
OnInit Function The function called when the image starts to be downloaded.LoaderEventEvent object parameters
OnProgress Function If a function is called when data changes occur during the loading process,LoaderEventEvent object parameters
You can useLoaderEvent. Target. progress, or use it separatelytarget.bytesLoadedAndtarget.bytesTotal
OnComplete Function The function called when the load is complete will inputLoaderEventEvent object parameters
OnCancel Function When the function is called when the load is canceled or fails,LoaderEventEvent object parameters
OnError Function When a function is called when an error occurs during loading,LoaderEventEvent object parameters
OnFail Function  
OnIOError Function  
OnHTTPStatus Function  
OnSecurityError Function  
OnScriptAccessDenied Function  
     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.