Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-08-2012, 10:26 AM   PM User | #1
nullpointer
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
nullpointer is an unknown quantity at this point
OOP Javascript Question

I think this is a pretty easy to fix error made by a newb ( me. Can anyone tell me why the call to "this.slideNext() " in the code below does not work. Apparently "this.slideNext() " is not a function?

Code:
function ScoopAnimation(_path, _start, _end, _delay){
	this.start = _start
	this.end = _end;
	this.delay = _delay;
	this.path = _path
	this.currentFrame = _start;
		
		
		
	this.slideNext() = function (){
		this.currentFrame ++;
		console.log('  next this.currentFrame  : ' +this.currentFrame );
		}	
		
		
	
	this.start= function ()	
	{
		console.log('next this.start()   : ' +this.currentFrame );
//THE NEXT LINE CAUSES THE ERROR!
		this.slideNext() 
		 
		
		
		}
	
		this.start();
		
}
nullpointer is offline   Reply With Quote
Old 02-08-2012, 11:15 AM   PM User | #2
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 810
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
this.slideNext() = function (){
should be
this.slideNext = function (){
DaveyErwin is offline   Reply With Quote
Old 02-09-2012, 01:05 AM   PM User | #3
nullpointer
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
nullpointer is an unknown quantity at this point
arrr. Thanks so much!
nullpointer is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, oop

Jump To Top of Thread


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

Forum Jump


All times are GMT +1. The time now is 11:36 PM.


Advertisement
Log in to turn off these ads.