# Extracting textsnapshot data from dynamiclly created UILoaders for multiple swf files

**URL:** <https://forum.kirupa.com/t/extracting-textsnapshot-data-from-dynamiclly-created-uiloaders-for-multiple-swf-files/329381>\
**Category:** flash\
**Created:** [August 21, 2012, 9:40am UTC](https://forum.kirupa.com/t/extracting-textsnapshot-data-from-dynamiclly-created-uiloaders-for-multiple-swf-files/329381 "2012-08-21T09:40:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trupti](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trupti/32/3418_2.png) [@Trupti](https://forum.kirupa.com/u/Trupti)\
**Post date:** [August 21, 2012, 9:40am UTC](https://forum.kirupa.com/t/extracting-textsnapshot-data-from-dynamiclly-created-uiloaders-for-multiple-swf-files/329381/1 "2012-08-21T09:40:18Z")

</div>

Hello,

Need some help in adding text search feature.  
I’m using tutorial at the link below to load files.

[http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs](http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs)

Loading and all is fine.  
I have written code to extract text from the loaded swf.  
This code works fine if i load swf in UILoader on stage but does not work with dynamiclly created UILoaders.

Here is the code

.  
.  
.  
//swf loading code…  
\_swfTempClip = (event.currentTarget);  
timeLineRef.textSearcher.AddSearchData(\_loadedSWFs, \_swfTempClip);

swf’s are loaded as explained in the tutorial. After loading each swf below function is called.  
public function AddSearchData(\_pageNum:Number, \_pageObj:Object):void  
{  
trace("add Search Data "+\_pageNum);  
var tempPageObjS:Object = new Object();  
tempPageObjS = \_pageObj;  
var tempMCS:MovieClip = new MovieClip();  
var tempSnapTextObjS:TextSnapshot;  
var tempStrS:String = new String();  
if(tempPageObjS != null && tempPageObjS.toString() == “[object MainTimeline]”)  
{  
trace(“it is MC1”)  
tempMCS = tempPageObjS as MovieClip;  
tempSnapTextObjS = tempMCS.textSnapshot;  
trace("tempSnapTextObjS "+tempSnapTextObjS.charCount)  
//strange thing is i’m getting proper count value for above trace  
tempStrS = tempSnapTextObjS.getText(0,tempSnapTextObjS.charCount,true);  
//but empty string below trace  
trace("tempStrS "+tempStrS);  
}  
}

Am I missing something here?  
Thanks for any help! 🙂
