Flash Script – Shaking Window Effect

type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/shake.swf'
width = '400'
height = '400'
bgcolor = 'black'
>

Copy the script from here and then paste it in to the head of the HTML document that contains your Flash movie.

<script type="text/javascript"> 
<!--  
function shake(n) {
if (parent.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
        }
     }
  }
}
//  -->
</script>

To create the flash movie,

1. Open a new flash movie.
2. Create a button in flash, right click on it, and insert the actions below:

  on (press) 
 {
 getURL ("javascript:shake(5)");
 }

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments

Comments on this post are closed.