PDA

View Full Version : Can falsh activate some javascript code?


FOOOD
10-04-2001, 04:47 PM
I'm using this screenshakercript (javascript) that basically puts a button on your screen that when pushed makes the whole screen shudder (the toolbars & everything, not just the center part. (looks cool!)

What I want to know is, can a piece of flash animation activate the javascript & make the screen shudder without the person looking at the page having to push the button?

Here's the javascript

2 parts to this script
==============================================
part 1
===============================================
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
netscape = (navigator.appName == "Netscape");
n4 = netscape && (parseInt(navigator.appVersion) >= 4);
explorer = (navigator.appName == "Microsoft Internet Explorer");
ie4 = explorer && (parseInt(navigator.appVersion) >= 4);

function shake(n) {
if (n4 || ie4) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
// End -->
</script>

===========================================================
Part 2
=========================================================
<!-- a1 --><center>
<form>
<input type=button onClick="shake(2)" value="Shake Screen">
</form>
</center><!-- -->



Can I make flash play an animation when the screen loads & activate the javascipt?

Dr. Web
10-04-2001, 06:49 PM
yes, your answers are in actionScript my friend.

www.flashkit.com

for more on actionScript activating javaScript functions.

FOOOD
10-05-2001, 02:03 AM
Great! I'll have a look at this site.

Thanx alot! :D