0

Comments

翻译自:http://www.uza.lt/codex/as3-scale9-bitmap/

简介:

AS3 Scale9 Bitmap是个辅助的类,使用它可以通过bitmap数据填充创建九宫格sprite,而这些在Flash 9中是无法实现的。这个辅助类根据用户定义的缩放矩阵创建了9个虚拟的九宫格sprite。特别适用于创建用户界面(比如按钮,可伸缩的UI元素等等)。

内容:

  • Scale9SimpleStateButton – 用于创建可伸缩的1、3 或者3种状态使用bitmap数据(皮肤)的按钮的类。
  • Scale9SimpleBitmapSprite – 用于创建静态的可伸缩的UI元素的使用bitmap数据(皮肤)的sprite的类。
  • 示例代码(Flex Builder 3 项目)

要求:

ActionScript3

演示:


Scale9SimpleStateButton(左上角),Scale9SimpleBitmapSprite(右下角)以及初始的皮肤文件(底部)

示例语法:

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", "scaleY", "scaleX" properties for scaling)
        */
      button_example.width = 300;
      button_example.scaleY = 2;

下载:

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

< ,,,, >
3

Comments

相信很多开发者朋友很郁闷Flex提供的TitleWindow和Panel都不提供最大化,最小化等按钮/功能,这样的话就要自力更生了。

之前有个flexmdi类库不过,今天发现一个也很好:SuperPanel ,今天的最新版是1.3

superpanel

Source:http://brandonmeyer.net/projects/SuperPanelDemo/srcview/index.html

Demo:http://brandonmeyer.net/projects/SuperPanelDemo/SuperPanelDemo.html

< ,, >
1

Comments

最近要做一个东东有用到。
不过更强悍的是前几天看到有人用JS也实现了这个效果。
See:http://weblog.cahlan.com/2007/01/reflection-class.html

I’m a Web 2.0/Apple copycat today, so here is a simple class for creating a reflection below any type of displayObject in AS3.View the source here.

下载示例:Reflection.zip

< , >