Hello! :afro:
I’ve seen people use this before with flash websites. I have a flash movie that has an ambient sound building up and then a big beat, on that beat i want the browser window to shake, any body know the AS/Javascript i can put into my movie to achieve this effect?
hmmmm that doesnt work :S what i really want to do is insert some Actionscript into a certain keyframe on my timeline where i want the effect to happen…
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [http://javascript.internet.com](http://javascript.internet.com/) -->
<!-- Modified by Flash kit [http://www.flashkit.com](http://www.flashkit.com/) -->
function shake_xy(n) {
if (self.moveBy) {
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);
}
}
}
}
function shake_x(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(i,0);
self.moveBy(-i,0);
}
}
}
}
function shake_y(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(0,-i);
}
}
}
}
//-->
</SCRIPT>
You can then call this function from any frame of your flash movie :
getURL (“javascript:shake_xy(2)”);