0

I have made a simple flash button. I want it so that on click = myJSfunction()

I tried adding an on click to the div which holds the flash object but the function is never called. What is the correct way to do this?

Thanks in advance

brux
  • 3,197
  • 10
  • 44
  • 78

2 Answers2

1

You need to use ExternalInterface to push the flash button's click event out to your javascript function, I think it swallows all clicks otherwise.

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

Paul
  • 35,689
  • 11
  • 93
  • 122
  • i know this is the correct way after reading around a bit, but whevenr I add the action to my single layer which has moving text the animation doesnt accur when viwed in browser and the function is not called – brux Jan 15 '11 at 19:32
0

This is very similar to onMouseover a flash element?

Add the mouse listener to the flash <object> or <embed> element itself, instead of the <div>.

Community
  • 1
  • 1
weltraumpirat
  • 22,544
  • 5
  • 40
  • 54