Using Director > Using Interactive Media Types > Sending Lingo from Flash movies

 

Sending Lingo from Flash movies

A Flash 3 or 4 movie can send Lingo instructions to a Director movie. (Flash 2 movies do not support this feature.) The Lingo determines how the movie responds when the user clicks a button or the Flash movie enters a frame. In Flash, you can send a string to Lingo with a Flash on getURL handler. The string can be an event message or a complete Lingo statement.

In Flash, you create a button or frame and then assign it a Get URL action in which you specify the Lingo that the Flash cast member sends. To see an animated demonstration, see the Flash events movie.

To set up a Flash movie to generate an event:

1

In Flash, select a button.

2

Choose Modify > Instance. In the Instance Properties dialog box, click the Actions tab and select Get URL from the Action menu.

Do not specify anything for the Target Window option. (Director ignores this field.)

3

In the URL field, enter the Lingo that you want Flash to send to the movie.

To specify a string to pass to an on getURL handler in the Director movie, enter the string. In Director, include an on getURL handler that receives the string from the Flash movie and reads the string as a parameter.

For example, in Flash, you can specify this in the Network URL field:

Dali

In Director, you can write this handler:

on getURL me stringFromFlash
	go to frame stringFromFlash
end

When the on getURL handler receives the text string, it reads the string and then jumps to the frame labeled Dali in the Director Score.

To specify an event message, specify the word event followed by a colon, the name of a handler you will write in Director, and a parameter (if any) to pass along with the event.

For example, in Flash, you can specify this in the Network URL field:

event: FlashMouseUp "Dali"

In Director, you write this handler:

on FlashMouseUp me whichFrame
	go to frame whichFrame
end

When the Director script receives the FlashMouseUp message and the parameter, the movie jumps to the frame specified by the parameter.

To specify a Lingo statement, specify the word lingo, followed by a colon, followed by the Lingo statement that you want Director to execute.

For example, in Flash, you can specify this in the Network URL field:

lingo: go to frame "Dali"

When Director receives the getURL message from the Flash movie, the movie immediately executes the Lingo statement.

You can place handlers to capture events from Flash movies in a Flash sprite or cast member script or in a frame or movie script. The event follows the normal Director message hierarchy.