1. PHP Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Rep Power

    Javascript to flash

    I need javascript to be able to tell flash to do something, for example i have a function called test and all it does it dump some text on the screen in flash.

    I want javascript to be able to call this function from within a browser without having to submit a form. something like what i have tried.

    <meta http-equiv=Content-Type content="text/html;  charset=ISO-8859-1">
    <BODY bgcolor="#FFFFFF">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     WIDTH="550" HEIGHT="400" ALIGN="">
     <PARAM NAME="movie" VALUE="test.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="test.swf" quality=high bgcolor=#FFFFFF  WIDTH="550" HEIGHT="400" NAME="test" ALIGN=""
     TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveconnect="true" ></EMBED>
    <button onclick = "window.document.movie.test();">go</button>
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Rep Power
  4. #3
  5. No Profile Picture
    Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Rep Power
    now i cant be certain, but im not sure if you can have javascript call a function in flash. i do know that you can have javascript tell flash what frame in the main timeline to go to.

    so if you can, put a function call to your actionscript function in some frame of the main timeline, and have ur javascript tell it to go to that frame.

    so lets say that you arrive at your form on frame 5. your movie is stopped via stop(). the function call is on frame 6. so the button tells the flash movie to go to frame 6, and voila ur function gets called.

IMN logo majestic logo threadwatch logo seochat tools logo