Jump to content
GreenSock

Guest spajon

FlexTransformManager example problem displaying image

Recommended Posts

Hi,

 

I have just downloaded the TransformManager component and I launched the sample flex project where you should be able to resize an image and a TextArea, but no image was displayed on the screen. Am I doing something wrong or is there something that I have missed?

 

If I comment the lines with the FlexTransformManager in the mxml then the image is displayed.

 

Here is the code:

 

@font-face {

src:local("Verdana");

fontFamily: embeddedFont;

advancedAntiAliasing: true;

}

 

 

</p><p> import mx.core.UIComponent;</p><p> import mx.core.FlexSprite;</p><p> import com.greensock.events.TransformEvent;</p><p> import com.greensock.transform.utils.*;</p><p> import com.greensock.transform.*;</p><p> import mx.controls.Label;</p><p>&nbsp;</p><p> private function init():void {</p><p> myManager.addEventListener(TransformEvent.SELECTION_CHANGE, onSelectionChange, false, 0, true);</p><p> myManager.addEventListener(TransformEvent.SCALE, onScale, false, 0, true);</p><p> myManager.addEventListener(TransformEvent.FINISH_INTERACTIVE_SCALE, onFinishInteractiveScale, false, 0, true); </p><p> myManager.addEventListener(TransformEvent.DOUBLE_CLICK, onDoubleClick, false, 0, true); </p><p>&nbsp;</p><p> /* To impose some scale limitations, uncomment this...</p><p> var item:TransformItem = myManager.getItem(image1);</p><p> item.setScaleConstraints(0.5, 1, 0.5, 1); //impose scale limits </p><p> item = myManager.getItem(myTextArea);</p><p> item.constrainScale = true; //cause image2 to scale proportionately when interactively scaling it </p><p> */</p><p> }</p><p> private function onScale($e:TransformEvent):void {</p><p> trace("Scaled " + $e.items.length + " items");</p><p> }</p><p> public function onFinishInteractiveScale($e:TransformEvent):void {</p><p> trace("Finished interactive scale");</p><p> }</p><p> public function onDoubleClick($e:TransformEvent):void {</p><p> trace("Double-clicked selection containing " + $e.items.length + " items");</p><p> }</p><p> private function onSelectionChange($e:TransformEvent):void {</p><p> trace("Changed selection. Items just selected/deselected (changed): " + $e.items.length + ", total items now selected: " + myManager.selectedItems.length);</p><p> }</p><p>

Link to comment
Share on other sites

No no, you didn't do anything wrong. My apologies - the last update I made which added brand new minWidth/minHeight/maxWidth/maxHeight properties to TransformItem introduced an issue that could cause dynamically-loaded objects (like Image) not to render correctly initially. Basically when their width and/or height property values are 0, it would cause the problem. I just needed to add one piece of conditional logic to TransformItem to fix the issue. That's done now. Please log into your GreenSock account and get the latest version: https://www.greensock.com/account/. Again, sorry about the confusion/hassle.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×