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();
}
]]>
相关问答:
有的朋友请留言,谢谢了。。
http://www.blogjava.net/vip01/archive/2008/02/26/182336.html
引用
http://www.blogjava.net/vip01/archive/2008/02/26/182336.html
谢了,我再找找,其他 ......
问题如题目,
帮忙。。
你是指swfAddress & swfObject 这两者?
我的意思是,,,比如在html里面,可以用
<div>
<a name="a" id="a"> </a>
顶部 & ......
关于Flex中使用多个Timer
我的Flex程序中需要使用多个Timer,
Timer的个数由用户决定。
请问Flex中new多个Timer有什么问题么?
有什么办法代替New 多个Timer?
不知道Flex程序创建过多 ......