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;
相关文档:
import flash.display.DisplayObject;
import mx.core.Application;
import mx.managers.PopUpManager;
var win:TestWindows= PopUpManager.createPopUp(DisplayObject(Application.application),TitleWindows,true) as TitleWindows;
PopUpManager.centerPopUp(win); ......
flash和flex针对不同的目的,提供了3种不同的坐标系。
全局的就是(stage级别的)
本地坐标系(组件级别的)
内容坐标系(相对于本地坐标系说的 ......
用FLEX如何取浏览器地址栏中的域名信息?我查找到两种方法:
第一种方法是用ExternalInterface.call('window.location.href.toString'),它的值就是地址栏中的域名
有以下几点需要注意:
1.当Flash和加载它的网页不同域时,需要在网页在 PARAM 或 EMBED 标签中进行设置AllowScriptAccess 为“always”
关于 ......
(1)tree点击事件public function handleList(ev:ResultEvent)
{
sourceList=ev.result as ArrayCollection;
}
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (pmtree.dataDescriptor.isBranch(item)) {
......
1、自定义组件
2、自定义事件
3、结合使用
一、自定义组件(使用的是Flex组件,ActionScript组件相对麻烦点,可视化差点)
该组件由一个TextArea和两个Button组成,如图:
代码:
MyComponent.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width=" ......