Are you sure, that you did everything right?
- Export component to the library
- Instantiate
ScrollPane
- Set size for scroll area, and add it to the display list
- Create content that will be scrolled
- Set
source
with reference on newly created content.
質問
Can anyone give advice on what would be a proper way to set a MovieClip as the source of a ScrollPane in ActionScript3?
I wish to have a MovieClip (Lets call it "A") that holds ten smaller movieclips (lets call them "b"). Then, I would like to add "A" to the ScrollPane and have the other ten "b" movie clips also show up.
Some pseudo code I am trying goes like this:
scroll_area = new ScrollPane();
A = new A(); //MovieClip that will contain the smaller MovieClips
scroll_area.source = A;
for (i= 0; i < 10; i++)
{
_b = b(); // smaller movie clip
_b.y = y + 20; // for spacing
y = y + 20;
A.addChild(_b);
}
scroll_area.update();
This however ends up with the ScrollArea just being present and nothing else.
Any advice is much appreciated.
解決
Are you sure, that you did everything right?
ScrollPane
source
with reference on newly created content.