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://hi.baidu.com/dapao98301/blog/item/eff43ed557b44509a08bb75f.html 给我的提示做的,现在总是
<mx:RemoteObject id="getData" destination="dataService1" res ......
请问高手,flex桌面应用程序可以使用BlazeDS框架吗? 我试了一下没有成功!
应该是可以的。
不成功提示什么?
可以,不过在service中必须手动设置endpoint属性。
我做的实例是flex官方上的第一个例子,调 ......
登录web系统后后,可以看到网页中的swf,现在想通过swf往系统中插入一个订单,
请问会成功吗,swf会把网页的用户信息传递到服务器端吗?
还是说要专门做一个不需要用户名密码的页面,用来插入订单,这样是 ......
问题如题目,
帮忙。。
你是指swfAddress & swfObject 这两者?
我的意思是,,,比如在html里面,可以用
<div>
<a name="a" id="a"> </a>
顶部 & ......
关于Flex中使用多个Timer
我的Flex程序中需要使用多个Timer,
Timer的个数由用户决定。
请问Flex中new多个Timer有什么问题么?
有什么办法代替New 多个Timer?
不知道Flex程序创建过多 ......