Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Getting "object error"
Old 05-14-2009, 06:27 PM Getting "object error"
Sleeping Troll's Avatar
Ultra Talker

Posts: 351
Name: Butch Begy
Trades: 0
This is the code, I think it's function is obvious... can anyone tell what the problem is?
Code:
 
function moveball(x,y,z){
  try{
  var k=(Zeye-Zscreen)/(Zeye-z);
  var bs=Math.round(ballsize*k);
  this.is.width=2*bs;
  this.is.height=2*bs;
  this.is.left=(x+xmax)/2;
  this.is.top=(y+ymax)/2;
  this.is.zIndex=(z+zmax)/2;
 }
 catch(err){
 alert("error ="+err+", x="+x+", y="+y+", z="+z+", k="+k+", bs="+bs+", top="+this.is.top+", left="+this.is.left+", width="+this.is.width+", height="+this.is.height);
 }
}
is=object.style

http://huduzu.trollnest.com to see the error reported.
__________________
Sleeping Troll, EMUSE, Mind Expansion...Truly serendipity!

Last edited by Sleeping Troll; 05-14-2009 at 07:00 PM.. Reason: additional info
Sleeping Troll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-14-2009, 07:09 PM Re: Getting "object error"
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
The most obvious to me is that this is not just a function..
It's a method of a javascript object (or it looks like).

Beside, this alone is useless, as it refers to variable declared outside it's private scope.
The problem could be a type error or a divide by zero.

And your site stay definitively black for me, with just a music in background.
I'm on Firefox 3.5 beta4 on linux.

If I look at the ff error log, is see:
Quote:
Warning: Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
Source File: http://huduzu.trollnest.com/Scripts/orbs.js
Line: 28
which is:
Code:
for(i=0;i<numballs*2;i++)collisionstack.push(new thwack(container));
Probably the reference to "container" who should be
Code:
document.getElementById('container');
I see this too:
Quote:
Error: uncaught exception: [Exception... "String contains an invalid character" code: "5" nsresult: "0x80530005 (NS_ERROR_DOM_INVALID_CHARACTER_ERR)" location: "http://huduzu.trollnest.com/Scripts/orbs.js Line: 186"]
which points to:
Code:
b=document.createElement("<img src=\"../images/collision.png\" style=\"border:0px solid red;position:absolute;left:-10000px;top:0px;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50)progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')\" >");
In this case, it's because when you use createElement(), you don't give the html you want.
you should use it:
Code:
b=document.createElement('img');
b.src="../images/collision.png";
b.style="border:0px solid red;position:absolute;left:-10000px;top:0px;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50)progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')";
container.appendChild(b);
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Getting "object error"
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10097 seconds with 12 queries