PDA

View Full Version : scrollbar doesn't appear


sted
06-08-2005, 11:51 AM
Holà,

I need to understand why the following code don't work.

var fubar:Number = 20;
test_sp.onLoad = function() // test_sp is a scrollpane with contentpath is a empty movieclip
{
v = new LoadVars();
v.load("foo.php");
v.onLoad = function()
{
var i:Number;
for (i = 0; i < fubar; i++)
test_sp.content.attachMovie("Label", "foo" + i, i, {text:"label " + i, _y:i * 20, _x:0});
};
};
...

the following is working

var fubar:Number = 20;
test_sp.onLoad = function()
{
var i:Number;
for (i = 0; i < fubar; i++)
test_sp.content.attachMovie("Label", "foo" + i, i, {text:"label " + i, _y:i * 20, _x:0});
};


i need the first code works because the number of labels to add in the scrollpane comes from php. in the first case, the scrollbar doesn t appear, can u help me ?

obrigado