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

Download the sample files here.

Note that in this tutorial, I’ll assume that you know how to create a button.

1. Create two buttons, one labelled "Load movie1", the other labelled "LoadMovie2".

2. Create a new blank movie clip — a clip with no objects in it.

3. Give this new blank movie clip an instance name of "dummy".

4. Right click the "load movie1" button, select "actions", and insert the following:

on (release) 
loadMovie ("mov1.swf", "/dummy");

This code loads the swf file called mov1.swf into target "/dummy". You can replace this reference with on to you own swf file, which should be located in the same directory.

5. Right click the "load movie2" button, select "actions", and insert this action:

on (release) 
loadMovie ("mov2.swf", "/dummy");

Press ctrl+enter to test the movie.

The load movie syntax is:

loadMovie(url [,location/target, variables]]);

url: the path of the file.


location: an optional argument that specifies the level into which the movie is loaded.

The loaded movie inherits the position, rotation, and scale properties of the targeted movie clip.

variables: an optional argument that specifies a method for sending variables associated with the movie to load.

The argument must be the string "GET" or "POST." Omit these if there are no arguments.

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