下面的代码什么地方存在错误,期待高手解决
我现在有这么一段代码,就是弹出窗口,并加了特效的,效果能显示出来,但就是存在两个问题,第一:如果弹出窗口有ComboBox,并且这个ComboBox的数据是动态查询的,那么在ComboBox前面的Label将会错误,例如下面代码,“父节点”三个字会错位,第二:如果界面上又List控件,并且数据是动态的,那么List里面的数据显示不清,只显示数据的20%,不知道这样的问题如何解决,,希望大侠赐教:
<mx:FormItem label="父节点:" required="true"> <mx:ComboBox id="parentNode" dataProvider="{departments}" labelFunction="disDepName" labelField="name" /> </mx:FormItem>
package com.jrosion.comas{ import flash.display.DisplayObject; import flash.external.ExternalInterface; import mx.core.Application; import mx.core.IFlexDisplayObject; import mx.effects.Blur; import mx.effects.Zoom; 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:Zoom = new Zoom(); mShowEffect.zoomWidthTo=1; mShowEffect.zoomHeightFrom=0; mShowEffect.zoomWidthFrom=0; mShowEffect.duration=600; mShowEffect.target=control; mShowEffect.reverse(); mShowEffect.play(); PopUpManager.addPopUp(control, DisplayObject(Application.application), modal); control.x = (Application.application.width - control.width) / 2; control.y = (Application.application.height - control.height) / 2; PopUpManager.centerPopUp(control); } 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.duration=300; mHideEffect.target=control; mHideEffect.play(); mHideEffect.addEventListener(TweenEvent.TWEEN_END, function():void { PopUpManager.removePopUp(control); }); } } }
<?xml version="1.0" encoding="utf-8"?><mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" title="测试PopUpEffect" showCloseButton="true" creationComplete="init()" fontSize="12" close="closeWin()"> <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; [Bindable] private var departments:ArrayCollection = new ArrayCollection([ {code:'a',name : 'deptA'}, {code:'b',name:'deptB'}, {code:'c',name:'deptC'} ]); // private function closeWin():void{ PopUpEffect.Hide(this); } ]]> </mx:Script> <mx:FormItem label="父节点:" required="true"> <mx:ComboBox id="parentNode" dataProvider="{departments}" labelField="name" /> </mx:FormItem> <mx:ControlBar horizontalAlign="right"> <mx:Button id="btClose" label="关闭" click="closeWin()"/> </mx:ControlBar></mx:TitleWindow>
[解决办法]
我跟5楼一样,我做例子的时候,为了模拟动态查询的时差,用timer迟一些给数据,也没出现那种效果。
要么建议楼主把Flex SDK升级下试试。