|
|
|
#1 |
|
Senior Member
Join Date: Feb 2005
Posts: 237
|
[F8] Set Interval With Delegate class
Hi there.
Trying to get to grips with the Delegate class. How do I resolve the scope issue with the interval. It can't access the class's variables. Code:
private var sliderIntervalID:Number;
private var itemIndex:Number
targetScrollbar.slider_mc.addEventListener("onPress", Delegate.create(sliderPressed));
targetScrollbar.slider_mc.addEventListener("onRelease", Delegate.create(sliderReleased));
private function sliderPressed():Void {
targetScrollBar.startDrag(//This is not the problem);
sliderIntervalID = setInterval(myInterval, 100);
}
private function sliderReleased():Void{
targetScrollBar.stopDrag();
clearInterval(sliderIntervalID);
}
private function myInterval():Void{
trace(itemIndex);
}
Last edited by arkum; 07-09-2006 at 10:16 AM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2005
Posts: 237
|
NeverMind. I've sorted it.
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|