相信有很多RIA开发者已经见识过TourDeFlex下载),它展示了相当多的Flex/Air开发实例。

其实现在SilverLight/WPF也有一款这样的工具,集合了微软官方的,DevExpress和ComponentArt等知名厂商的控件实例。

WPF Control Browser

简介:http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/02/03/silverlight-wpf-control-browser.aspx

程序地址:http://www.mtaulty.com/downloads/WpfControlBrowser/WpfControlBrowser.application

请在IE下打开,貌似FF不行,也许是我的.Net Framework或者SilverLight客户端有问题,呵呵:)

翻译自: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

这是Flight Framework的一部分,完全采用弱引用,非常轻盈且高效。

更为详细的介绍:

http://www.xtyler.com/code/177

以及

http://www.flightxd.com/flightframework/

Google Code:

http://code.google.com/p/flight-framework/

相信很多开发者朋友很郁闷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

因为TextField不支持对alpha的变换。因此需要对其进行一些操作。

有两种方法。

第一是使用BitmapData去绘制,然后对Bitmap进行操作,这个方法代码量稍微偏多,这里不做赘述。

第二种是使用ColorMatrixFilter过滤器。

//Code:
package com.drore.map.view
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.filters.ColorMatrixFilter;

	/**
	 * 动态生成鼠标提示
	 * @author Dada http://www.isdada.com
	 * @version 5.0
	 * @copy Drore http://www.drore.com
	 */
	public class MouseTip extends Sprite
	{
		private var txtTips:TextField = new TextField();
		public function MouseTip()
		{
			addEventListener(Event.ENTER_FRAME, init);
		}

		private function init(event:Event):void
		{
			removeEventListener(Event.ENTER_FRAME, init);
			txtTips.selectable = false;
			txtTips.tabEnabled = false;
			txtTips.mouseEnabled = false;
			txtTips.cacheAsBitmap = true;
			txtTips.multiline = false;
			//设置滤镜
			txtTips.filters=[new ColorMatrixFilter];
			addChild(txtTips);
		}
		//设置提示文字
		public function setText(txt:String):void
		{
			txtTips.text = txt;
			txtTips.width = txtTips.textWidth + 10;
			drawBg();
		}
		//绘制背景
		private function drawBg():void
		{
			graphics.clear();
			graphics.beginFill(0xF3E789, .8);
			graphics.lineStyle(1, 0xFFFF00);
			graphics.drawRoundRect( -5, -5, txtTips.textWidth + 15, txtTips.textHeight + 15, 10, 10);
			graphics.endFill();
		}
	}

}

使用方法:

//Code:
//鼠标提示框
private var mtips:MouseTip = new MouseTip();
mtips.setText("This is a test sentense.");
//使用TweenLite对mtips进行alipa缓动
TweenLite.to(mtips, .3, { alpha:0 } );
© 2011 达达's Blog Suffusion theme by Sayontan Sinha