Hello!
I have a problem with my flash. I have three pictures that I load in from a xml file, so far I have succeed. The problem is when I try to load in the **url **and the descriptions to the pictures. I don´t know what to do, I´m so close now. Please help me!
I hope someone could take a look at my fla that I append, and help me.
I have very bad English so, I hope someone understand my.
Best Regards
Christian
RichL
April 5, 2006, 8:13pm
2
hope this helps.
i got all three texts to load (though i am not sure where you wanted them to be displayed).
and the three links seem to work okay too !!
(by the way your fla was publishing to Flash 6 and using AS 1.0 but i changed it to Flash 8 and AS 2.0. This is a Flash 8 forum after all :} )
var thumb_spacing = 300;
function GeneratePortfolio(portfolio_xml){
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++)
{var currentPicture = portfolioPictures*;
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
currentThumb_mc._x = i*thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.createTextField("description_txt",10,0,300,270,100);
currentThumb_mc.description_txt.autoSize = "left";
currentThumb_mc.description_txt.border = true;
currentThumb_mc.description_txt.multiline = true;
currentThumb_mc.description_txt.wordWrap = true;
currentThumb_mc.textfile = currentPicture.attributes.description;
currentThumb_mc.link = currentPicture.attributes.url;
loadText(currentThumb_mc);
createLink(currentThumb_mc);
}
}
function loadText(mc:MovieClip)
{var lv:LoadVars = new LoadVars();
lv.onData = function(src:String):Void {
if (src != undefined) {mc.description_txt.text = src;}
else {mc.description_txt.text = "Unable to load text.";}
}
lv.load(mc.textfile);
}
function createLink(mc:MovieClip)
{ mc.onRelease = function(){getURL(mc.link,"_blank");}
}
// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
if (success){GeneratePortfolio(this);}
else {trace("Error loading XML file");}
}
// load
portfolio_xml.load("portfolio.xml");
TANK YOU,
TANK YOU,
TANK YOU,
TANK YOU YOUR ARE THE BEST