易截截图软件、单文件、免安装、纯绿色、仅160KB

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如何实现百叶窗特效?

在flash中很容易能实现百叶窗效果,不知道flex中能否同样实现该效果?

flex中貌似不行,
air可以


mark

百叶窗是多个网页在同一个页面切换吗?

引用
effects\Blinds.as
JScript code
package effec ......

将flex ArrayCollection数据类型传递到后台出现问题

后台java类是
public class EFInputProperty
{
private String name;
private String value;
public String getName() {
return name;
}
public void setName(String properyName) { ......

flex里有什么办法能让mx:image在缩放后自动居中

有没有什么办法让image在载入后缩放到适合大小,然后还能自动在容器内居中。

谢谢
        //计算图片框的大小
        public function caculate_size():void ......

flex制作平滑的滚屏效果

之前通过move特技实现了一个滚屏的效果,比较简单,就是在move特技里面设置xfrom和xto属性然后直接play,但是发现如果滚动的速度快的话,就会出现抖动的情况,不够平滑,请问有没有好的解决办法,用flex生成相对平滑 ......

Flex 高节图片亮度

flex 中 <mx:images>控件有没有调节图片亮度这个控件啊,,,,我想把图片亮度调低,如何实现呢,,在线等答案。。。
<mx:Image x="48"  height="30"  width="30 " ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号