• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Force TLF/textflow to load image now.

New Here ,
Feb 02, 2011 Feb 02, 2011

Copy link to clipboard

Copied

Hi

I notice a interesting issue when I tried to print a RichEditableText with a textflow that have image.

If the control is already on the screen. Printing looks good.

If we tried to use a custom print view(the print view get a deepcopy of the textflow that's already showing), the image seems to be missing.

Further debugging show that the image status in the textflow is "loadpending" right before it print.

Is there anyway to force the textflow to load in the image before it starts printing?

Thanks for any idea

TOPICS
Text layout framework

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 02, 2011 Feb 02, 2011

Copy link to clipboard

Copied

Not in all cases.  Loading an Image from a source in FlashPlayer is by definition an asynchronous operation.  Best way to do that is to copy the flow. compose it (first compose of a new image intiiates the load) and wait for all the images to load.  It's fairly straightforward to count the images that need to be loaded in the TextFlow and then wait for them to load.

Hope that helps,

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 24, 2011 May 24, 2011

Copy link to clipboard

Copied

If that's the case. What will be the best way to count the number of images in a textflow or html text?

Is there any function like "document.images.length" to get the images count.

Basically I have a spark list with custom item renderer that have richeditabletext in each list item.

Each richeditabletext take some html text that can have multiple src images.

I like to print out the whole list.

Thanks for any idea.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 06, 2011 Jun 06, 2011

Copy link to clipboard

Copied

For reference. I found a site showing how we can manually count the images in textflow using regex.

Not sure how accurate that is. but here is the link for reference. http://flashsimulations.com/2010/09/10/handling-image-loading-in-tlf-textflow-and-textfield/

Basically

var source_AttributeRegExp:RegExp = /source="[^"]+"/gi;

Since getting images count is a requirement for printing TLF.

If the above routine is correct, somebody should copy that code and put it in the TLF Class somewhere.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 06, 2011 Jun 06, 2011

Copy link to clipboard

Copied

LATEST

It sounds good. You can also travel the textflow leaf by leaf(textflow.getFirstLeaf(); leaf.getNextLeaf();) to count InlineGraphicElement, which will be definitely accurate but may slow down your app.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines