At 09:31 -0400 06/12/2002, Garman 222 Herigstad wrote:
>Thanks for the replies.
>I'm just having trouble understanding the basic correct syntax for:
>
>1) importing a file to the cast
In general you first create a member of the type you want, then
import the file into that member, then set its name. Optionally you
can specify another Cast library than the internal one, but probably
most of the time you will want this internal -- especially if the
files are to be self-contained:
mMem = new ( #bitmap )
-- or
-- mMem = new ( #bitmap, castLib "someOtherCast" )
mMem.importFileInto ( pathToFile )
mMem.name = "someString"
>2) the path name to the external (linked) audio file (Mac and WIN)
That's almost the same, but you set the member's fileName instead:
member(someSoundPlaceHolder).fileName = pathToFile
In the case of both importFileInto and fileName, Director accepts UNC
and relative path notation. So if the file you want is in a folder
named "media" alongside your Director movie, the path would be
something like:
"@/media/theFile"
>3) Positioning the text in the correct location.
#text and #field members do not have their registration ponts
centered. Director assumes the "center" of the member is in fiact the
upper-left corner, not hte visual center of the member as it appears
on the Stage. Thus a #text member that is 200 pixels wide by 200
pixels tall does not have a regPoint of (100, 100); it's still (0,
0). Calculating the actual location of such an item requires
determining the width and height of the member, then offsetting the
locH and V of the item onscreen based on those values:
nHCenter = member(whatever).width / (-2)
nVCenter = member(whatever).height / (-2)
pOffsetPoint = point ( nHCenter, nVCenter )
sprite(yourFieldSprite).loc = theDesiredLoc + pOffsetPoint
>4) Then, most importantly, when I get a very simple script to work, do I
>execute that script in the message window to run it?
That's one way. You can also use buttons, for instance, to activate
the code. You might want to look over my hello sample on nightwares;
it includes relatively minimal steps for script activation.
>on buildScore numberOfFrames
>
> beginRecording
> horizontal = 20
> vertical = 20
> go to frame 1
> sprite(20).member = member "music_1"
> sprite(20).locH = horizontal
> sprite(20).locV = vertical
Actually that won't work because sprite members associated with music
files don't really have much meaning in Director terms. There are
sound channels used for handling audio; sprite channels are more
characteristically reserved for dealing with items that exist
onscreen.
This is why I was advising you to look over Director's actual UI. If
you have an understanding of how the Score, Cast and Stage operate,
you will be able to make files that are "legitimate" as far as
Director is concerned.
Look at this another way. Would you create an HTML generator without
any knowledge whatsoever of how HTML should be written or parsed, but
based only on what you see in browsers and what you've read in some
HTML forum someplace? Or would you, instead, experiment a bit wht
HTML formattng yourself first, perhaps playing about with other HTML
generators, to see how the different tags behave, how they work in
browsers and so on?
It seems to me that generating Director movies from Lingo without
knowing how Director movies are made sans Lingo is a similar thing.
--
Warren Ockrassa | http://www.nightwares.com/
Director help | Free files | Sample chapters | Freelance | Consulting
Author | Director 8.5 Shockwave Studio: A Beginner's Guide
Published by Osborne/McGraw-Hill
http://shop.osborne.com/cgi-bin/osborne/0072195622.html
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]