Hello!

I'm new in AS3 and i'm having some problems.

I'm trying to put thumbnails that are load by xml inside a ScrollPanel.

What happened is that the ScrollPanel didn't have a scrollBar and didnīt scroll. I thought that if i put each thumbnail inside a MovieClip and set the height maybe would do the trick. But things got worse because i couldn't be able to put the thumb's inside de MC's. Just put them in front.

Either way the MC's didn't solve the ScrollPane problem.

Any ideas?

Thanks

buttonMode = true;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.controls.ScrollPolicy;
import fl.controls.ScrollBarDirection;
import fl.containers.ScrollPane;


var transicao:Tween;
var carregaImagens:Loader;
var xml:XML;
var xmlLista:XMLList;
var xmlCarregador:URLLoader = new URLLoader();
xmlCarregador.load(new URLRequest("XML/imagens.xml"));
xmlCarregador.addEventListener(Event.COMPLETE, xmlCarregado);


function carregarDocumento300( nome:String)
{
var holder = root;
var children:Array = new Array();
for (var i=0; i<holder.numChildren; i++)
{
children.push(holder.getChildAt(i));
}
for (i=0; i<children.length; i++)
{
children[i].parent.removeChild(children[i]);
}

var loadIt = new Loader();
loadIt.unload();
loadIt.load(new URLRequest(nome));
addChild(loadIt);
}


var container:MovieClip = new MovieClip();
addChild(container);


function xmlCarregado(event:Event):void
{
xml = XML(event.target.data);
xmlLista = xml.children();

for (var u:int = 0; u < xmlLista.length(); u++)
{
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFF0000);
mc.graphics.drawRect(0, 0, 100, 80);
mc.graphics.endFill();
mc.y = u * 75 + 25;
mc.height=200;
addChild(mc);
container.addChild(mc);

carregaImagens = new Loader();
carregaImagens.load(new URLRequest(xmlLista[u].attribute("thumb")));
carregaImagens.y = u * 75 + 25;
carregaImagens.name = xmlLista[u].attribute("source");
container.addChild(carregaImagens);

carregaImagens.addEventListener(MouseEvent.CLICK, apaga);
carregaImagens.addEventListener(MouseEvent.CLICK, aumenta);
}
}

function aumenta(event:MouseEvent):void
{
carregaImagens = new Loader();
carregaImagens.load(new URLRequest(event.target.name));
carregaImagens.x = 300;
carregaImagens.y = 300;
transicao = new Tween(carregaImagens,"alpha",Regular.easeOut,0,2,2 ,true);
addChild(carregaImagens);

}


function apaga(event:MouseEvent):void
{
container.removeChild(carregaImagens);
}

var mySP:ScrollPane = new ScrollPane();
addChild(mySP);

mySP.setSize(100, 200);
mySP.source = container;
mySP.scrollDrag = true;
mySP.verticalScrollPolicy = "on";