View Full Version : Button Event Not Reading in IE

12-11-2009, 10:56 AM

ive just been debugging my script in IE, and came across this:

OrbitTool.prototype.handleMouseUp = function(e) {
if (e.button == g_o3d.Event.BUTTON_LEFT) {
this.mouseLeftDown = false;
} else if (e.button == g_o3d.Event.BUTTON_MIDDLE) {
this.mouseMiddleDown = false;

its giving me an error on the second line, the error reads ('button' is null or not an object). does anyone know why this might be? im not a pro with javascript so my knowledge only stretches so far.

Reply With Quote

12-11-2009, 11:05 AM
OrbitTool.prototype.handleMouseUp = function(e) {
e = e || event;

It's because the cross browser event object.

12-11-2009, 11:15 AM
sweet it stopped the error thanks

12-11-2009, 11:23 AM
hmm my system still isnt working in IE, do you know why this site will only work in firefox and not IE, you may need to download o3d's api to see it:


12-11-2009, 12:07 PM
hmm my system still isnt working in IE
It would be of some help if you could tell us what isn't working in IE.

12-11-2009, 12:11 PM
Im not sure what is causing the problem I was wondering if anyone on here has a tool that could check the code, or if they could spot why it wasnt working.

12-11-2009, 01:35 PM
I think this might be where it is getting stuck, anyone see any IE issues in this code?

function dragOver(event) {
if (g_urlToInsert != null) {
g_urlToInsert = null;

function startInsertDrag(url) {
// If no absolute web path was passed, assume it's a local file
// coming from the assets directory.
if (url.indexOf('http') != 0) {
var path = window.location.href;
var index = path.lastIndexOf('/');
g_urlToInsert = path.substring(0, index + 1) + g_assetPath + url;
} else {
g_urlToInsert = url;

function cancelInsertDrag() {
g_urlToInsert = null;