Hello,

This is a follow-up on this post :

http://www.flashkit.com/board/showth...ght=hex+colors

Here I setup a file in which a MC is colored with a HEX value from a text file. This text file is loaded into flash and contains a variable called "color1" and a value like

color1=#00FF99

And with this code my MC (my_square) gets colored :

//
// DYNAMIC COLOR WITH HEX
//
loadVariablesNum("colors.txt", 0);
temp_color = color1.split("#")[1]
myColor = new Color(this.my_square)
myColor.setRGB("0x"+temp_color)

When I use this on the main root timeline all goes well.
Now I try to implement this into another project and I can't get it to work...

In the new project a draggable window is created when a button is clicked. This window is created with "attach_movie" from the library.
When I copy the above script into this window and set the target for the load variables to "this", the variables won't load correctly.

I guess my question would be :

How can I load variables into a MC which is created by actionscript so there is no _root.path.tosymbol. known?

Any suggestions?
Ragards,
Lars J.


BTW :indows are generated by the script below :


// zOrder.fla by Nathan Dicken - nathand@boxerjam.com (or) nkdicken@aol.com
// to be used for educational purposes only
// this is a new version - sorry for the latest "buggy" one
// .................................................. ........
// create new array for monitoring z-order
zOrderList = new Array("0");
defaultX = 174;
defaultY = 55;
increment = 7;
id = 0;
mainTitle = "Sample Title";
mainContent = "Here is some sample content...";
mainTitle2 = "Labels";
mainContent2 = "test";
// create a new windowObj...
function windowObj(title, content, windowtype) {
// get the current depth based on the array
id++;
var depth = id;
trace("id: "+id);
// create
_root.attachMovie("window", "window"+id, id);
this.window = _root["window"+id];
// position
this.window._x = defaultX+((id-1)*increment);
this.window._y = defaultY+((id-1)*increment);
// set data
this.window.title = title;
this.window.content = content;
this.window.myID = id;
this.window.windowtype = windowtype;
this.window.myDepth = zOrderList.length;
zOrderList.push(id);
}
// use zOrderList to swapDepths for necessary windowObj's
function swapZOrder(incomingDepth) {
for (i=incomingDepth; i<(zOrderList.length-1); i++) {
var windowA = zOrderList[i];
var windowB = zOrderList[i+1];
// swap A with B
_root["window"+windowA].swapDepths(_root["window"+windowB]);
// re-assign values in the zOrderList
zOrderList[i] = windowB;
zOrderList[i+1] = windowA;
// reassign depth values based on the zOrderList
_root["window"+zOrderList[i]].myDepth = i;
_root["window"+zOrderList[i+1]].myDepth = i+1;
}
}
// delete windowObj and splice zOrderList...
function closeWindow(incomingDepth) {
_root["window"+zOrderList[incomingDepth]].removeMovieClip();
zOrderList.splice(incomingDepth, 1);
for (i=incomingDepth; i<zOrderList.length; i++) {
// change each windowObj's depth
_root["window"+zOrderList[i]].myDepth--;
}
}