Hi
I am doing some r&d on Flex drawing API. I have drawn one rectangle, i
would like to give zoom effect when rollOver and rollOut. I have tried
to give flex default zoom effect and manually given width and height.
I am unable to give zoom effect. please see the below my source code
and let me know where i did the mistake.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="drawRec()">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
private function drawRec():void
{
var ref:UIComponent=new UIComponent();
var mySprite:Sprite = new Sprite();
mySprite.graphics.beginFill(0xFFCC00);
mySprite.graphics.drawRect(300, 300,30,30);
mySprite.addEventListener(MouseEvent.ROLL_OVER,zoomMe);
mySprite.addEventListener(MouseEvent.ROLL_OUT,zoomOutMe);
ref.addChild(mySprite);
this.addChild(ref);
}
private function zoomMe(evt:MouseEvent):void
{
var target:Sprite=new Sprite();
target=evt.target as Sprite;
target.width=50;
target.height=50;
}
private function zoomOutMe(evt:MouseEvent):void
{
var target:Sprite=new Sprite();
target=evt.target as Sprite;
target.width=30;
target.height=30;
}
/* public function doZoom(event:MouseEvent):void {
if (zoomAll.isPlaying) {
zoomAll.reverse();
}
else {
// If this is a ROLL_OUT event, play the effect
backwards.
// If this is a ROLL_OVER event, play the effect
forwards.
zoomAll.play([event.target], event.type ==
MouseEvent.ROLL_OUT ? true : false);
}
} */
]]>
</mx:Script>
<!--<mx:Zoom id="zoomAll" zoomWidthTo="1" zoomHeightTo="1"
zoomWidthFrom=".5" zoomHeightFrom=".5" /> -->
</mx:Application>
advance thanks
kishore.v