# MovieClip.myVariable = problem! Help!

**URL:** <https://forum.kirupa.com/t/movieclip-myvariable-problem-help/216493>\
**Category:** flash\
**Created:** [February 17, 2007, 1:15am UTC](https://forum.kirupa.com/t/movieclip-myvariable-problem-help/216493 "2007-02-17T01:15:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ozymandias](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ozymandias/32/1997_2.png) [@Ozymandias](https://forum.kirupa.com/u/Ozymandias)\
**Post date:** [February 17, 2007, 1:15am UTC](https://forum.kirupa.com/t/movieclip-myvariable-problem-help/216493/1 "2007-02-17T01:15:00Z")

</div>

I can’t figure out why this isn’t working!

The movieclip variables I create in the xml loop no longer exist after I load a picture into it. Specifically books[].url is undefined when you click the movieclip. What’s going on?

#include “lmc\_tween.as”  
var books:Array = new Array();  
var i:Number = 0;  
var xmlPath = “”;  
var picPath = “…/Image/books\_small/”;  
var newBook:Object;  
function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
newBook = thumbs\_mc.createEmptyMovieClip(“book\_”+i, thumbs\_mc.getNextHighestDepth());  
newBook.\_alpha = 0;  
newBook.pic = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
newBook.url = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
books.push(newBook);  
}  
loadBooks(0);  
} else {  
debug\_txt.text = “XML not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(xmlPath+“books.xml”);  
loadBooks = function (i) {  
plistener = new Object();  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(plistener);  
image\_mcl.loadClip(picPath+books\*.pic, books\*);  
plistener.onLoadComplete = function(target\_mc) {  
trace(target\_mc.url);  
target\_mc.alphaTo(100, 1);  
target\_mc.onRelease = function() {  
getURL(this.url);  
};  
target\_mc.onRollOver = function() {  
this.brightnessTo(30, 1);  
};  
target\_mc.onRollOut = function() {  
this.brightnessTo(0, 1);  
};  
target\_mc.\_x = i\*110;  
i += 1;  
i\<books.length ? loadBooks(i) : null;  
};  
};
