I have a confusing ScrollPane issue that I hope someone has encountered before!
I have a movie clip called Inner_Area, which gets a number of other smaller movie clips loaded into it. The end effect is that it looks like a list of strings.
After the Inner_Area movieclip is populated with its additional information, I set the source of a ScrollePane object to it.
scroll_area.source = Inner_Area;
When I play the movieclip, the list loads up successfully, and a scroll bar appears on the right hand side. This is where the strange part happens.
If I click the scroll down arrow, to try to see the items at the bottom of the list, the Inner_Area actually seems to scroll to the RIGHT. Not down at all. I've looked over my actionscript and I cannot for the life of me see how this could be.
I've not included any code, of course, because I am initially hoping that someone may have experienced a similar situation before. How can I get a scrollpane area such that when you scroll down, it actually goes down instead of in a different direction?
Any hints, tips, or advice is much appreciated!
Some Code:
public class MenuBackground extends MovieClip
{
scroll_area = new ScrollPane();
scroll_area.x = -275;
scroll_area.y = -77;
scroll_area.width = 250;
scroll_area.height = 175;
addChild(scroll_area);
inner_area = new Inner_ZoneScrollArea();
spacing = 0;
for (i= 0; i < numthings; i++)
{
_field = new _Field();
_field.y = spacing;
spacing = spacing + 20;
inner_area.addChild(_field);
}
scroll_area.source = inner_area;
}
And in a different file, is the _Field code:
public function _Field()
{
_Format = new TextFormat();
_Format.size = 16;
_TextField = new TextField();
_TextField.x = 50;
_TextField.y = 4;
_TextField.textColor = 0xFFFFFF;
_TextField.defaultTextFormat = _Format;
_TextField.autoSize = "left";
_TextField.multiline = true; // Just added these last two on suggestion in this thread
_TextField.text = "Name"; // some text
addChild(_TextField);
}
Inner_ZoneScrollArea
with aMovieClip
because you didn't post the code for it. Once I changed the name of yourTextField
instance to something other than the same name as the class (please, never do that) it worked just fine. – Marcela