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,
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.
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-textfiel d/
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.