Navarone
09-05-2006, 08:51 PM
I was wondering if there is a better way to accomplish loading a swf into a scroll pane. I am using the 'location' property which I think is depreciated, is there a newer property in flash that does the same thing?
combo_list.change = function(eventObj) {
thumbs.invalidate();
thumbs.refreshPane();
//
var selItem:Object = eventObj.target.selectedItem;
trace("Item selected was: "+selItem.label);
var itemXML:XMLNode = selItem.data;
//use saved reference to iterate through childNodes
for (var idx = 0; idx<itemXML.childNodes.length; idx++) {
trace("Item includes: "+itemXML.childNodes[idx].attributes.source);
var t_mc:MovieClip;
//t_mc = thumbs.content.attachMovie("thumb_mc", "thumb"+idx, idx, this.getNextHighestDepth());
t_mc = thumbs.content.attachMovie("thumb_mc", "thumb"+idx, idx, this.getNextHighestDepth());
t_mc._x = 5;
t_mc._y = 5+(idx*80);
t_mc.idx = idx;
t_mc.location = itemXML.childNodes[idx].attributes.source;
trace(t_mc.idx);
//
t_mc.onRelease = function() {
//trace(this.location);
room.content.myLoader.contentPath=this.location+".swf";
room.content.myLoader._x = 100;
room.content.myLoader._y = 100;
room.invalidate();
//
};
}
};
combo_list.addEventListener("change", combo_list);
combo_list.change = function(eventObj) {
thumbs.invalidate();
thumbs.refreshPane();
//
var selItem:Object = eventObj.target.selectedItem;
trace("Item selected was: "+selItem.label);
var itemXML:XMLNode = selItem.data;
//use saved reference to iterate through childNodes
for (var idx = 0; idx<itemXML.childNodes.length; idx++) {
trace("Item includes: "+itemXML.childNodes[idx].attributes.source);
var t_mc:MovieClip;
//t_mc = thumbs.content.attachMovie("thumb_mc", "thumb"+idx, idx, this.getNextHighestDepth());
t_mc = thumbs.content.attachMovie("thumb_mc", "thumb"+idx, idx, this.getNextHighestDepth());
t_mc._x = 5;
t_mc._y = 5+(idx*80);
t_mc.idx = idx;
t_mc.location = itemXML.childNodes[idx].attributes.source;
trace(t_mc.idx);
//
t_mc.onRelease = function() {
//trace(this.location);
room.content.myLoader.contentPath=this.location+".swf";
room.content.myLoader._x = 100;
room.content.myLoader._y = 100;
room.invalidate();
//
};
}
};
combo_list.addEventListener("change", combo_list);