Flex-Just start-Image rotation

Flex 3, a simple application of image rotation.

1.Select a new Flex project from the New item in the File menu;

2.Use "JustStart" as the new Flex project name;

3.take a image from computer, rename it to myImage.jpg,

and drop it into the src folder of the new project;

4.add the code into the MXML file for the application;

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Image source="@Embed('myImage.jpg')" height="200" left="60" rotation="-10" top="60">
        <mx:filters>
            <mx:DropShadowFilter>
            </mx:DropShadowFilter>
        </mx:filters>
    </mx:Image>

</mx:Application>

5.Run the application.

 

comment:

source="@Embed('myImage.jpg')":load myImage.jpg

rotation="-10":the rotation angle

<mx:DropShadowFilter>:add the shadow for myImage.jpg

 

further:

4.add the new code into the MXML file

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:HBox top="10" left="10">
        <mx:HSlider minimum="-30" maximum="30" value="-10" toolTip="Rotation" change="myImage.rotation=event.currentTarget.value" liveDragging="true">
        </mx:HSlider>
        <mx:HSlider minimum="100" maximum="300" value="100" toolTip="Size" change="myImage.height=event.currentTarget.value" liveDragging="true">
        </mx:HSlider>
        <mx:CheckBox label="Visible" change="myImage.visible=event.currentTarget.selected" selected="true">
        </mx:CheckBox>
    </mx:HBox>

    <mx:Image id="myImage" source="@Embed('myImage.jpg')" height="200" left="60" rotation="-10" top="200">
        <mx:filters>
            <mx:DropShadowFilter>
            </mx:DropShadowFilter>
        </mx:filters>
    </mx:Image>
</mx:Application>


comment:

<mx:HBox>:add a Box

<mx:HSlider>:add two Sliders of Size and Rotation

<mx:CheckBox> :add a check box of Visible

chang="":the action

 

result:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值