Flash Script – Shaking Window Effect

By Georgina Laidlaw
We teamed up with SiteGround
To bring you up to 65% off web hosting, plus free access to the entire SitePoint Premium library (worth $99). Get SiteGround + SitePoint Premium Now

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)");
 }
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
We teamed up with SiteGround
To bring you up to 65% off web hosting, plus free access to the entire SitePoint Premium library (worth $99). Get SiteGround + SitePoint Premium Now
Login or Create Account to Comment
Login Create Account