Storing values in array with left mouse click event

Discussion in 'JavaScript' started by sharat80, Apr 10, 2009.

  1. #1
    Hi all,

    I have a program where I will get Terrain coordinate values x and y in a pop up with left mouse click event hovering in a 3D window like google earth. I want to store those values in an array. I need help please. Any ideas about writing code.
    Any sample codes plz

    Thanking you all in advance,
    Sharat.
     
    sharat80, Apr 10, 2009 IP
  2. JavaScriptBank.com

    JavaScriptBank.com Peon

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    do you begin to learn JS? I think you need some JavaScript tutorials for understanding it

    You just use the onclick event, you can use the sample JavaScript code at link below

    http://javascriptbank.com/forum/viewtopic.php?f=29&t=715


    
    <script type="text/javascript">
    var coordinates = array(2);
    document.onclick = function() {
     // x, y are coordinates in your window browser
     coordinates[0] = x;
     coordinates[1] = y;
    };
    </script>
    
    Code (markup):

    if you feel that code is good, please give me a green reputation :D

    Thank
     
    JavaScriptBank.com, Apr 10, 2009 IP