XML이로드 된 후 만들어진 클래스 인스턴스 내부의 동적 텍스트 필드에 UIScrollbar 구성 요소의 인스턴스를 연결하려고합니다. 슬라이더의 크기가 텍스트 필드의 내용에 따라 달라 지므로 스크롤 막대 구성 요소가 제대로 첨부되고 있지만 스크롤되지는 않습니다.클래스 내의 UIScrollBar 구성 요소를 스크롤하는 데 문제가 발생했습니다.
여기에 코드입니다 :
function xmlLoaded(evt:Event):void
{
//do some stuff
for(var i:int = 0; i < numProfiles; i++)
{
var thisProfile:profile = new profile();
thisProfile.alpha = 0;
thisProfile.x = 0;
thisProfile.y = 0;
thisProfile.name = "profile" + i;
profilecontainer.addChild(thisProfile);
thisProfile.profiletextholder.profilename.htmlText = profiles[i].attribute("name");
thisProfile.profiletextholder.profiletext.htmlText = profiles[i].profiletext;
//add scroll bar
var vScrollBar:UIScrollBar = new UIScrollBar();
vScrollBar.direction = ScrollBarDirection.VERTICAL;
vScrollBar.move(thisProfile.profiletextholder.profiletext.x + thisProfile.profiletextholder.profiletext.width, thisProfile.profiletextholder.profiletext.y);
vScrollBar.height = thisProfile.profiletextholder.profiletext.height;
vScrollBar.scrollTarget = thisProfile.profiletextholder.profiletext;
vScrollBar.name = "scrollbar";
vScrollBar.update();
vScrollBar.visible = (thisProfile.profiletextholder.profiletext.maxScrollV > 1);
thisProfile.profiletextholder.addChild(vScrollBar);
//do some more stuff
}
}
나는 또한 동영상 클립/클래스 자체 내에서 UIScrollBar 구성 요소와 그것을 시도했습니다, 그리고 그것은 여전히 작동하지 않습니다. 어떤 아이디어?