Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Calling Director from Flash?
From: Terry R. Schussler
Date: Sun, 20 Aug 2000 17:26:40 +0100

At 8:38 PM -0700 8/16/00, Jester wrote:
>Would anyone have any examples. I must admit that my knowledge of Director
>is not to exstensive.

Here's an excerpt from http://www.director8.com/ which discusses this topic
extensively:

---

There are three primary methods of sending instructions to a host Director
movie from an embedded SWF.

1) - Implicit Messaging

In this model, you simply put whatever data you want sent to Director into
the URL field of your Get URL command dialog in Flash. Example:

"mainMenu"

What happens is that this causes a "getURL" event message to be sent to
Director (starting at the behavior script level) along with the URL field's
data as an argument variable. Your Lingo would look like:

on getURL me, dataFromFlash
-- do something with the data
-- in this example, we will navigate to the specified frame
-- make sure we really got data
if NOT voidP(dataFromFlash) then
-- make sure we have a valid frame to target
case ilk(dataFromFlash) of
#integer : -- assume a frame number was passed, make sure it exists
if dataFromFlash <= the lastFrame then
go frame dataFromFlash
end if
#string : -- assume a frame marker was passed, make sure it exists
if label(dataFromFlash) <> 0 then
go dataFromFlash
end if
end case
end if
end getURL

2) - Explicit Messaging

In this model, you _preface_ whatever data you want sent to Director in the
URL field of your Get URL command dialog in Flash with the special string
"event:" followed by the name of a specific event message that you want to
issue to Director. Example:

event:jumpToFrame "mainMenu"

What happens is that this causes the "jumpToFrame" event message to be sent
to Director (starting at the behavior script level) along with the URL
field's data as an argument variable. Your Lingo would look like the code
shown above except that the handler name would be "jumpToFrame" instead of
"getURL".

The advantage of this model is that you don't have to treat the "getURL"
handler in Director as a monolithic event manager - you can separate out
the event messages on an as needed basis. I.e. you could more easily
differentiate between a desire to have Director play a sound, navigate to a
frame, show a Director rollover, etc. In my opinion, this is the
*preferred* method for communicating with Director from Flash.

3) - Interpretive Lingo Execution

In this model, you _preface_ whatever data you want sent to Director in the
URL field of your Get URL command dialog in Flash with the special string
"event:" followed by the explicit Lingo instructions you wish Director to
execute. Example:

lingo:go frame "mainMenu"

What happens is that this causes Director's Lingo interpreter to process
and execute the specified Lingo. No event messages are sent to your
Director project.

I don't recommend this method for three reasons:

a) It's very hard to debug. You cannot use the Director Lingo debugger to
single step through the code to determine what's happening. Your Lingo
must be perfect.

b) It's slower to execute. Compiled Lingo executes more quickly than
dynamically interpreted Lingo. If you are making few calls to Director
from Flash, you may not care. If you are making lots of calls to Director,
it will make a difference.

c) It's hard to maintain. If you want to change the Lingo that is actually
executed, you need to search through your Flash project to find the places
where you are using lingo: and change things. We all know how fun that is!
;-P The first two methods enable you to simply use Director's powerful
search mechanisms to find the handler that you are calling from Flash and
quickly rewrite the Lingo code that ultimately gets executed.

---

I hope this information is useful.

Regards,

Terry


--

...---===| Terry R. Schussler |===---...
...---===| DIA Chief Investigator |===---...

on visitWebsite yourSelection
coolSites = [ \
#greatSeminars : "http://www.macromediaseminars.com/", \
#directorIntelligenceAgency: "http://www.director8.com", \
#freeBehaviors : "http://www.behaviors.com/"]
gotoNetPage coolSites.yourSelection
end visitWebsite


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: Calling Director from Flash?, Jordan L. Chilcott
  Re: FLASH: Calling Director from Flash?, Jester

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]