Hi there,
Sorry Flash newbie here,
Im trying to populate a grid of images from an image folder referenced by an XML file ive produced. Im currently able to read images from the XML file and place them in “image_loader_mc” and also its duplicate “newsymbol” successfully.
But my problem comes when using the Duplicate() method in the code for button2.
“newsymbol” always seems to update “image_loader_mc” so when i click this button the duplicate changes but so does the Original!
By the end of today I want to set up a for loop that creates rows and colums of images (mortal kombat character thumbnails) that are read in from an xml file. At the moment im just trying to get the first row working with button clicks.
Any help would be appreciated… Especially since its my 23rd birthday today!
// load variables object to handle loading of text
var lev_name_lv = new LoadVars();
function DisplayLevel(data_xml)
{
var i = 0;
var x = 0;
var y = 0;
var Symbols = data_xml.firstChild.firstChild.childNodes;
button2.onRelease = function()
{
var currentSymbol = Symbols*;
var currentSymbol_mc = image_loader_mc.createEmptyMovieClip("symbols_mc",i);
// for (row =1; row < 4; row++)
// {
duplicateMovieClip (_root.image_loader_mc,"newsymbol", 2);
newsymbol._x = _root.image_loader_mc._x + 100;
image_loader_mc.loadMovie(currentSymbol.attributes.sym_image);
i++;
newsymbol.loadMovie(currentSymbol.attributes.sym_image);
// }
currentSymbol_mc.sym_name = currentSymbol.attributes.sym_name;
level_text.text = currentSymbol_mc.sym_name;
}
}
// xml object for xml content (defines sources for selections)
var data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success)
{
if (success)
{
DisplayLevel(this);
}
else trace("Error loading XML file");
}
data_xml.load("data.xml");