Flash movies can communicate with each other and with the html page.
We will start with a ball the moves back and forth.

Get Adobe Flash playerStart a new movie and make a movie clip of a ball. Name the instance ball. Write the code as shown below:

var speed:int=1;
if("speed" in stage.loaderInfo.parameters) {
function frames(e:Event):void {
	if(ball.x>stage.stageWidth-ball.width || ball.x<0)  {
The code says to look for a parameter on the html page called "speed" and assign it as the value for the variable speed.
At this point we haven't added parameters to the page and the the speed is 1.

Experiment: Download the movie

NEXT: Publish the movie