给Flex的PopUpManager显示控件添加特效
PopUpEffect.as
package
{
import flash.display.DisplayObject;
import mx.core.IFlexDisplayObject;
import mx.effects.Blur;
import mx.events.TweenEvent;
import mx.managers.PopUpManager;
public class PopUpEffect
{
public function PopUpEffect()
{
}
public static function Show(control:IFlexDisplayObject,parent:DisplayObject,modal:Boolean=true):void
{
var mShowEffect:Blur=new Blur();
mShowEffect.blurXfrom=255;
mShowEffect.blurYfrom=255;
mShowEffect.blurXTo=0;
mShowEffect.blurYTo=0;
mShowEffect.target= control;
mShowEffect.duration=300;
PopUpManager.addPopUp(control,parent,modal);
PopUpManager.centerPopUp(control);
mShowEffect.play();
}
public static function Hide(control:IFlexDisplayObject):void
{
var mHideEffect:Blur=new Blur();
mHideEffect.blurXfrom=0;
mHideEffect.blurYfrom=0;
mHideEffect.blurXTo=255;
mHideEffect.blurYTo=255;
mHideEffect.addEventListener(TweenEvent.TWEEN_END,function(){
PopUpManager.removePopUp(control);
});
mHideEffect.duration=300;
mHideEffect.target=control;
mHideEffect.play();
}
}
}
main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<!--[CDATA[
import PopUpEffect;
]]>
</mx:Script>
<mx:Button label="登陆" horizontalCenter="0" verticalCenter="0">
相关文档:
Flex 4 DropDownList:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Spark DropDownList control -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/ ......
Getting Around Bug in Adobe Flex: TabControl Inline Event Handling for TabIndexChange Doesn't Work
I ran into this because I wanted to do something funky. I wanted my Flex app window to change PageStates (and size) whenever the TabIndex changed. Whether doing this kind of thing is wise ......
花了两天时间在网上找资料今天终于是弄起来了!!
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j ......