To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-09-2006, 09:56 AM   #1
arkum
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);
}
Thanks

Last edited by arkum; 07-09-2006 at 10:16 AM.
arkum is offline   Reply With Quote
Old 07-09-2006, 11:01 AM   #2
arkum
Senior Member
 
Join Date: Feb 2005
Posts: 237
NeverMind. I've sorted it.
arkum is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:20 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.