this is probably not a difficult question, but im trying to get text into my scrollpane, essentially what i want to do is be able to dynamically load a picture with text next to it into a scrollpane and be able to just keep adding more in using xml.
probably the easiest way to explain it would be to imagine a cd collection with the cd name next to it and each new one i get i add to the xml file.
now im not the greatest at actionscript so i went straight to kirupas tutorial and have been nutting over it for the last week.
i can manage to create text fields along with the movie clips involved however i havent been able to populate them with any text. ive started off just adding in static text until i get that working and then from there id substitute the xml information in once it was working.
ive googled the world and scoured these forums and i just cant get the hang of it.
any help would be greatly appreciated. the flash file i used is simply the one that came with the tutorial and below is the code with what i have so far.
cheers!
var i:Number=0;
var mcMain:MovieClip;
var txtname = new Array();
var fmt:TextFormat = new TextFormat();
fmt.bold = true;
fmt.font = "emb";
fmt.size = 24;
function init() {
//empty movie clip in library with linkage name "scrollMovieClip"
scrollPane.contentPath = "scrollMovieClip";
mcMain = scrollPane.content;
}
init();
btnAdd.onRelease = function() {
//attaching blueMovie to the content location stored in mcMain
mcMain.attachMovie("blueMovie", "blue"+i, mcMain.getNextHighestDepth(), {_y:50*i+5, _x:5});
i = txtname.length;
txtname* = "txt" + i;
mcMain.createTextField(txtname*,mcMain.getNextHighestDepth(), 5, 50*i+5, 100,100);
mcMain.txtname*.setNewTextFormat(fmt);
mcMain.txtname*._rotation = 0;
mcMain.txtname*._alpha = 50;
mcMain.txtname*.autoSize = true;
mcMain.txtname*.embedFonts = true;
mcMain.txtname*.text = "blah blah blah";
i++;
scrollPane.invalidate();
};
btnRemove.onRelease = function() {
if (i != 0) {
i--;
removeMovieClip("scrollPane.spContentHolder.blue"+i);
scrollPane.invalidate();
}
}