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--) {
//  -->

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)");
Georgina has more than fifteen years' experience writing and editing for web, print and voice. With a background in marketing and a passion for words, the time Georgina spent with companies like Sausage Software and sitepoint.com cemented her lasting interest in the media, persuasion, and communications culture.

Get your free chapter of Level Up Your Web Apps with Go

Get a free chapter of Level Up Your Web Apps with Go, plus updates and exclusive offers from SitePoint.

No Reader comments

Related books & courses
Available now on SitePoint Premium

Preview for $1