Creating Flash movies that send events to Authorware

A Flash movie can generate events that an event response can capture and respond to while an Authorware piece is running. In Flash, you set up a movie to generate an event by creating either:

| A button that is assigned a Get URL action
| A frame that is assigned a Get URL action

For example, after creating and selecting a button in Flash, you can assign the button an action by choosing Modify > Element. In the Button Link Properties dialog box, select Get URL from the Action menu.

Don't specify anything for the Target Window option (Authorware ignores that field). What you type in the Network URL field determines how Authorware responds to the button or frame action. There are two ways to fill in the Network URL field:

| Specify any string to pass to Authorware. In Authorware, you set up an event response to capture the event from the Flash movie and read the string as a parameter. Let's say, in Flash, you specify this in the Network URL field:
    Dali.html
| In Authorware, you set up a Flash Player Movie icon named Surrealists. Following it on the flowline, you set up an event response. In the Event Response Properties dialog box, you choose Icon Surrealists as the sender and getURL as the event name. When a user clicks the button you've assigned `Dali` to, the event that the Flash movie generates looks like this:

    #__Sender:8,217,996, #__SenderXtraName:"Xtra Shockwave Flash Movie",
    #__SenderIconId:65,543, #__EventName:#getURL, #__NumArgs:1,
    #arg0:"Dali.html"

| To read the string, use a statement like this in the calculation icon attached to the event response:
    ButtonString := EventLastMatched[#arg0]
| You could then use `GoToNetPage` to go to the HTML page using a statement like this:
    GoToNetPage(ButtonString)
| Specify the word `event` followed by a colon, the name you want to give the event, and a parameter (if any) you will pass along with the event. Let's say, in Flash, you specify this in the Network URL field:
    event: FlashMouseUp Dali.html
| In Authorware, you once again set up a Flash Player Movie icon named Surrealists and an event response after it on the flowline. In the Event Response Properties dialog box, you choose Icon Surrealists as the sender and event as the event name. When a user clicks the button you've assigned `Dali` to, the event that the Flash movie generates looks like this:

    #__Sender:8,217,996, #__SenderXtraName:"Xtra Shockwave Flash Movie",
    #__SenderIconId:65,543, #__EventName:#event, #__NumArgs:2,
    #arg0:FlashMouseUp, #arg1:"Dali.html"

| To read the name you've given the event, use a statement like this in the calculation icon attached to the event response:
    ButtonEventName := EventLastMatched[#arg0]
| To read the string, use a statement like this:
    ButtonString := EventLastMatched[#arg1]
If a Flash movie generates both `getURL` events and `event:` events, use this statement to determine which type the movie has been generated:
    ButtonEventType := EventLastMatched[#__EventName]
The variable `ButtonEventType` will contain either `#getURL` or `#event`. In Authorware, you can set up a routine to act upon the different types of events. For example, in a Flash movie, you might assign the following three actions to three buttons.
    homePage.htm
    event: Eval x>y
    event: EvalAssign x=5
Then, in Authorware, you could use the following routine to act upon the strings sent from the Flash movie.
    ButtonEvent := EventLastMatched[#__EventName]
    if ButtonEvent = #getURL then
    	URL := EventLastMatched[#arg0]
    	GoToNetPage(URL)
    else if ButtonEvent = #event then
    	Event = EventLastMatched[#arg0]
    	if Event = "Eval"
    		Eval(EventLastMatched[#arg1])
    	else if Event = "EvalAssign"
    		EvalAssign(EventLastMacthed[#arg1])
    	end if
    end if