PDA

View Full Version : scrollPane: attaching multi MC's using contentPath


vee
05-10-2007, 10:43 PM
Can I use contentPath to attach multiple instances of a movieclip?
At the moment, I can attach without using contentPath but this does not help me at all. If I cannot use contentPath the scrollPane is useless - meaning none of the features of the scroll pane work - hence a static, unscrollable box.
I know some of you hate components but I do not have another option.

xastey
05-11-2007, 05:09 PM
How about you create a container and let that be the contentPath of the scroll pane then attach your movies to that.

vee
05-12-2007, 02:51 AM
you were right, someone else suggested the same... so here it is for anyone else thats interested out there
var oriX:Number = 0;
var oriY:Number = 0;
my_sp.contentPath = "empty";
for (var i = 0; i < 10; i++) {
var itemsInScrollPane:MovieClip = my_sp.content.attachMovie ("item", "item_" + i + "_mc", i);
itemsInScrollPane._x = oriX;
itemsInScrollPane._y = oriY;
oriX += itemsInScrollPane._width;
my_sp.invalidate;
}
:)
thanx:cool: