3 Replies Latest reply on May 9, 2006 4:34 AM by Abuhmaid

    Need some Javascript help within Flash

    gtmatt22
      Before I get into the main problem I probably need to explain a couple of things. First I am pretty new to flash so be gentle. Also I have been using another great Macromedia program, Captivate. It is a way to make simulation videos and outputs flash files. Without going into great detail, to great for this post at least, I need a way to have a button in flash that can call a javascript so that I can pass results to a database. I have many many movies already that work with Captivate but there are some instances that I require going through flash first in order to have right click functionality. The js that I have been using looks like this ReportResults ("PASSED", "MOVIENAME", "NEXTMOVIETOCALL"); So what I was hoping to have some help on would be how it would be possible to use THIS js in Flash. I can't change the js at this point so I wanted to know how I could use flash to call this once button is clicked in Flash. Can somebody please help. Thanks.
        • 1. Re: Need some Javascript help within Flash
          Level 7
          Look at the getURL action to call JS functions in the container document.

          jsCmd = "ReportResults (\"PASSED\", \"MOVIENAME\", \"NEXTMOVIETOCALL\");"
          getURL("javascript:" + jsCmd);


          You might want to just use the example in docs to get the idea:
          Create a button and give it the instance name myBtn.

          myBtn_btn.onRelease = function(){
          getURL("javascript:alert('you clicked me')");
          };


          --
          Lon Hosford
          www.lonhosford.com
          May many happy bits flow your way!
          "gtmatt22" <webforumsuser@macromedia.com> wrote in message
          news:e0tsdq$9a0$1@forums.macromedia.com...
          Before I get into the main problem I probably need to explain a couple of
          things. First I am pretty new to flash so be gentle. Also I have been
          using another great Macromedia program, Captivate. It is a way to make
          simulation videos and outputs flash files. Without going into great
          detail,
          to great for this post at least, I need a way to have a button in flash that
          can call a javascript so that I can pass results to a database. I have many
          many movies already that work with Captivate but there are some instances
          that
          I require going through flash first in order to have right click
          functionality.
          The js that I have been using looks like this ReportResults ("PASSED",
          "MOVIENAME", "NEXTMOVIETOCALL"); So what I was hoping to have some help on
          would be how it would be possible to use THIS js in Flash. I can't change
          the
          js at this point so I wanted to know how I could use flash to call this once
          button is clicked in Flash. Can somebody please help. Thanks.


          • 2. Re: Need some Javascript help within Flash
            gtmatt22 Level 1
            Thanks, I will give the getURL function a try. It looks like the best solution. Thanks again for the help.
            • 3. Re: Need some Javascript help within Flash
              Abuhmaid
              gtmatt22,
              did this work with you? i has a bit confussing for me.
              I have tried it but there was some error reports
              thanks