# Load text into dynamic MC - but replaces previous mc!

**URL:** <https://forum.kirupa.com/t/load-text-into-dynamic-mc-but-replaces-previous-mc/100539>\
**Category:** Uncategorized\
**Created:** [January 30, 2004, 8:29pm UTC](https://forum.kirupa.com/t/load-text-into-dynamic-mc-but-replaces-previous-mc/100539 "2004-01-30T20:29:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScriptFlipper](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@ScriptFlipper](https://forum.kirupa.com/u/ScriptFlipper)\
**Post date:** [January 30, 2004, 8:29pm UTC](https://forum.kirupa.com/t/load-text-into-dynamic-mc-but-replaces-previous-mc/100539/1 "2004-01-30T20:29:39Z")

</div>

This is freaking me out…  
I have a function which adds movieclips dynamically into another  
movieclip. Inside the dynamic movieclip is a dynamic textbox  
(it gets it’s content from a textfile via the function).

However, if I add more than one movieclip, the previous added  
mc’s gets the textbox value undefined (doesn’t matter if it’s an  
identical mc or a different one). And it hasn’t got to do with levels,  
I’ve already checked that…

Here’s the function:  
[AS]  
addTxt = function (src, objWidth, xpos, ypos, level) {  
text\_lv = new LoadVars();  
text\_lv.onLoad = function(success) {  
if (success) {  
clip\_mc = \_root.contentContainer\_mc.content\_mc.attachMovie(“text\_mc”, “text”+level+"\_mc", level);  
clip\_mc.\_x = xpos;  
clip\_mc.\_y = ypos;  
clip\_mc.text\_txt.\_width = objWidth;  
clip\_mc.text\_txt.html = true;  
clip\_mc.text\_txt.htmlText = text\_lv.txt;  
clip\_mc.text\_txt.\_height = clip\_mc.text\_txt.textHeight;  
}  
};  
text\_lv.load(“text/”+src);  
};

[/AS]  
the function is called by an “XML-loop”, and the level-var is changed for each mc that is to be created.  
so how can this be??? ☹

I will be extremely happy if someone of you guys knows the solution to my problem!

Thank you very much in advance 🙂
