#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Buenos Aires, Argentina
    Posts
    154
    Rep Power
    14

    Question JavaScript thru Flash?


    Hi,

    Is it possible to trigger a JavaScript command in Flash when an animation finishes? Basically, I would need to close a div (layer) in an HTML page once a flash animation has played. The JavaScript command would be something like:

    ecomm.style.visibility='hidden';return false;

    Any ideas?

    Thanks,
    Ralph.
  2. #2
  3. No Profile Picture
    Certified Genius
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    over there
    Posts
    77
    Rep Power
    14

    fscommand


    in the last frame of your animation put the lines...

    fscommand("hidestuff", "");
    stop();

    now, in the html file where the movie is embedded put this in a javascript block...

    function myMovie_DoFSCommand(command, args) {
    if (command == "hidestuff") {
    ecomm.style.visibility='hidden';return false;
    }
    }

    where "myMovie" is the value of the "name" parameter in the embed tag...for a full overview of fscommand, read the help file : ) ...rob
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    Buenos Aires, Argentina
    Posts
    154
    Rep Power
    14
    Hi,
    Thanks for the reply.

    I inserted that command into the Flash animation and, although it does stop playing, however, it doesn't trigger the JavaScript function in the HTML code. Maybe I positioned it incorrectly (the Javascript). Any ideas?

    Thanks,
    Ralph.

IMN logo majestic logo threadwatch logo seochat tools logo