0

I have created a php page with a SWF flash file is imported with a classic tag <object>, with Autoplay set to false.

When the mouse hovers over the flash component, I would like this to start playing. I'm not interesting in "mouse out behavior". (It should continue playing even if the pointer is moved away.)

I have seen Action Script perform this behavior, but there are no project files with flash movies. So I cannot open it in project mode; I only can "see" it in "read mode".

How can I set this behavior without using Action Script inside my flash project?

I can manage the mouse events with a simple javascript code: I can open an alert message (thanks to onMouseover a flash element?) but I cannot pass the play command to the flash object.

Here is what I have tried:

<script type="text/javascript">
document.getElementById("id-of-my-movie").onmouseover = over;
function over(evt)
{
    document.getElementById("id-of-my-movie").play();
} 
</script>   

using .play() both PlayMovie()
Community
  • 1
  • 1

1 Answers1

0

Unfortunately there's no way to do this without any code inside Flash. If you've said that it won't autoplay, then only AS3 code can make it play.

You can use Javascript to call Flash functions, but the flash movie must have at least a few lines in order to receive those callbacks. You can check how to do this here: AS3 function call from javascript

Community
  • 1
  • 1
Andrey Popov
  • 7,362
  • 4
  • 38
  • 58