Hi,
After much painful messing around I've managed to get a scroll pane working with 11 dynamically attached MovieClips. The problem is that only the first and the last movieclips attached are showing. my code is as follows
ActionScript Code:
this.attachMovie("ScrollPane", "cellInfo_sp", getNextHighestDepth(), {_x:20, _y:215});
this.cellInfo_sp.setSize(240, 145);
this.cellInfo_sp.contentPath = "cellCanvas";
myCanvas = this.cellInfo_sp.content;
myCanvas.attachMovie("cellInfoHeader", "cellHeader", this.cellInfo_sp.content.getNextHighestDepth()); //, {_x:20, _y:215});
//this.cellInfo_sp.setStyle("borderStyle", "none");
//myCanvas["cellHeader"]._visible = false;
for (var i=0; i<10; i++) {
myCanvas.attachMovie("cellInfoRow", "cellRow"+i, getNextHighestDepth()); //, {_y:(i*20)+20});
myCanvas["cellRow"+i]._x = 1;
myCanvas["cellRow"+i]._y = (i*20)+20;
//this.cellInfo_sp["cellRow"+i]._visible = false;
trace(myCanvas["cellRow"+i]);
}
trace(" ");
for (var i=0; i<10; i++) {
trace(myCanvas["cellRow"+i]);
}
the traces from this then appears as follows
ActionScript Code:
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow0
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow1
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow2
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow3
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow4
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow5
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow6
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow7
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow8
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow9
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
undefined
_level0.myInfo.cellInfo_sp.spContentHolder.cellRow9
So its as if each cellRow that I add drops out of scope as soon as the next loop iteration is started?!?! is it not possible to attach more than one instance of the same movieclip to a scrollpane's content or something??
Dont really want to have to do 10 seperate versions of the same movieclip in the library, as what I'm doing needs to stay as small as possible.
Thanks for any enlightenment any of ya can provide :s
Dave