Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Button Event Not Reading in IE

    Hi,

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

    Code:
    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.

    Simon
    Reply With Quote

  • #2
    New Coder
    Join Date
    Feb 2009
    Location
    Jakarta, Indonesia
    Posts
    93
    Thanks
    2
    Thanked 20 Times in 20 Posts
    Code:
    OrbitTool.prototype.handleMouseUp = function(e) {
    e = e || event;
    It's because the cross browser event object.

  • Users who have thanked gun5 for this post:

    simonstaton (12-11-2009)

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    sweet it stopped the error thanks

  • #4
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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:

    http://www.coding-development.co.uk/

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by simonstaton View Post
    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.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #7
    New Coder
    Join Date
    Sep 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I think this might be where it is getting stuck, anyone see any IE issues in this code?

    Code:
    function dragOver(event) {
        if (g_urlToInsert != null) {
        doload(g_urlToInsert);
      }
      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;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •