PDA

View Full Version : contentPath ?


vee
05-11-2007, 04:09 PM
Can you use contentPath to attach multiples of a MC from the library that will invoke the scrollPane to hace scroll bars?

At the moment I can attach movieclips but not with contentPath. This causes a problem b/c I would like to take advantage of the scrollPane components ability to - well, scroll!

mcmcom
05-11-2007, 07:50 PM
this thread should explain it for you

http://www.actionscript.org/forums/showthread.php3?t=79570&highlight=loading+scroll+pane

(the solution is close to the bottom of the thread)

hth,
mcm

vee
05-12-2007, 01:46 AM
Hey thanx. This is what I came up with after reading that thread for those who are looking to do the same....
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 mcm