Article

Home » Design and Layout » Flash Tutorials » Flash Script - Shaking Window Effect

About the Author

SitePoint

View all articles by SitePoint...

Flash Script - Shaking Window Effect

By SitePoint

April 28th, 2003

Reader Rating: 6

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)");
 }

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: