Xtras for Sale
Home (Spotlight) | TOC | Products & Ordering | Technical Info | Contact Zeus


Zeus Tech Note

Lingo that Behaves
Differently in D6 than D5

Copyright © 1997-1998. Zeus Productions. All Rights Reserved.
Written by Bruce A. Epstein
(This page last revised February 15, 1998)

the rect of member

For Xtras, cast members, the registration point used for the rect is the upper left rather than the center of the member, as in D5.

the clickOn

In some circumstances whereas the clickOn returned a sprite's channel in D5, it returns a zero (0) in D6, indicating that only the Stage was clicked.

The difference is due to the different way that D6 judges if a sprite will respond to a mouse event.

In Director 5 , the clickOn would register for a sprite as long as some script was attached. You could use a dummy script with either a single comment line "--", or a script, such as:

on mouseup
--
end

In D6, mouseUp and mouseDown handlers with no contents no longer stop the event, and therefore are not recognized by the clickOn. Either use just a comment with no event handler name, or add some dummy Lingo, such as:
on mouseUp
nothing
end
(This is according to the TechNotes on the Macromedia web site. I couldn't verify the quirk in the first place).


delay

In D5, the delay command would cause the playback head to loop repeatedly in the frame until the delay time had elapsed. In D6, the playback head does not loop, but rather simply waits before continuing to the next frame. Note, in either case, the delay occurs only after all the Lingo commands in the handler are executed, not when the delay command itself is encountered.

The following test frame script will illuminate the difference:

on exitFrame
  put "I'm before the delay command"
  delay 5 * 60
  put "I'm after the delay command
end
new
The new command now recurses. Use the older birth command to avoid this.


soundFadeIn (according to the Director 6.0 ReadMe First file)
In Director 5, sounds all faded from 0 volume up to a volume of 255. In D6, soundFadeIn now fades from 0 volume to the volume of that specific channel, with the volume of sound command.

T simulate the Director 5 behavior, use:
puppetSound <channel#>, 0
set the volume of sound <channel#> = 255
sound fadeIn <channel#>, secs


visible of sprite (according to the Director 6.0 ReadMe First file)
You can turn off a sprite channel's visibility in the Score using the mute checkbox. In D4.x and D5.0.1, this was equivalent to setting the visible of sprite or visibility of sprite property to FALSE.
The sprite became invisible and the sprite did not receive any events (although in Dir 5.0 invisible sprites still received mouse events). Note that in D5, the only events sent to a sprite
channel were mouse-related (see below)

In D6, setting the visibility of a sprite channel to false via Lingo will make the sprite invisible, but prevent ONLY the mouse-related events from being sent to that channel. Other non-mouse events (see below) will continue to be sent regardless of the sprite's visibility setting. Clicking the mute checkbox for a sprite channel in the Score, however, will prevent ALL events
from being sent to that channel (and make the sprite invisible).

Therefore, muting disables a channel entirely, while setting a sprite's visibility to false only affects its visibility and ability to receive mouse-related events.

BeginSprite, EndSprite, Prepareframe, Enterframe, Exitframe
-- Changes with mouse-related events: --
---------------------------------------------------------------------------------------
When the mouse is clicked, the topmost sprite under the cursor (in terms of channel
number) which has a mouse opaque behavior attached to it "eats" the event.
A mouse opaque behavior is a score script which either contains no handlers, or
which contains a handler for mouseUp, mouseDown, rightMouseUp, or rightMouseDown.
This is different behavior than Director 5. In Director 5, the first sprite under the mouse
with ANY script would "eat" the event. To accommodate attaching scripts to sprites
explicitly to create mouse-opaque screen areas, we allow handleless scripts to eat
mouse up/down events.

If a behavior handling a mouseUp/Down event issues a "pass", then the message is NOT
forwarded to the next sprite under the mouse with a mouse opaque handler, but rather to
the sprite's cast member (and then on to the frame script, and then the movie script).
This means multiple sprites will not receive the same mouseUp/Down message automatically.
Of course, it is possible to write lingo code to get around this.




-- Disabled lingo: --
---------------------------------------------------------------------------------------
The updateStage and go commands are disabled when called from any of the following
handlers: prepareMovie, prepareFrame, beginSprite, endSprite, stepFrame. The
preferred place to use a go command is within an exitframe handler. Executing go
from within any of these other handlers can cause infinite recursion in the worst case,
and bad event ordering in the best case. Executing updateStage can also cause problems,
and should not be necessary since all these events are issued immediately before the
current frame is drawn. Therefore, both these commands have been disabled within
these handlers.


-- Extra Sprite Events --
---------------------------------------------------------------------------------------
In a nonlooped movie that does not use go frame to loop, in the last frame, there are
extra events before the endsprite message.

Single Frame movie: extra prepareFrame and enterFrame

Two Frames or more: extra enterFrame (w/o prepareFrame)


-- Net Lingo --
---------------------------------------------------------------------------------------
The downloadNetThing lingo command is not available in Shockwave.

If getNetText() is used to call a javascript function and the function does not return a
value, Director 5 Shockwave returns netError() "OK" and netTextResult() null. Director 6
Shockwave returns an error from netError().

Use forward slashes as delimiters in urls sent to gotoNetPage. GotoNetPage with system
delimiters (":" or "\") in the url (e.g., "file:///harddrive:file.html" or "file:///C:\file.html")
will successfully put the html file in a browser window but any movies embedded on that page
won't draw until refreshed (Netscape only).


-- optionDown --
---------------------------------------------------------------------------------------
The Alt key in combination with certain other keys has reserved functionality on Windows
machines. This means that certain key combination testing with the optionDown will not work.
It is recommend that you use the controlDown and the shiftDown for cross-platform
consistency.


-- Property values set through lingo sticking or not sticking unexpectedly: --
--------------------------------------------------------------------------------------
Sprites now have a duration as specified in the (new) score view. When lingo modifies
any of the puppetable properties of a sprite ( cast member, loch, locv, loc, width,
height, rect, ink, foreColor, backColor, blend, visible) that property will be autopuppeted
for the duration of the sprite (i.e. the value set will stick for the duration of that sprite
despite any values recorded in the score). This can cause existing lingo which relied
on setting the property of a sprite without the use of puppeting to behave differently.
Calling "puppetSprite <spritenum> false" will clear any currently autopuppeted properties.
Autopuppeting is disabled in the shockwave plugin whenever the movie being played is of
pre-Director 6 vintage.

If the "allow outdated lingo" option was set for a movie in Director 5, the moveable and
editable properties of a sprite were not puppetable. They are now.


-- The Truth about Puppeting: --
---------------------------------------------------------------------------------------
When a channel has its puppet setting set to false after having been set to true, the sprite
in that channel does not immediately revert to the scored values for that frame. It will
retain its current settings until either a) the score affects a change to that property value,
or b) a go command is executed. This has been true since puppeting was introduced. It is
perhaps more obvious now with the introduction of autopuppeting. For example, if two
sprites abut each other in the score, and both share the same loch value throughout their
scored lives, then there is no recorded change in the loch value in the score at the point
of transition from the first sprite to the second sprite. If the first sprite sets its
loch via a behavior during its lifetime, then even when that property becomes unpuppeted
at the end of the first sprite's span, the previously puppeted value will stick for the
next sprite.


-- Unexpected handler evaluation: --
---------------------------------------------------------------------------------------
Score scripts used in the graphics channels now receive exitframe and enterframe messages.
In addition, all score scripts are now instanced and thus receive a "new" message. If you are
finding scripts executing unexpectedly, then it is recommended that you check your score for
scripts containing handlers for "new", "exitframe", and/or "enterframe". These handlers
would not have been called when playing in Director 5, but will be called when playing in
Director 6.

The shockwave plugin will prevent exitframe and enterframe messages from being sent to the
graphics channels if the movie being played is of pre-version 6 format. It cannot prevent
"new" from being sent, however.


-- Using a new handler in a score script: --
---------------------------------------------------------------------------------------
If a behavior defines both a new and a beginSprite handler, the new handler will be called
first, then the property values will be assigned, and then beginSprite handler will be
called. If a score script is going to be used as both a sprite behavior AND instanced
explicitly via the new handler, then the script should declare a property called
spriteNum, and have the new handler set it appropriately. The spriteNum property is
declared and initialized automatically for you when an instance of the script is created
for a behavior, but not if you explicitly call new yourself. Example:

property SpriteNum

on new me, channelNum
set the spriteNum of me = channelnum
return me
end


The Tempo Channel no Longer Locks out Interactivity

The do command can use global globals, and also declare globals in compound statements

Searches in property lists are no longer case-sensitive




Home (Spotlight) | Table of Contents | Links | Contact Info

Place an Order | Products for Sale | Licensing | Downloads

TechNotes | FAQs | E-Mail Zeus | GuestBook | Glossary

[End of Page]

Copyright © 1996-1998. Zeus Productions. All Rights Reserved.