flex 利用hslider控件以容器中心放缩图片
请问大家 有一图片在一容器中(canvas或 vbox)我想以容器为中心利用hslider控件来放缩图片,,该如何实现呢?在线等答案!!!
XML code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Script>
<![CDATA[
import flash.events.Event;
import mx.controls.sliderClasses.Slider;
private var actualWidth:Number = 0;
private var actualHeight:Number = 0;
private function center(flag:Boolean = false):void
{
if (flag)
{
actualWidth = image.contentWidth;
actualHeight = image.contentHeight;
}
image.move(Math.round((canvas.width - image.contentWidth) / 2),
Math.round((canvas.height - image.contentHeight) / 2));
}
private function sliderChangeHandler(event:Event):void
{
var value:Number = (event.target as Slider).value;
image.content.width = Math.round(actualWidth * value);
image.content.height = Math.round(actualHeight * value);
center();
}
]]>
相关问答:
在flash中很容易能实现百叶窗效果,不知道flex中能否同样实现该效果?
flex中貌似不行,
air可以
mark
百叶窗是多个网页在同一个页面切换吗?
引用
effects\Blinds.as
JScript code
package effec ......
各位大虾,讨论下时下流行的技术。
应用范围是网络管理系统,或企业内部门户网站。
可能的架构组合是asp.net MVC+flex
asp.net MVC+Silverlight
J2EE MVC+flex
J2EE MVC+Silverlight
各种架构具体 ......
有没有什么办法让image在载入后缩放到适合大小,然后还能自动在容器内居中。
谢谢
//计算图片框的大小
public function caculate_size():void ......
怎样才能将object对象清空? 以下是我写的一段代码:
var result:ArrayCollection=new ArrayCollection();(全局.....)
var obj:Object=new Object();(全局.......)
obj.Fcity=_city;
obj.Ftelno=_telno ......
关于Flex中使用多个Timer
我的Flex程序中需要使用多个Timer,
Timer的个数由用户决定。
请问Flex中new多个Timer有什么问题么?
有什么办法代替New 多个Timer?
不知道Flex程序创建过多 ......