Friday, December 16, 2011

Transform Tool - working with text

Hallo, today I'd like to show how to use tool for text block transformation. There is to ways: resizing and scaling. Resizing is default way of transformation, following example shows how to use it. Press view source context menu to get source code. 


For scaling you need to use special connector - UIScaleConnector. See example below. Press view source context menu to get source code. 

SWC: Transform Tool 2 version 2.3.5.
Source code: Project home page.
ASDoc:  API ASDoc.
Required Flex SDK version: SDK 4.5

14 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Is there a possibility to resize with aspect ratio?
    If there is, how?
    Thanks!

    ReplyDelete
  3. yes, you need to create your own skin (you can copy existing one from transform tool source https://transform-tool.googlecode.com/svn/trunk/TransformTool/src/com/vstyran/transform/skins/TransformToolSkin.mxml) and set for resize operations parameter "maintainAspectRatio" into true.

    ReplyDelete
  4. I am getting the following error
    Argument count mismatch on mx.utils::MatrixUtil$/getConcatenatedMatrix(). Expected 1, got 2.
    at com.vstyran.transform.utils::TransformUtil$/getMatrix()[C:\Users\Xyuha\Adobe Flash Builder 4.5\TransformTool\src\com\vstyran\transform\utils\TransformUtil.as:32]
    at com.vstyran.transform.connectors::DataConnector/set panel()[C:\Users\Xyuha\Adobe Flash Builder 4.5\TransformTool\src\com\vstyran\transform\connectors\DataConnector.as:57]
    at com.vstyran.transform.connectors::UIConnector/addedHandler()[C:\Users\Xyuha\Adobe Flash Builder 4.5\TransformTool\src\com\vstyran\transform\connectors\UIConnector.as:88]
    at flash.display::DisplayObjectContainer/addChildAt()
    at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2540]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/displayClassCompleteHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\Preloader.as:559]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::SparkDownloadProgressBar/initCompleteHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\SparkDownloadProgressBar.as:1087]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.preloaders::Preloader/dispatchAppEndEvent()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\Preloader.as:362]
    at mx.preloaders::Preloader/appCreationCompleteHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\preloaders\Preloader.as:567]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.as:12727]
    at mx.core::UIComponent/set initialized()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.as:1667]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\LayoutManager.as:819]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1157]

    ReplyDelete
  5. Probably you are using flex SDK 4.0. You should use Flex SDK 4.5

    ReplyDelete
  6. You can download Flex SDK 4.5.0.20967A from here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5

    ReplyDelete
  7. Good Work.. It helped me a lot. Thanks

    ReplyDelete
  8. Hi Volodymyr, in first words - totally awesome work!

    Could you please give me a clue or example how to mix in one group UIScaleConnector and UIConnector? I`m mean - I want to have in one panel possibility to scale image object and text object by UIScaleConnector. Is there a simple way to accomplish this?

    ReplyDelete
  9. To make it clear - how to dynamical change active connectors between UIScaleConnector and UIConnector depending on selected object? (UIScaleConnector for s:label and UIConnector for others?). I try it based on TransformToolSample14 but don`t know how to implement this. Any clue?

    ReplyDelete
    Replies
    1. Hi,

      See my post at http://vstyran-flex.blogspot.com/2012/03/transform-tool-changing-connectors.html

      Delete
  10. Hello Volodymyr,

    Firstly i have to say that your works are excellent. Do you have any samples codes for htmlText? There are some problems with using htmlText like using bold fonts and regular fonts at the same time. If you are rotating the controls like TextArea it has been disappeared after rotation. To solve this problem we have to embed fonts. Now it is okay.. But, bold and regular fonts are still problem. Do you have any idea for the solution?

    ReplyDelete
    Replies
    1. Hi, actually rotating non embedded fonts is the problem of Flash.

      Delete
  11. Hello, I am very impressed with all the work related to Transform Tool.

    I would like to know your opinion on how to go about the following. I am interested in connecting the boxes. Either text or image boxes with lines in order to obtain a Workflow diagram.

    Do you have any idea about it?
    Transform Tool.

    ReplyDelete
  12. Hi,

    I created a flex project in flash builder 4.6 with 3.6A sdk . Following are the issues that i am facing while compiling the application.


    1. 1046: Type was not found or was not a compile-time constant: [mx.binding]::IWatcherSetupUtil2.
    2. 1046: Type was not found or was not a compile-time constant: [mx.core]::IStateClient2.
    3. 1046: Type was not found or was not a compile-time constant: [mx.core]::IVisualElement.

    Can you please provide a solution for running application in MX architecture as maximum example are Spark based.

    Can you please provide some example with MX architecture

    ReplyDelete