<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
verticalAlign="bottom"
width="100%"
height="100%"
layout="horizontal">
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.controls.Alert;
public var imageArray:Array;
public var timer:Timer;
public static const ORGINSIZE:int=40;
public static const CROSSSIZE:int=110;
public static const TWICENUM:Number=3.5;
public static const OFFSETY:int=0;
public static const OFFSETX:int=0;
private function init():void
{
imageArray=new Array();
imageArray.push(getImageObj(image1));
imageArray.push(getImageObj(image2));
imageArray.push(getImageObj(image3));
imageArray.push(getImageObj(image4));
imageArray.push(getImageObj(image5));
imageArray.push(getImageObj(image6));
imageArray.push(getImageObj(image7));
imageArray.push(getImageObj(image8));
timer=new Timer(5, 0);
timer.addEventListener(TimerEvent.TIMER, modifyImage);
timer.start();
}
private function getImageObj(img:Image):Object
{
var obj:Object=new Object();
var imageX:Number=img.x + img.width / 2;
//Alert.show(img.x.toString());
var imageY:Number=this.height;
//Alert.show(imageY.toString()+"--y"); 626
obj.image=img;
obj.orgX=imageX;
obj.orgY=imageY;
return obj;
}
private function modifyImage(event:TimerEvent):void
{
for (var i:String in imageArray)
{
var _image:Image=imageArray[i].image;
var _mouseY:Number=stage.mouseY - OFFSETY;
var _mouseX:Number=stage.mouseX - OFFSETX;
if (_mouseY < imageArray[i].orgY && (imageArray[i].orgY - _mouseY) < _image.height * TWICENUM)
{
var percentX:Number=0;
var percentY:Number=0;
var percentXY:Number=0;
if (_mouseX < imageArray[i].orgX && (imageArray[i].orgX - _mouseX) < _image.width * TWICENUM)
{
percentX=1 - (imageArray[i].orgX - _mouseX) / (_image.width * TWICENUM)
}
else if (_mouseX >= imageArray[i].orgX && (_mouseX - imageArray[i].orgX) < _image.width * TWICENUM)
{
percentX=1 - (_mouseX - imageArray[i].orgX) / (_image.width * TWICENUM)
}
percentY=1 - (imageArray[i].orgY - ORGINSIZE / 2 - _mouseY) / (_image.height * TWICENUM - ORGINSIZE / 2)
if (percentY > 1)
percentY=1;
percentXY=percentX * percentY;
imageArray[i].image.width=CROSSSIZE * percentXY + ORGINSIZE;
imageArray[i].image.height=CROSSSIZE * percentXY + ORGINSIZE;
}
}
}
]]>
</mx:Script>
<!--mx:HBox width="100%"
autoLayout="true"
borderColor="#136CAB"
themeColor="#009DFF"
backgroundColor="#879BA9"
backgroundAlpha="0.69"
fontSize="12"
horizontalAlign="center"-->
<mx:Image x="30"
y="60"
id="image1"
toolTip="After Effects CS5"
source="@Embed(source='assets/icons/After Effects CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('After Effects CS5')"/>
<mx:Image x="30"
y="90"
id="image2"
toolTip="Bridge CS5"
source="@Embed(source='assets/icons/Bridge CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Bridge CS5')"/>
<mx:Image x="30"
y="120"
id="image3"
toolTip="Dreamweaver CS5"
source="@Embed(source='assets/icons/Dreamweaver CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Dreamweaver CS5')"/>
<mx:Image x="30"
y="150"
id="image4"
toolTip="Fireworks CS5"
source="@Embed(source='assets/icons/Fireworks CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Fireworks CS5')"/>
<mx:Image x="30"
y="180"
id="image5"
toolTip="Flash CS5"
source="@Embed(source='assets/icons/Flash CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flash CS5')"/>
<mx:Image x="30"
y="210"
id="image6"
toolTip="Flash Player"
source="@Embed(source='assets/icons/Flash Player.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flash Player')"/>
<mx:Image x="30"
y="240"
id="image7"
toolTip="Illustrator CS5"
source="@Embed(source='assets/icons/Illustrator CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('llustrator CS5')"/>
<mx:Image x="30"
y="240"
id="image8"
toolTip="Flex CS5"
source="@Embed(source='assets/icons/Flex CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flex CS5')"/>
<!--/mx:HBox-->
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
verticalAlign="bottom"
width="100%"
height="100%"
layout="horizontal">
<mx:Script>
<![CDATA[
import mx.controls.Image;
import mx.controls.Alert;
public var imageArray:Array;
public var timer:Timer;
public static const ORGINSIZE:int=40;
public static const CROSSSIZE:int=110;
public static const TWICENUM:Number=3.5;
public static const OFFSETY:int=0;
public static const OFFSETX:int=0;
private function init():void
{
imageArray=new Array();
imageArray.push(getImageObj(image1));
imageArray.push(getImageObj(image2));
imageArray.push(getImageObj(image3));
imageArray.push(getImageObj(image4));
imageArray.push(getImageObj(image5));
imageArray.push(getImageObj(image6));
imageArray.push(getImageObj(image7));
imageArray.push(getImageObj(image8));
timer=new Timer(5, 0);
timer.addEventListener(TimerEvent.TIMER, modifyImage);
timer.start();
}
private function getImageObj(img:Image):Object
{
var obj:Object=new Object();
var imageX:Number=img.x + img.width / 2;
//Alert.show(img.x.toString());
var imageY:Number=this.height;
//Alert.show(imageY.toString()+"--y"); 626
obj.image=img;
obj.orgX=imageX;
obj.orgY=imageY;
return obj;
}
private function modifyImage(event:TimerEvent):void
{
for (var i:String in imageArray)
{
var _image:Image=imageArray[i].image;
var _mouseY:Number=stage.mouseY - OFFSETY;
var _mouseX:Number=stage.mouseX - OFFSETX;
if (_mouseY < imageArray[i].orgY && (imageArray[i].orgY - _mouseY) < _image.height * TWICENUM)
{
var percentX:Number=0;
var percentY:Number=0;
var percentXY:Number=0;
if (_mouseX < imageArray[i].orgX && (imageArray[i].orgX - _mouseX) < _image.width * TWICENUM)
{
percentX=1 - (imageArray[i].orgX - _mouseX) / (_image.width * TWICENUM)
}
else if (_mouseX >= imageArray[i].orgX && (_mouseX - imageArray[i].orgX) < _image.width * TWICENUM)
{
percentX=1 - (_mouseX - imageArray[i].orgX) / (_image.width * TWICENUM)
}
percentY=1 - (imageArray[i].orgY - ORGINSIZE / 2 - _mouseY) / (_image.height * TWICENUM - ORGINSIZE / 2)
if (percentY > 1)
percentY=1;
percentXY=percentX * percentY;
imageArray[i].image.width=CROSSSIZE * percentXY + ORGINSIZE;
imageArray[i].image.height=CROSSSIZE * percentXY + ORGINSIZE;
}
}
}
]]>
</mx:Script>
<!--mx:HBox width="100%"
autoLayout="true"
borderColor="#136CAB"
themeColor="#009DFF"
backgroundColor="#879BA9"
backgroundAlpha="0.69"
fontSize="12"
horizontalAlign="center"-->
<mx:Image x="30"
y="60"
id="image1"
toolTip="After Effects CS5"
source="@Embed(source='assets/icons/After Effects CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('After Effects CS5')"/>
<mx:Image x="30"
y="90"
id="image2"
toolTip="Bridge CS5"
source="@Embed(source='assets/icons/Bridge CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Bridge CS5')"/>
<mx:Image x="30"
y="120"
id="image3"
toolTip="Dreamweaver CS5"
source="@Embed(source='assets/icons/Dreamweaver CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Dreamweaver CS5')"/>
<mx:Image x="30"
y="150"
id="image4"
toolTip="Fireworks CS5"
source="@Embed(source='assets/icons/Fireworks CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Fireworks CS5')"/>
<mx:Image x="30"
y="180"
id="image5"
toolTip="Flash CS5"
source="@Embed(source='assets/icons/Flash CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flash CS5')"/>
<mx:Image x="30"
y="210"
id="image6"
toolTip="Flash Player"
source="@Embed(source='assets/icons/Flash Player.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flash Player')"/>
<mx:Image x="30"
y="240"
id="image7"
toolTip="Illustrator CS5"
source="@Embed(source='assets/icons/Illustrator CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('llustrator CS5')"/>
<mx:Image x="30"
y="240"
id="image8"
toolTip="Flex CS5"
source="@Embed(source='assets/icons/Flex CS5.png')"
width="{ORGINSIZE}"
height="{ORGINSIZE}"
click="Alert.show('Flex CS5')"/>
<!--/mx:HBox-->
</mx:Application>