Adobe Dreamweaver Forums



Last 10 THreads :         Re: Photoshop won't launch (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 0 - Views : 1 )           »          Eventlistener for exiting frame (Last Post : Andrei1 - Replies : 1 - Views : 2 )           »          CS4 Motion Editor issues (Last Post : jdehaan - Replies : 3 - Views : 9 )           »          Flash file won't display (Last Post : Murray *ACE* - Replies : 18 - Views : 19 )           »          How do I centre Tables ? (Last Post : Murray *ACE* - Replies : 3 - Views : 4 )           »          3 overlapping background images on same page (Last Post : Murray *ACE* - Replies : 9 - Views : 10 )           »          Can I make a 4 state CSS Sprite nav bar. (Last Post : Murray *ACE* - Replies : 7 - Views : 8 )           »          Re: Photoshop CS3 Keeps on Crashing at Random - Help! (Last Post : Ann_Shelbourne@adobeforums.com - Replies : 0 - Views : 1 )           »          bad luck (Last Post : Andrei1 - Replies : 1 - Views : 2 )           »          ActivMail (cf_mail) and Bare LF problem (Last Post : Fetch - Replies : 1 - Views : 2 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-04-2008, 09:00 AM
tausif d
 
Posts: n/a
Diggs:
Default horizontalCenter and X position

hello
i have given the horizontalcenter and verticalcenter 0,0 to a image for
proper working of zooming image.
but i am facing difficulties in rotation and antirotation it is not taking
originX and originY
here is the cide

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
pageTitle="Smooth Images" layout="absolute"
width="100%" height="600" creationComplete="ini();" >
<mx:Script>
<![CDATA[
import mx.containers.Canvas;
private var cv:Canvas=new Canvas();
[Bindable]
private var angle:int=0;
private function ini():void{
rotate1.target=img;
rotate2.target=img;
rButton.addEventListener(MouseEvent.CLICK,rot);
arButton.addEventListener(MouseEvent.CLICK,antirot );
mycanvas.addChild(cv);
img.setStyle("horizontalCenter",0);
img.setStyle("verticalCenter",0);
cv.setStyle("borderStyle","solid");

cv.width=900;cv.height=900;cv.horizontalScrollPoli cy="off";cv.verticalScrollP
olicy="off";
cv.addChild(img);
}
private function rot(event:Event):void{
rotate1.end();angle += 90;rotate1.play();
ll.data=rotate1.originX.toString();
}
private function antirot(event:Event):void{
rotate2.end();angle -= 90;rotate2.play();
ll.text="antirot";
}
]]>
</mx:Script>
<mx:Rotate id="rotate1" angleFrom="{angle}" angleTo="{angle+90}" duration="0"
/>
<mx:Rotate id="rotate2" angleFrom="{angle}" angleTo="{angle-90}" duration="0"
/>
<mx:HSlider id="img_slider_smooth" value=".7" maximum="1.7"
minimum=".1" liveDragging="true" x="397" y="268"/>
<mx:Canvas id="mycanvas" x="373" y="24">



<mx:Image id="img" source="t3.jpg" scaleX="{img_slider_smooth.value}"
scaleY="{img_slider_smooth.value}" />

</mx:Canvas>
<mx:Button x="170" y="333" label="rButton" id="rButton"/>
<mx:Button x="341" y="333" label="arButton" id="arButton"/>
<mx:Text x="95" y="422" text="Text" id="ll"/>

</mx:Application>



Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:22 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk