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();
}
]]>
相关问答:
大家好!请问哪位有flex visual graph的源代码啊?
现在在ADOBE的网站上已经下不到了。。。。
我的论文需要这个,很急,如果有源代码的朋友麻烦发到gutingting110@gmail.com
万分感谢!!!
http://birdey ......
请问高手,flex桌面应用程序可以使用BlazeDS框架吗? 我试了一下没有成功!
应该是可以的。
不成功提示什么?
可以,不过在service中必须手动设置endpoint属性。
我做的实例是flex官方上的第一个例子,调 ......
我用了个盗版的序列号,现在想改成正版的,发现没地方改,卸载重启后重装也不行,它还是能认出盗版的那个序列号
卸载FB后删除注册表以下键值:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersio ......