SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: xy coordinates

  1. #1
    SitePoint Member
    Join Date
    Nov 2003
    Location
    India
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xy coordinates

    Hi,

    I have a javascript that controls a animated character in swf format. The script looks like this,

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function chiamaMetodo(clip, label) {
    var IE = navigator.appName.indexOf("Microsoft") != -1;
    var filmato = IE ? window.mainMovie : window.document.mainMovie;
    filmato.TGotoLabel(clip, label);
    }

    //-->
    </script>

    The character plays different animations when the user rolls over the page navigation. Like when he rolls over home it plays "anim1" and when he rolls over about us it plays "anim2".

    Everything is fine but i want the character to move close to the respective navigation labels and play the animation when the user rolls over them. That is, close to the (x,y) coordinates of the specific navigation label.

    Pls this is urgent!!!!!

    thanx

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know almost nothing about Flash but I'll take a shot at it.

    My code is just for generating ideas - it will not actually work very well. There are other issues to be solved. I'm just posting this to see if I'm close to understanding the question
    Code:
    function chiamaMetodo(clip, label) {
    var IE = navigator.appName.indexOf("Microsoft") != -1;
    var filmato = IE ? window.mainMovie : window.document.mainMovie;
    
    if (document.getElementById) {
      var oLbl = document.getElementById(label); // is 'label' an id or an object?
      if (filmato.style && oLbl && oLbl.style) {
        filmato.style.left = oLbl.style.left;
        filmato.style.top = oLbl.style.top;
      }  
    }
    
    filmato.TGotoLabel(clip, label);
    }


Bookmarks

Posting Permissions

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