Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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();
    		
    }

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    945
    Thanks
    19
    Thanked 205 Times in 203 Posts
    this.slideNext() = function (){
    should be
    this.slideNext = function (){

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    arrr. Thanks so much!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •