CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   Event.observe returns error (http://www.codingforums.com/showthread.php?t=167556)

Sleeping_Troll 05-29-2009 03:25 PM

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!


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.