Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Type mismatch



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
Rival



Joined: 12 Mar 2007
Posts: 2

PostPosted: Mon Mar 12, 2007 11:17 am    Post subject: Type mismatch Reply with quote

I'm trying to adapt someone elses code to also output a extra image given a certain parameter. For some reason I get the following error:

--------------------
JavaScript - http://localhost:8080/aha/ViewGet/adaptive/?view=treefrm&concept=adaptive.index
Inline script thread
Error:
name: TypeError
message: Statement on line 809: Type mismatch (usually a non-object value used where an object is required)
Backtrace:
Line 809 of linked script http://localhost:8080/aha/adaptive/scripts/ftiens4.js
return parentFolder.addChildDot(todotornottodot, document);
Line 202 of linked script http://localhost:8080/aha/adaptive/scripts/menuNodes.js
aux1 = insFld(foldersTree, gFld("Test", "javascript:parent.op()"));
aux2 = insDocDot(aux1, gLnk("R", "Test", "nolink"), 0);
--------------------

The code I'm trying to adapt looks like this:
(Note: this code works!)
--------------------
Code:

aux2 = insDoc(aux1, gLnk("R", "Sheet 63", "week4/img63.html"))

function insDoc(parentFolder, document)
{
  return parentFolder.addChild(document)
}

function addChild(childNode)
{
  this.children[this.nChildren] = childNode
  childNode.parentObj = this
  this.nChildren++
  return childNode
}

--------------------

My adaptation looks like this:
(the code that doesn't work)
--------------------
Code:

aux2 = insDocDot(aux1, gLnk("R", "Test", "nolink"), 0)

function insDocDot(parentFolder, document, todotornottodot)
{
  return parentFolder.addChildDot(todotornottodot, document);
}

function addChildDot(todotornottodot, childNode)
{
//  this.childrenDot[this.nChildrenDot] = todotornottodot
//  this.nChildrenDot++
  this.children[this.nChildren] = childNode
  childNode.parentObj = this
  this.nChildren++
  return childNode
}

--------------------

Do you guys have any idea what is going wrong?
Back to top
View user's profile Send private message
Rival



Joined: 12 Mar 2007
Posts: 2

PostPosted: Mon Mar 12, 2007 12:05 pm    Post subject: Re: Type mismatch Reply with quote

Never mind. I fixed it
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap