AS3 Scale9 Bitmap Class

Source: Internet
Author: User

Translated from: http://www.uza.lt/codex/as3-scale9-bitmap/

Brief introduction:

AS3 Scale9 Bitmap is an auxiliary class that can be used to create nine lattice sprite by bitmap data padding, which is not possible in Flash 9. This helper class creates 9 virtual nine lattice sprite based on the user-defined scaling matrix. Particularly useful for creating user interfaces (such as buttons, scalable UI elements, and so on).

Content:

Scale9simplestatebutton-Class for creating a button with a scalable 1, 3, or 3 state that uses bitmap data (skin).
Scale9simplebitmapsprite-A class of sprite used to create static, scalable UI elements using bitmap data (skins).
Sample code (Flex Builder 3 project)
Requirements:

ActionScript3
Scale9simplestatebutton (upper left), Scale9simplebitmapsprite (lower right) and initial skin file (bottom)

Sample syntax:

Actionscript:
      var scale9_example:rectangle = new Rectangle (6,6,105,20);
     /* Initialize the button with all 3 states (normal, hover, down) using 3 different bitmaps */
      var Button_example:scale9simplestatebutton = new Scale9simplestatebutton (
          Scale9_example,
           Button_skin_normal.bitmapdata,
          Button_skin_hover.bitmapdata,
          button_skin_ Down.bitmapdata
     );
     /*
        * Scale the button using "width" and "ScaleY" Properties
        * (in general you can use "width", "height", "scale Y "," ScaleX "Properties for scaling)
        */
      button_example.width = +;
      Button_example.scaley = 2;
Download:

Http://www.uza.lt/download/2










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.