Skip navigation
jkc7297
Currently Being Moderated

Force TLF/textflow to load image now.

Feb 2, 2011 12:09 PM

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

 
Replies
  • Currently Being Moderated
    Feb 2, 2011 1:46 PM   in reply to jkc7297

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 6, 2011 8:04 PM   in reply to jkc7297

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points