Coming back to Animate after 2 years...need some basic help re: Scrollpane content in AS3
I have found a snippet that will add a scrollpane to my timeline and it draws a red box for the content. That's working fine. Now I want to add my own movieclip to the scrollpane and it's not readily apparent to me how to do that.
Here is the code I'm using to draw the scrollpane...how do I add a movieclip to the pane?
import fl.containers.ScrollPane;
import fl.controls.ScrollPolicy;
import fl.controls.DataGrid;
import fl.data.DataProvider;
var aSp:ScrollPane = new ScrollPane();
var aBox:MovieClip = new MovieClip();
drawBox(aBox, 0xFF0000); //draw a red box
aSp.source = aBox;
aSp.setSize(1340, 170);
aSp.move(570, 120);
addChild(aSp);
function drawBox(box:MovieClip,color:uint):void {
box.graphics.beginFill(color, 1);
box.graphics.drawRect(0, 0, 1650, 150);
box.graphics.endFill();
}
