Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-12-2006, 08:38 AM   #1
manorius
Senior Member
 
manorius's Avatar
 
Join Date: Sep 2005
Posts: 129
Send a message via Skype™ to manorius
Angry Class setInterval question

Hi guys,

Does anyone have any idea why I can't stop the interval
inside the class I created?

Code:
class drawClass extends MovieClip {
	
        private var sPointx:Number;
	private var sPointy:Number;
	private var ePointx:Number;
	private var ePointy:Number;
	private var pieceNo:Number = 1;
	private var currentPart:String;
	private var nameIt:String;
	private var nTimes:Number;
	private var line:MovieClip;
	
  



	static var emptyClip:Number = 0;
	private function init() {
		sPointx = this._x;
		sPointy = this._y;
		
	}
	private function startDrawing(stopIt:Number) {
		
		nTimes= setInterval(this, "drawing", 1);
		
	}
	private function stopDrawing() {
		
		clearInterval(this.nTimes);
		
	}
	private function drawing() {
		ePointx = this._x;
		ePointy = this._y;
		if (pieceNo == 1) {
			emptyClip++;
			currentPart = emptyClip+"part"+emptyClip;
line=_root.createEmptyMovieClip(currentPart,_root.getNextHighestDepth());                                         
			line.lineStyle(0, 0x0066cc, 100);
			
			line.moveTo(sPointx, sPointy);
			
		}
       		line.lineTo(ePointx, ePointy);
		
		sPointx = ePointx;
		sPointy = ePointy;
		pieceNo++;
		
		
		
			
			
		
	}

	
}
I really don't understand why the interval is not cancelled when I
call the function which stops the interval

["movieclip"].stopDrawing();

Thanks guys for checking my thread!
Manolis
manorius is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Q using a setInterval function in a Class to count Taff ActionScript 2.0 8 04-04-2005 02:05 PM
Trouble using setInterval in class chrscote ActionScript 2.0 1 03-29-2005 07:18 PM
Advanced question: XML, AS class & events oris ActionScript 2.0 6 03-24-2005 09:13 PM
custom class question Pixel ActionScript 2.0 3 08-24-2004 03:39 PM
Class Question... meloveitaly ActionScript 2.0 4 08-20-2004 12:48 AM


All times are GMT. The time now is 03:44 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.