Skip to main content
Known Participant
March 5, 2010
Answered

Using TextFlowUtil in Flash CS4

  • March 5, 2010
  • 1 reply
  • 1709 views

Hello,

How do I go about using TextFlowUtil in CS4?  What project settings do I need to update.  I have tried a variety of source and library paths to no avail. 

What I am trying to accomplish is importing saved markup into a Flash CS4 app that was exported from a Flex app via TextFlowUtil.

I have the TextLayout component installed in Flash CS4 and it works fine.  I just can't seem to get TextFlowUtil working.

thanks,

jr

This topic has been closed for replies.
Correct answer

Hello Alan,

I've been away from this project for a little while.  Unfortunately I am encountering a new issue.

When using :

var textFlow:TextFlow = TextConverter.importToFlow(menuXML, TextConverter.TEXT_LAYOUT_FORMAT);

I get the following error:

1046: Type was not found or was not a compile-time constant: ImportExportConfiguration.

I have the following Actionscript script settings:

Library Path

$(AppConfig)/ActionScript 3.0/libs

/Applications/Adobe Flash Builder Beta 2/sdks/4.0.013875/frameworks/libs

/Applications/Adobe Flash Builder Beta 2/sdks/4.0.013875/frameworks/libs/textLayout.swc

Am I missing one?  Are they out of order?

Let me know pls.

cheers,

jr


That sounds like the same issue still happening. The ImportExportConfiguration class is from an old version of the TLF swc(s). Check to make sure the old component isn't still around somewhere, and that there is not a TextLayout.swc (or TextLayout_conversion.swc) in $(AppConfig)/ActionScript 3.0/libs or in some other reference in your project.

1 reply

March 5, 2010

TextFlowUtil is a spark class that I haven't used myself, but according to the documentation it exports XML markup in the TLF format. So in Flash CS4 I'd use the TextConverter class in the flashx.textLayout.conversion package. If you have your XML in a variable named "markup" the line would look like:

var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);

jrbranaa2Author
Known Participant
March 5, 2010

Hello Alan,

Thanks for your quick reply.

After doing some testing and a little more reading the following is what I found:

- Flash TextLayout Component has "xmlText" property with accomplishes the "import" functionality that I need.

- If however you need to still use the TextFlowUtil library you'll need to make the following library path setting changes:

+ /Applications/Adobe Flash Builder Beta 2/sdks/4.0.0/lib

+ /Applications/Adobe Flash Builder Beta 2/sdks/4.0.0/frameworks/libs/spark.swc

If  you have any other library paths defined, ensure that they don't conflict with the two above.

A side note, the textFlow property of the TextLayout component is read-only which kept my original approach from working.  This is different than the Spark TextArea.textFlow property, which is read/write.

cheers,

jr

March 5, 2010

Ah, I had glossed over your mention of the TextLayout component. Be aware that the component is quite old at this point, and you will likely find some mismatches between what it implements and the current versions of the TextLayout.swc you get in the Flex SDK 4 builds.

The component was our first attempt at integrating TLF functionality into Flash Pro. It has since been discontinued, and you will find a better implementation in the next shipping version of Flash Pro. Our current recommendation is either to use the Flash Builder spark components that are available or use TLF in your own ActionScript code in Flash Builder or Flash Pro.