Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Thu Jan 08, 2009 5:48 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Type mismatch
PostPosted: Mon Mar 12, 2007 11:17 am 
Offline

Joined: Mon Mar 12, 2007 11:14 am
Posts: 2
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/adapt ... tive.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?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 12:05 pm 
Offline

Joined: Mon Mar 12, 2007 11:14 am
Posts: 2
Never mind. I fixed it


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

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: