I’m getting some weird behavior while trying to build a scrollbar in as3. I’ve applied a scrollRect to the movieclip I want to scroll:
public function create(targ, w, h):void{
trace('Scrollbar: Create');
this.targ = targ;
this.w = w;
this.h = h;
trace("targ.height is: "+targ.height);
this.targ.scrollRect = new Rectangle(0, 0, this.w, this.h);
trace("targ.height is: "+targ.height);
scrollpos=0;
checkComponents();
}
Both the traces before and after trace out the correct value, in this case 267. However, once I call any sort of mouseEvent (applied to the targ, the arrows used for the scrollbar… etc) it traces the height of targ as 125 - the height of the scrollRect. Is this a bug? Am i missing something about scrollRect?
Thanks,
Sarah