PDA

View Full Version : onclick anywhere and send value into swf


sugata_bhar
10-22-2008, 06:23 AM
Hi

I am trying to send a variable into an swf when an user clicks anywhere on the page.

Say I have a sound playing inside a swf using sound object and attachsound.
I want to stop the sound when an user clicks anywhere in the page (anywhere means any part i.e non Flash areas also)

Thanks
Sugata

jasonJ
10-23-2008, 07:12 PM
In plain JS:
window.onclick = function() {

};

In AS 2.0 use the ExternalInterface class (http://livedocs.adobe.com/flash/9.0/main/00001653.html#wp249136).