Forum Moderators: open

Message Too Old, No Replies

javascript control flash.. by function call not associated with event

this works in IE but not in firefox, why?

         

dodozhang21

4:32 am on Apr 30, 2005 (gmt 0)

10+ Year Member



hi, i found some code that lets me to control a flash movie with javascript. it works great if the function is called by onclick. but for my usage, i'm trying to make the sound play sometime during my xmlhttprequest object so i can not associate it with an event. so i tried to call it with

<script>
playmovie('testcommand');
</script>

it works great in IE but it doesn't work in firefox, altho the button click does work in firefox. does anyone know why?

here's the url for the file
[dodosmb.com...]

button clicks work in both IE and firefox

page load will sound only in IE, nothing happens in firefox.

Bernard Marx

5:43 am on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Currently, you don't have that command withing the <script> tags.
Instead you have
window.document.['testcommand'].Play();

This is incorrect Javascript ( document.[ )

The playmovie function calls another function to check whether the movie has loaded, perhaps this function is returning false.

Edit an alert into playmovie to see:

function playmovie(movieName) {
alert( movieIsLoaded(thisMovie(movieName)) );
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).Play();
}
}

dodozhang21

12:42 pm on Apr 30, 2005 (gmt 0)

10+ Year Member



yes it's returning false. just the playing part is also not working by itself.
i've updated the file

i just don't understand why the same function works on a button

rocknbil

5:38 pm on Apr 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



NVM, misread question, all works fine here.