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

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 05-29-2009, 03:25 PM   PM User | #1
Sleeping_Troll
New Coder

 
Join Date: May 2009
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Sleeping_Troll is an unknown quantity at this point
Event.observe returns error

Here is my script:
Code:
function init(){
	for(i=0;i<numOrbs;i++){
		Orb[i]=[];
		Orb[i].Img=new Element("img",{id:i, src:"./images/Orb.png", style:"display=none", onMouseover:"GrabOrb(this.id,1)", onMouseout:"GrabOrb(this.id,0)"});
		$("container").insert(Orb[i].Img);
		Orb[i].Img.static=0
		resize();  
		var theta;
		Orb[i].PositionX=Xmax/2;
		Orb[i].PositionY=Ymax/2;
		Orb[i].PositionZ=Zmax*.0001;
		theta=Math.PI*2*Math.random();
		phi=Math.asin(Math.random());
		if(Math.random()>0.5)phi=-phi;
		Orb[i].VelocityX=InitialVelocity*Math.sin(theta)*Math.cos(phi);
		theta=Math.PI*2*Math.random();
		phi=Math.asin(Math.random());
		if(Math.random()>0.5)phi=-phi;
		Orb[i].VelocityY=InitialVelocity*Math.cos(theta)*Math.cos(phi);
		theta=Math.PI*2*Math.random();
		phi=Math.asin(Math.random());
		if(Math.random()>0.5)phi=-phi;
		Orb[i].VelocityZ=InitialVelocity*Math.cos(phi);
		Orb[i].renew=0;
		Event.observe(Orb[i].Img,"mouseover", GrabOrb(i,1));
		Event.observe(Orb[i].Img,"mouseout", GrabOrb(i,0));
		}
	setInterval("collisions()",100);
}

function GrabOrb(ID,value){
		Orb[ID].static=value;
		alert(value);
}
it returns this error:

Message: 'handler' is null or not an object
Line: 4503 (prototype script)
Char: 11
Code: 0
URI: http://127.0.0.1/huduzu/Resources/prototype.js

I have posted the script on my host, and you can see it for yourself at:
http://huduzu.trollnest.com/index.php

Please help! I have been about 16 hrs on this and it is the last step for my "Orbs" widget and then I can get on to page content!
Sleeping_Troll is offline   Reply With Quote
Reply

Bookmarks

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 05:43 AM.


Advertisement
Log in to turn off these ads.