flex 百叶窗效果
Blinds.as
package effects
{
import effects.effectClasses.BlindsInstance;
import mx.controls.scrollClasses.ScrollBarDirection;
import mx.effects.IEffectInstance;
import mx.effects.TweenEffect;
public class Blinds extends TweenEffect
{
private static var AFFECTED_PROPERTIES:Array = ["mask"];
public function Blinds(target:Object=null)
{
super(target);
instanceClass = BlindsInstance;
}
public var direction:String = ScrollBarDirection.VERTICAL;
public var blindsfrom:Number;
public var blindsTo:Number;
public var gapfrom:Number;
public var gapTo:Number;
override public function getAffectedProperties():Array
{
return AFFECTED_PROPERTIES;
}
override protected function initInstance(instance:IEffectInstance):void
{
super.initInstance(instance);
var blindsInstance:BlindsInstance = BlindsInstance(instance);
blindsInstance.direction = direction;
blindsInstance.blindsfrom = blindsfrom;
blindsInstance.blindsTo = blindsTo;
blindsInstance.gapfrom = gapfrom;
blindsInstance.gapTo = gapTo;
}
}
}
BlindsInstance.as
package effects.effectClasses
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import mx.controls.scrollClasses.ScrollBarDirection;
import mx.effects.effectClasses.TweenEffectInstance;
public class BlindsInstance extends TweenEffectInstance
{
public function BlindsInstance(target:Object)
{
super(target);
}
public var direction:String = ScrollBarDirection.VERTICAL;
public var blindsfrom:Number;
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
本例中将实现当应用运行时不进行任何操作就先弹出窗口,点击关闭/点击窗口任一位置 时将关闭窗口
1)创建Component—DefaultWin.mxml (目录结构src/components/DefaultWin.mxml)
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
  ......
FLEX编译的SWF文件,只能选择访问本地文件或访问网络文件,二者只能取一(嗯,为什么?我也不知道,官方说是为了安全考虑),而FLEX编译的默认选项是只能访问网络文件,所以你将bin里的东西COPY到其他地方就不能读取了。而你在默认的bin目录下可以读取得到,是因为FLEX认为你是在IDE环境种,这时是没有这个所谓的安全限制的 ......
Flex 加深学习笔记(-)
本文系我进一步加深Flex相关的学习而做的学习笔记,其中不乏有参考转载的相关书的文章,也不乏有自己写的些东西.这当然也避免不了可能会出现的错误(本人的理解错误或描述错误).望朋友们仅以我的Blog作为您学习路上的参考,一切皆自己尝试后是正确的才是正确的.
欢迎大家一起交流学习;
欢迎大家拍砖;
......