Main Page About Ldoc+ Error Lists Main Index Index Groups

Ldoc+ Lingo Group:
    SPRITEs

 info D5/601:
      puppet of sprite
      trails of sprite
      spriteP()
 6    MANY elements new in Director 6.0,
  !   MANY contain Dictionary fixes 601 & 501,
   +  MANY miss from the 'Appendix' 6.0 for SPRITES.


General Sprite Properties (19):
  !   blend              of sprite
      castLibNum         of sprite
  !   constraint         of sprite
  !   cursor             of sprite
  !   editable           of sprite  (#field)
  !   ink                of sprite
  !+  member             of sprite
  !   memberNum          of sprite
  !   moveableSprite     of sprite
  !+  puppet             of sprite
  !   puppetSprite
  !+  scoreColor         of sprite
 6 +  scriptInstanceList of sprite
      scriptNum          of sprite
x6    stretch            of sprite  (outdated -> rect of sprite)
  !+  trails             of sprite
 6 +  tweened            of sprite  (score recording)
      type               of sprite  (only 0)
  !   visible            of sprite

Sprite Screen Locations (14):
  !   loc    of sprite
  !   locH   of sprite
  !   locV   of sprite
  !   rect   of sprite
      left   of sprite
  !+  top    of sprite
   +  right  of sprite
   +  bottom of sprite
  !   height of sprite
  !   width  of sprite
   +  height   of member
  !+  rect     of member
   +  regPoint of member
   +  width    of member

Button Sprite Properties (6):
  !   backColor         of sprite  (#button, #bitmap, #shape)
  !   foreColor         of sprite  (#button, #bitmap, #shape)
   +  enabled           of sprite  (#button, #btned)
 6 +  behavesLikeToggle of sprite  (#btned)
 6 +  isToggle          of sprite  (#btned)
 6 +  tracking          of sprite  (#btned)

#digitalVideo Sprite Properties (6):
      currentTime of sprite (also #SWA)
      movieRate   of sprite
      movieTime   of sprite
      startTime   of sprite
      stopTime    of sprite
      volume      of sprite (also #SWA)
      ...see also the Video Sprite Functions.

#shape Sprite Properties (4):
  !   backColor of sprite  (also #button, #bitmap)
  !   foreColor of sprite  (also #button, #bitmap)
   +  lineSize  of sprite

Sprite Functions (16):
   +  clickOn
      constrainH(sprite)
      constrainV(sprite)
 6!+  currentSpriteNum
   +  mouseChar
   +  mouseItem
   +  mouseLine
 6 +  mouseMember
   +  mouseWord
      rollover(sprite) = the rollOver
      sprite channelNumber
      sprite...intersects
  !   sprite...within
 6 +  the spriteNum of me (behaviors)
   +  updateLock (settable)
      updateStage (sends 'stepFrame')

--

Sprite Script Events (19):
 6    on beginSprite    [me]
 6 +  on cuePassed      [me]
 6    on endSprite      [me]
  !+  on enterFrame     [me]
   +  on exitFrame      [me]
   +  on keyDown        [me]
   +  on keyUp          [me]
   +  on mouseDown      [me]
  !+  on mouseUp        [me]
   +  on rightMouseDown [me]
   +  on rightMouseUp   [me]
 6 +  on mouseUpOutside [me]
 6 +  on mouseEnter     [me]
 6 +  on mouseWithIn    [me]
 6 +  on mouseLeave     [me]
 6 +  on prepareFrame   [me]
 6 +  scriptInstanceList of sprite
 6 +  sendAllSprites(#handlerName)
 6 +  sendSprite(#handlerName)

--

601 Lingo for SPRITES:
Sprite scripts now receive the 'me' parameter.
More sprite events like 'beginSprite', 'endSprite',
'enterFrame', 'exitFrame', 'mouseEnter', etc.
New behavior concept includes auto-puppeting.
Remember: ALL sprite settings need a stage update,
except 'visible of sprite' and 'cursor of sprite'!

6.0 'Appendix' errors for DATA TYPES:
Many elements are missing, see (+) above.
The mentioned 'paletteRef [of member]' is not for sprites!

Outdated SPRITE Lingo (4):
 5             cast of sprite -> member of sprite
 6          castNum of sprite -> member/memberNum of sprite
 6          stretch of sprite -> rect of sprite
 6                  spriteBox -> rect of sprite





[index] _ D5/601 _ 971208:


backColor of sprite

1-bit, shape and button sprite property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'backColor of sprite' needs a stage update."

"An 8-bit bitmap is affected..."
= Should read:
"An 8-bit, 16-bit, or 32-bit bitmap is affected..."

"...value ranges from...8-bit...4-bit..."
= Misses:
"In higher color depth, the color value and position
 still depends on the movie's default palette."

...I'd suggest using the value of another shape sprite's
   'foreColor' whenever setting shape colors in any colorDepth.

"put the backColor of sprite 5 into oldColor"
= Outdated! Example 1 should read:
"set oldColor = the backColor of sprite 5"
 --

"The sprite must be a puppet before you can
 set its background color using Lingo."
= The 5.0 Dictionary should read:
"Puppet the sprite for the value set by Lingo to persist."
 In 6.0, this is only necessary to last beyond a sprite's span.
 --

1. TIP: You can temporarily set the 'backColor of sprite' inside a Lingo handler without puppetizing the sprite, but you need a stage update to make the change visible (opposed to changing the 'backColor of MEMBER'). In 6.0, because auto-puppeting keeps the new setting across the sprite's life span, remember to change back to old setting if wanted.

2. TIP: In 16-bit and higher color depth, FIELD MEMBERS display in thousands or in RGB colors, whereas 'the backColor of SPRITE' is ALWAYS dependant on some kind of current palette, which is either the movie's own palette or the default Mac or Win System palette.

3. TIP: For a problem with shapes in 16-bit, please see 'foreColor of sprite'. For more about color values in different colorDepth, see Color Values PropList.






[index] _ D5/601 _ 971208:


blend of sprite

sprite display property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'blend of sprite' needs a stage update."

"The blend ink effect must be applied to the sprite..."
= Should read:
"For shapes, 1-bit bitmaps, and not-directToStage videos,
 the Blend ink effect (ink number 32) must be applied...
 Videos set to 'direcToStage' and film loops cannot blend
 at all. Button sprites will only blend their text."

...for bitmaps with a higher than 1-bit depth, any ink effect
   can be active when the 'blend of sprite' is changed,
   but except for Background transparent (ink number 36),
   their typical ink effect will vanish.

"Blend values can be from 0 to 100..."
= Should read:
"Blend values can be from 0 to 100, but in steps of mostly 2 at
 a time, which gives you 56 possible blend values..."
 --

From the '601 ReadMe':
  Fixed problem where sprite blend can automatically get set to
  the value 0 when working in the score.
  --

1. TIP: The default value for the 'blend of sprite' is 100, unless it's changed in the Sprite Properties dialog box. Note: In 501, when using the 'Restore' function from the Sprite Properties dialog box on selected multiple sprites, the sprites will take on the 'blend' value from the first sprite in the selection, or even the value 0! This seems to persist in 6.0.

2. TIP: Director calculates the 'blend' effect for the color of each pixel from the currently active palette, regardless of the monitor's color depth, so mostly the desired effect is limited to a very individual 'blend' value for each sprite. You can have an 'in-between special' for blending sprites across 56 frames, increasing from 0 to 100, and then pick the 'blend' value(s) from the frame(s) in which the sprite looks best. That's what they call 'authoring'... ;-)

3. TIP: The calculation of blended sprites is time consuming, especially for big sprites, and even more on Windows.

4. TIP: If you 'set the blend of sprite x = 0', the sprite will be ALMOST invisible, but possibly NOT quite: Depending on the graphics/colors underneath the nearly invisible sprite, and depending on the colorDepth, you might get a hazzy effect in the bounding box area of that sprite.

5. TIP: Director's steps for the blend value are 2 at a time, with the following exceptions: 0,1...9,10 ... 20,21...29,30 ...40,41... 49,50...60,61 ...69,70... 80,81...89,90...100. If your blend value is not accurate, Director will increase it by 1. You can use the following trick to get the missing 45 blend values: If your blend value is more than 100, Director will cut the value to (value mod 100), and 101 will become 1, 102 will became 2, 103 = 3, 104 = 4, etc. Although the difference in steps of 1 is not guaranteed to be visible... ;-)

6. TIP: The effect of different 'blend of sprite' values seems to vary depending on different color resolutions of the monitor, so be sure to test your blendings in different colorDepth, and also cross-platform. For Shockwave files, different browsers seem to handle 'blend' and also 'ink' effects differently on each platform and in different colorDepth. And I seem to remember that one of my blend creations didn't satisfy me when I saw it in a projector on that thing called Windows, in many, really many colors... ;-)






[index] _ D5/601 _ 971208:


constraint of sprite

sprite location property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'constraint of sprite' needs a stage update."

"...is turned on, the sprite...is constrained..."
= Should read:
"...is turned on, the 'loc of sprite'...is constrained..."
...the 'loc of sprite' (and locH, locV) is determined by
   the 'regPoint' of its member!

= Missing:
"See Also: ... loc of sprite ..."
 --






[index] _ D5/601 _ 971208:


currentSpriteNum

sprite event property (new in 6.0)

6.0 Dictionary Errors:

"...whether the...event was passed to the sprite level..."
= Should read:
"...whether the...event was passed to the CAST SCRIPT level..."

'set the member of sprite the currentSpriteNum = member DownPict" '
= The Example misses quotes; should read:
'set the member of sprite the currentSpriteNum = member "DownPict" '

= Missing:
"See Also: spriteNum of me, the clickOn"
 --

From 'Macromedia Director Corrections':
  This property can be tested, BUT NOT SET.
  --






[index] _ D5/601 _ 971208:


foreColor of sprite

1-bit and shape sprite property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'backColor of sprite' needs a stage update.
 Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."

"An 8-bit, 16-bit, or 24-bit bitmap is affected..."
= Should read:
"An 8-bit, 16-bit, or 32-bit bitmap is affected..."

"...value ranges from...8-bit...4-bit..."
= Misses:
"In higher color depth, the color value and position
 still depends on the movie's default palette."

...I'd suggest using the value of another shape sprite's
   'foreColor' whenever setting shape colors in any colorDepth.

"The following statement...of a random sprite from sprite 11 to..."
= Example 2 should read:
"The following statement...of a random sprite BETWEEN sprite 11 and..."

"set the backColor of sprite..."
= Example 2 misses the topic; should read:
"set the FOREColor of sprite..."

= Missing:
"See Also: backColor of sprite, the stageColor"
 --

"...in order to set it with Lingo the sprite must be a puppet."
= The 5.0 Dictionary should read:
"For the new setting to persist, the sprite must be a puppet
 before you change its foreground color using Lingo."
 In 6.0, this is only necessary to last beyond a sprite's span.
 --

1. TIP: You can temporarily set the 'foreColor of sprite' inside a Lingo handler without puppetizing the sprite, but you need a stage update to make the change visible (opposed to changing the 'foreColor of MEMBER'). In 6.0, because auto-puppeting keeps the new setting across the sprite's life span, remember to change back to old setting if wanted.

2. TIP: In 16-bit and higher color depth, FIELD MEMBERS display in thousands or in RGB colors, whereas 'the foreColor of SPRITE' is ALWAYS dependant on some kind of current palette, which is either the movie's own palette or the default Mac or Win System palette.

3. TIP: In 16-bit color resolution, shapes seem to be remapped to the movie's default palette, and not to any custom palette in use. Tyson Norris from Macromedia Tech Support recommends:
"So ultimately, you'll want to do one of the following:
(a) always run in 8 bit color on the playback system
(b) install the custom palette as your movie's default palette (only would work if you're using a single custom palette)
(c) test the colorDepth, and set the 'forecolor of sprite' property of the sprite according to the appropriate palette."

4. TIP: For more about color values in different colorDepth, see Color Values PropList.






[index] _ D5/601 _ 971208:


height of sprite

sprite size property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'height of sprite' needs a stage update."

"...applies only to bitmap and shape cast members."
= Should read:
"...applies to ALL sprites, but can only be set reliably
    for bitmap (with 'stretch of sprite') and shape SPRITES."

= Missing:
"See Also: ... rect of sprite ..."
 --

TIP: From William Donelson 11/97: Watch out for 'the height of sprite x'; it will give you the authored height from the score, not the current height if the 'member of sprite' has been changed by Lingo. Instead, use 'the height of the rect of sprite x'. Same applies to the 'width of sprite'.






[index] _ D5/601 _ 971208:


ink of sprite

sprite color effect property

6.0 Dictionary Errors, partly the same in 5.0:

"To change any sprite properties using Lingo,
 the sprite must be a puppet."
= Should read:
"Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."

"put the ink of sprite 3 into currentInk"
= Outdated and wrong! Example 1 should read:
"set currentInk = the ink of sprite (i + 1)"
 --

From the '601 ReadMe':
  When you drag a sprite to the stage, it now uses
  the ink of the last sprite dragged to the stage.
  --

1. TIP: If you want to set the 'blend of sprite', remember that shapes, buttons and 1-bit sprites need to be set to Blend ink effect as well (ink number 32) to display a blending effect; for bitmaps you can use any 'ink of sprite' value together with any 'blend of sprite' value, but except for Background transparent (ink number 36), the typical ink effect will vanish.

2. TIP: Remember if you use the Matte ink effect (ink number 8):
(a) For calculation purposes, Director has to create a mask in memory for a sprite that uses Matte ink, which means that the size of the sprite's castMember is doubled in memory.
(b) The calculation of Matte ink sprites is time consuming, especially for big sprites, and even more on Windows.
(c) On Windows, if memory is low, Director will first stop to calculate the effect of Matte ink sprites, and will display them in their bounding (white) boxes like it does with the Copy ink effect. When this happens, you will have to implement some unloading techniques into your movie(s).
(d) The 'rollover()' reacts to the whole bounding box of a Matte ink sprite, 'the mouseCast' and 'the mouseMember' (6.0) only to its pixels. But possibly in 501 and 601, 'if rollover(x) then..' will only test the matte shape of a sprite, at least I have experienced that.






[index] _ D5/601 _ 971208:


loc of sprite

sprite regPoint location property

6.0 Dictionary Error, same in 5.0:

= Missing:
"Changing the 'loc of sprite' needs a stage update.
 Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."
 --

"...determines the stage coordinates of the specified sprite."
= The 5.0 Dictionary should read:
"...determines the stage coordinates of THE REGISTRATION POINT
    OF THE MEMBER of the specified sprite on stage, relative
    to the upper left corner of the stage (0,0)."
    The 'stage coordinates' are given in the 'rect of sprite'!
    --

1. TIP: The 2 values of the 'loc of sprite' point are identical to the 'locH of sprite' and 'locV of sprite'. You can also use 'the locH of (the loc of sprite)' and 'the locV of (the loc of sprite)' (see 'point()').

2. TIP: Remember: The default registration points of members are different for different types of members. For bitmaps you can set their regPoint point manually in Director's Paint window, but buttons, shapes, fields, and richTexts all have their 'regPoint' at 0,0 in their left top corner by default; picts, video, linked and imported members have their 'regPoint' in their center by default.






[index] _ D5/601 _ 971208:


locH of sprite

sprite regPoint location property

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'locH of sprite' needs a stage update."

"...is to the right of the right edge of the monitor..."
= Example 1 should read:
"...is beyond the right edge of the STAGE..."

"...and moves the sprite's right edge..."
= Example 1 should read:
"...and moves the sprite's horizontal REGISTRATION POINT..."

"...at the same horizontal location as the mouse click: ..."
= Example 2 should read:
"...at the same horizontal location as the mouse IS: ..."

= Missing:
"See Also: ... loc of sprite ..."
 --

TIP: See 'loc of sprite' for more info.






[index] _ D5/601 _ 971208:


locV of sprite

sprite regPoint location property

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'locV of sprite' needs a stage update."

"...and moves the sprite's bottom edge..."
= Example 1 should read:
"...and moves the sprite's vertical REGISTRATION POINT..."

"...at the same vertical location as the mouse click: ..."
= Example 2 should read:
"...at the same vertical location as the mouse IS: ..."

= Missing:
"See Also: ... loc of sprite ..."
 --

TIP: See 'loc of sprite' for more info.






[index] _ D5/601 _ 971208:


member of sprite

sprite castMember property

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'member of sprite' needs a stage update.
 Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."

"...specifies a sprite's cast member and cast."
= Should read:
"...DETERMINES a sprite's cast member and CASTLIB."

"...differs from 'mouseMember'..."
= Delete that part! The 'mouseMember' returns a member
  expression: '(member x of castLib y)', which is absolutely
  identical to the 'member of sprite' expression, or 'Void'
  if no castMember is under the mouse!

"The unique integer that includes all cast libraries...'mouseMember'"
= Delete anything mentioning 'mouseMember' (see above)!

"To specify a cast member by number only when there are
 multiple casts, use the 'memberNum'..."
= What a mess! Better forget this whole lot...

"You can determine the 'memberNum'...from the 'member'..."
= Wrong again, delete it! The 'number of member' is the
  "unique integer that includes all cast libraries".

"...shows a way to use the global numeric identifier from
    the 'mouseMember' function..."
= Wrong again, delete this part from Example 2 and 3!

"...by converting the 'mouseMember'...into...cast name:"
= Wrong again, delete this messy part from Example 3!
  Also the converting would NOT give the 'name of castLib'!

"else set newInk to copyInk .. end if"
= Delete that 'end if' from Example 3!
  --

From the old '501 ReadMe':
  This sprite property is missing from the docs:
  'the member of sprite' indicates in one expression
  both the member's castLib-internal number and the
  number of the castLib that member is in, example:
  '(member 205 of castLib 3)'.
  --

1. TIP: You must NOT mix the two properties 'member of sprite' and 'memberNum of sprite': The 'member of sprite' is an expression like '(member 101 of castLib 2)', whereas the 'memberNum of sprite' only indicates the castLib-internal number of a member like '101', and if you want to change to a 'memberNum' from a different castLib, then you also have to set the 'castLibNum of sprite' accordingly. See Macromedia TechNotes TN#3184 'Member vs. Membernum' and TN#3187 'Director 5 and the mouseCast'.

2. TIP: You CANNOT do math on the expression 'member': If you do something like 'set x = (member 122) + 1', you get 0 as the result. You have to use the expression 'the number of member', like in 'set x = (the number of member 122) + 1'.

3. TIP: If you want to check if a member is in slot x of a 'castLib', or if a member by the name of 'myMember' exists, then test 'the type of member whichcastMember': It will return #empty if there is no member for the given name or number. But only if the castMember slot in question is before the last castMember in the last castLib, otherwise you'll get an alert 'Script error: Error'.

4. TIP: You can test and set the outdated 'castNum of sprite'; it returns the overall number of the sprite's castMember, which is 'the number of member x', like '196813', or 0 for an empty sprite channel. The 'castNum of sprite x' is a composite of the sprite's castLib-internal 'memberNum' and the number of the castLib it's in: (65536 * the castLib number) + (the member number), example: 262145 is the number of member 1 in castLib 4. If the member is in castLib 1 (internal), its number will be the true number in that castLib (ie 1 to 32,000).

--

EXAMPLEs:

set the member of sprite 9 = member "MyField"
updateStage

put member "MyField"
-- (member 205  of castLib 3)

put the member of sprite 9
-- (member 205  of castLib 3)
put the memberNum of sprite 9
-- 205
put the castNum of sprite 9
-- 196813
put the number of member "MyField"
-- 196813
put the name of (the member of sprite 9)
-- "MyField"

put the castLibNum of sprite 9
-- 3
put the name of castLib (the castLibNum of sprite 9)
-- "my3rdCastLib"
put the number of castLib "my3rdCastLib"
-- 3
put (string(member "MyField") contains "castLib 3")
-- 1





[index] _ D5/601 _ 971208:


memberNum of sprite

sprite castMember property

From 'Macromedia Director Corrections':
  The description for Example 1 and 2 should state that
  castMembers being assigned are in the same castLib
  as the sprite's current castMember.
  --

From the old '501 ReadMe':
  The 'memberNum of sprite' property only indicates the
  sprite member's castLib-internal number (ie 1 to 32,000);
  it does NOT refer to its castLib number. When you want
  to set the 'memberNum of sprite' to a member from
  a different castLib, you need to adjust the 'castLibNum
  of sprite' to avoid a destruction of castLib links.
  --

TIP: See 'member of sprite' for important info and EXAMPLEs.






[index] _ D5/601 _ 971208:


moveableSprite of sprite

sprite controlling command

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'moveableSprite of sprite' needs a stage
 update. Puppet only for the value set by Lingo to last
 beyond the current sprite's life span."

"When the sprite...'the moveableSprite of sprite' is TRUE."
= The sentences in both bullets should be turned around:
"When the 'moveableSprite of sprite' is set to TRUE,
 the sprite can be moved by the user" etc.

"Setting 'the moveableSprite of sprite'...whether sprites
 are moveable from other scripts."
= Makes no sense; delete this part! Any script can move any
  sprite by changing its 'loc of sprite'!

"...a puppet and then makes sprites in that channel moveable:.."
= Needs NO puppet, and does NOT account for multiple sprites:
"...makes THE sprite in that channel moveable: ..."

From 'Macromedia Director Corrections':
  Delete any references to the movie "Mechanical Simulation"!
  --

From the '6.0 ReadMe':
  If  the "Allow Outdated Lingo" option was set for a movie
  in Director 5, the 'moveableSprite of sprite' and the
  'editable of sprite' were not puppetable. They are now.
  --






[index] _ D5/601 _ 971208:


puppet of sprite

sprite controlling property

6.0 Dictionary Errors:

"...setting...'puppet of sprite' property to FALSE
 resets the sprite's properties to those set in the score."
= Misses info:
"...setting...'puppet of sprite' property to FALSE, followed
 by a 'go to the frame' command, resets the sprite's
 properties to those set in the score."

"put the puppet of sprite 5 into isPuppet"
= Outdated! Example 2 should read:
"set isPuppet = the puppet of sprite 5"

= Missing from the "See Also":
  all things mentioned in the "See Also" at 'puppetSprite'!
  --

From the '6.0 ReadMe':
  Sprites now have a duration as specified in the (new) score view.
  When lingo modifies any of the sprite properties that property
  will be auto-puppeted, 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 'puppet' to behave differently.
  Calling 'puppetSprite spriteNumber, FALSE' will also clear any
  currently auto-puppeted properties.

  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 to...' command is executed (just 'updateStage' won't do).
  This has been true since puppeting was introduced. It is perhaps
  more obvious now with the introduction of autopuppeting.
  See the example in the '6.0 ReadMe'...
  --
  Auto-puppeting 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 'moveableSprite of sprite' and the
  'editable of sprite' were not puppetable. They are now.
  --

1. TIP: Director 2.0 - 601: To 'set the puppet of sprite x = FALSE' or 'puppetSprite x, FALSE', you definitely need a 'go someFrame' following the command to get rid of the 'puppet', because the 'puppet' will stick to the sprite across multiple 'updateStage' commands, and even across a moving playback head, until a 'go someFrame' occurs. Remember: When the 'puppetSprite' is turned off, the movie will show the given sprite member from that channel in that frame, or nothing if that sprite channel is empty (but which also means that you cannot use that sprite channel for puppeting again at that point). If you want to turn off a 'puppetSprite' at any point in your movie, you need to have the appropriate default sprite member(s) sitting in that channel throughout the whole score, ready to take over from the before puppetized (and changed) sprite.

2. TIP: To 'set the puppet of sprite x = TRUE' or 'puppetSprite x, TRUE', you do NOT need an additional stage update, unless you immediately want to change some settings for the puppetized sprite and have them shown on stage while your handler is still executing. The moving of the playback head or a 'go someFrame' will take into calculation anyway that the sprite has its 'puppet' set to TRUE. Only if your movie sits still in a 'pause' (outdated in 6.0), you need to get the stage updated yourself.

3. TIP: You do NOT need a 'puppet' when setting the two properties the 'cursor of sprite' and the 'visible of sprite', because these stick to the sprite by themselves (which also means that you have to turn them off by yourself; an invisible sprite channel will not turn itself back on during author-mode).

4. TIP: You do NOT need a 'puppet' when temporarily making changes to a sprite inside your Lingo handler; just use 'updateStage' to make the changes visible. But remember: Any 'go someFrame' in your handler as well as its finishing will give the control over that sprite back to the score.

5. TIP: Normally if you puppetize and change the 'member of sprite', the new member will be displayed with its new size. But if you have manually stretched that sprite on stage during author-time (happens to me often), the new member will take on exactly the same size of that sprite on stage (except for scrolling and fixed-sized fields). Use 'Modify - Sprite - Properties - Restore' during author-time to get rid of any stretching of sprites (and prepare your members to have the desired size), if you want to puppetize and exchange different sized members for a sprite. The 'Restore' command has no effect on fields, richTexts, shapes, and buttons, but in 5.0 will adjust all sprites to the blend value of the first selected sprite. There is NO Lingo command to achieve this. As a workaround, you can recalculate the 'rect of sprite' according to its 'rect of member'.

6. TIP: You can also puppetize an empty sprite channel, but you won't be able to assign it a castMember. Be sure to have at least a dummy sprite (a single pixel, correct position, correct 'regPoint', but offstage display) in a sprite channel that you want to puppetize. (Although there is a technique of puppetizing an empty channel by first assigning it a castMember, then all of its sprite properties, and finally using 'updateStage' twice, Macromedia's Tech Support doesn't recommend it. And it's not supposed to work in 6.0...)

7. TIP: When you stop your movie in author-mode, sprite channels will continue to show their puppets in the active frame, until you select a sprite in the Score or on the stage. You can use this behavior to check if your puppeting and settings of the sprite properties are what you wanted. Just rewind the movie to get rid of all puppets. Remember: Your 'on stopMovie' handler is also executed when you stop your movie during author-mode.

8. TIP: When jumping to another movie, it's best to use your 'on stopMovie' handler to turn the 'puppet' and 'cursor of sprite' of ALL sprites to FALSE (and display a watch 'cursor 4' to communicate a waiting time), as there have been (5.01) problem reports when puppets and cursors are still active when changing movies.

--

EXAMPLEs:

set the puppet of sprite 5 = TRUE
set the ink    of sprite 5 = 2 --> 'reverse ink'
updateStage
--
--> ...the puppetized sprite will keep its new ink.

--> Then later you can turn the puppet off, and thus have
--> the original ink setting of the sprite from the score at that point:
--
puppetSprite 5, FALSE
go to the frame
--
put the puppet of sprite 5
-- 0





[index] _ D5/601 _ 971208:


puppetSprite

sprite controlling command

TIP: All info and corrections for 'puppet of sprite' (see above) apply also to the 'puppetSprite' command.






[index] _ D5/601 _ 971212:


rect of sprite

graphic sprite location property

6.0 Dictionary Error, same in 5.0:

= Missing:
"Changing the 'rect of sprite' needs a stage update.
 Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."
 --

1. TIP: The 'rect of sprite' is a property of any graphical sprite like bitmap, pict, field, richText, shape or button, film loop, digital video, or even a movie sprite. After changing the 'member of sprite', its 'height of sprite' and 'width of sprite' will NOT report the new values for the sprite. In this case, use 'the height of the rect of sprite' and 'the width of the rect of sprite'.

2. TIP: The 'rect of sprite' of an empty sprite channel can return strange values, like 'rect(0, -4370, -8739, -8739)'. Seems to be fixed in 601 and 'rect(0,0,0,0)' will be returned.

3. TIP: By setting the 'rect of sprite' you can avoid using the outdated combination of the 'stretch of sprite' and 'spriteBox()'. Those two elements' do NOT work with fields, but you can set the 'rect of member' to resize field members.

4. TIP: It's easy to set the 'rect of sprite' to move the highlighted version of a button 1 or 2 pixels down and right in an 'on mouseDown' action, and don't puppetize the sprite for this temporary effect, but in 6.0, reset it to its old rect when finished. For properties of any rect, see also 'rect()'.

5. TIP: 601: You CANNOT get at the 'rect of sprite' in an 'on beginSprite' event handler, unless Director has intialized any of that sprite's location properties. Workaround: get 'the left of sprite' first, and the 'rect of sprite' will be initialized correctly by Director.

6. TIP: You can test if a sprite has a member with a 'picture' by checking 'if NOT (the rect of member (the member of sprite x) = rect(0,0,0,))', because 'if pictureP(the picture of member (the member of sprite x))' produces an error alert if the tested castMember has no 'picture'.

--

EXAMPLE:

The following technique will move a graphic sprite 1 pixel to the right and 1 pixel down on stage and fix it there:
set oldRect = the rect of sprite 9

set the  rect of sprite 9 = offset(oldRect, +1, +1)
updateStage
--
put NOT (the rect of sprite 9 = oldRect)
-- 1





[index] _ D5/601 _ 971208:


scoreColor of sprite

sprite channel color property

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'scoreColor of sprite' needs a stage update.
 Puppet only for the value set by Lingo to last beyond
 the current sprite's life span."

"The possibly values...color chips 0 to 5 in the current palette."
= The colors seem to have NOTHING to do with any palette:
"The possibly values for the 'scoreColor' range from 0 to 5:
    0 = white (in the 6.0 interface, this is a default blue)
    1 = light yellow
    2 = green
    3 = light blue
    4 = pink
    5 = orange red."
    --

"...can be tested but not set."
= The 5.0 Dictionary should read:
"...can be tested AND set, e.g. during score recording."
 --

1. TIP: 5.0: If you set the 'scoreColor of sprite' without score recording (no stage update needed), the score won't show the sprite's new channel color, but Lingo will confirm it. And remember to enable the checkbox 'Allow Colored Cells' in Director's Score preferences. The 6.0 Dictionary states: "...can be tested AND set".

2. TIP: To block out interactivity in frames (e.g. that have a 'frameTransition'), you can color the whole frame in a score color like red (a value of 5), and then test the 'scoreColor of sprite' and exit any handler when it returns 5 (red); for more info see 'puppetTransition'.






[index] _ D5/601 _ 971208:


sprite...within

sprites comparison operator

6.0 Dictionary Error, same in 5.0:

"...checks wether two sprites intersect..."
= Wrong command; should read:
"...checks wether the first sprite lies entirely
    inside the area covered by the second sprite..."
    --






[index] _ D5/601 _ 971208:


"spriteP()"

No, no, this faked 'spriteP()' is NOT a valid Lingo function, but if you want to check if there's a sprite in channel x of your frame, then test the 'type of sprite': it will return FALSE if there is no sprite in the given channel. Or test the 'member of sprite' which returns '(member 0 of castLib 0)' for an empty sprite channel. You can also test the 'rect of sprite', which (at least in 601) returns 'rect(0,0,0,0)' for an empty sprite channel.






[index] _ D5/601 _ 971208:


top of sprite

sprite location property

6.0 Dictionary Errors, same in 5.0:

"The coordinate is the number of pixels from the
 upper left corner of the Stage."
= Should read:
"The VALUE is the DISTANCE in pixels from the TOP of the Stage."

"See Also: ... locH left of sprite, of sprite..."
= Should read:
"See Also: ... left of sprite, locH of sprite, rect of sprite ..."
 --

"...can be set with the 'spriteBox' command."
= The 5.0 Dictionary should read:
"...can be set with the 'spriteBox' command,
    if the 'stretch of sprite' is set to TRUE,
    and needs a stage update."
    --






[index] _ D5/601 _ 971208:


trails of sprite

sprite screen display property

6.0 Dictionary Errors, same in 5.0:

= Missing:
"Changing the 'trails of sprite' needs a stage update."

"Set 'the trails' to 0 ... set 'the trails' to 1..."
= No abbreviation please; should read:
"Set 'the trails of sprite' to FALSE ...
 set 'the trails of sprite' to TRUE..."

...I'd suggest using TRUE and FALSE (instead of 1 or 0,
   which is identical), because 'trails of sprite'
   can only be turned ON or OFF, and the Dictionary
   uses TRUE/FALSE for 'visible of sprite' and for
   'tweened of sprite' as well.
   --

1. TIP: Remember: Transitions wipe away any 'trails' left on screen in their 'changeArea'.

2. TIP: Remember: If a video's 'directToStage of member' is turned on, it will leave its 'trails' on the screen after finishing, even when changing to another frame without the video sprite in it. The same sometimes happens with 'the controller' of a 'directToStage' QuickTime video.

3. TIP: Following are some techniques to remove leftover trails from the screen:

a) Use 'set the stageColor = the stageColor' to get a forced redraw of the stage, which will remove any trails left on it. Just issuing an 'updateStage' will NOT do this.

b) Have a sprite cover the whole area of the leftover trails on stage. The most easy way is to have a not-filled shape do this, which is colored white on white, has no border, and has 'copy' (or 'matte', 'transparent', or 'background transparent') ink applied to it, which will make it invisible on stage. Remember: Shapes have their registration point in the left upper corner of their rectangle on stage, but you can very easyly set their 'rect of sprite' to equal the trails area. You don't need to 'puppet' the sprite -- just have a temporary stage update to make sure that Director redraws the stage and thus removes the trails.

c) Another way to remove unwanted trails on stage is to have your (full-screen) background member temporarily appear in a higher channel than before, which will force Director to re-composite and update the whole stage when arriving in that frame.

d) Use the following techniques to remove the leftover trails from a 'directToStage' video sprite or a leftover QuickTime 'controller' from the screen:

 1) Use a 'frameTransition' in the new frame, or issue a 'puppetTransition' before going to the new frame.
 2) Use 'set the stageColor = the stageColor' in the new frame to get a forced redraw of the stage, which will remove any trails left on it (no 'updateStage' needed).
 3) Turn the 'visible of sprite' off (FALSE or 0) for the video sprite before leaving the frame (and then turn it back on to TRUE, it does NOT need a 'puppet'); or place another sprite that covers the trails area in the new frame; or in the new frame just have a shifting of sprite channels for sprites that are under the trails area.
 4) You can move the video sprite outside the stage area (like up above the menu bar) before going to the new frame, to avoid the video leaving its trails behind: 'set V = the locV of sprite x .. if (V > -1) then set the locV of sprite x = V - 500 .. updateStage'. You can then either do an 'updateStage' BEFORE going to the new frame, or 'puppet' the sprite to keep its new location fixed ACROSS the frame change, and then release the puppet again with 'puppetSprite x, FALSE .. go to the frame'.

 5) Another way to avoid video trails is to change the video sprite's 'member of sprite' to a single dot pixel bitmap, which has its 'regPoint' way below it, so the dot will actually appear outside above the visible of the stage area. You can then either do an 'updateStage' BEFORE going to the new frame, or puppetize the sprite to keep its new member fixed ACROSS the frame change, and then release the puppet again by setting 'the puppet of sprite x = FALSE .. go the frame'. But consider what John Dowdell from Macromedia Tech Support says: "One thing that's caught more than a few is when switching bitmap sprites for video sprites, or shape sprites or whatever... each sprite has a set of properties, and changing the 'member' property of a sprite doesn't do anything about all the other properties that sprite has." See more info in the Dictionary on 'type of sprite'.






[index] _ D5/601 _ 971208:


type of sprite

sprite validation property

1. TIP: In earlier versions of Director, 'the type of sprite channelNumber' had to be adjusted to change 'the castNum of sprite' from one type of member to another, i.e. from a bitmap to a field or to a shape castMember, and vice versa, but in Director 5 and 6 this seems no longer needed.

2. TIP: If 'the type of sprite x = 0', then it means that there is no sprite in channel x of your frame. Set the 'type of sprite' to 0 for a sprite that you want to delete (e.g. during score recording).

3. TIP: Remember: If you test the 'type of member', you get back a symbol like #richtext, but if you test the 'type of sprite' you get back an integer number between 0 and 16.

--

EXAMPLEs:

As the listing of the possible values for the 'type of sprite' are not included in the docs anymore, here's the list from the 4.0 'Lingo Dictionary', but no guarantee that the given type codes are still valid in 501 or 601:
 0: inactive sprite (turns the sprite off)
 1: bitmap
 2: rectangle (shape)
 3: rounded rectangle (shape)
 4: oval (shape)
 5: line topLeft to bottomRight
 6: line bottomLeft to topRight
 7: field
 8: button
 9: checkbox
10: radio button
16: a digital video, or some other type;
    use the 'type of member' property to examine
    the type of the castMember which is associated with the sprite.





[index] _ D5/601 _ 971208:


visible of sprite

sprite display property

6.0 Dictionary Error, same in 5.0:

= Missing:
"Changing the 'visible of sprite' needs a stage update.
 The default value is TRUE. No 'puppet' needed at all!
 Setting to FALSE cannot be saved with the movie!"
 --

From the '6.0 ReadMe':
  In Director 5, setting the 'visible' of a sprite channel
  to FALSE was equivalent to clicking the channel mute button
  in the score. The sprite became invisible and any mouse
  related handlers in scripts attached to that sprite were disabled.

  Note that the only events sent to a sprite channel in Director 5
  were mouse-related. In Director 6, setting the 'visible of sprite'
  to FALSE will make the sprite invisible and disable ONLY the mouse
  related events from being sent to that channel; 'beginSprite',
  'endSprite', 'prepareFrame', 'enterFrame', and 'exitFrame' will
  all continue to be sent regardless of the sprite's visibility
  setting. Clicking the mute button on that channel in the score,
  however, will set the visibility to FALSE as well as prevent ALL
  events from being sent to that channel. Muting now disables
  a channel, while setting a sprite's visibility to FALSE merely
  affects a graphical property.
  --

1. TIP: You can test AND set the 'visible of sprite', its default setting is TRUE, as no sprite channel can be turned off by default. You need a stage update for a change to the 'visible of sprite' to take effect.

2. TIP: You do NOT need a puppet: The 'visible of sprite' and the 'cursor of sprite' are the only two sprite properties that persist when you change them, without the sprite needing to be a puppet at any time. But if you don't turn the 'visible of sprite' back to TRUE, the sprite channel will stay invisible throughout the movie, even when rewinding it during author-time. Remember: The 'visible of sprite' setting is NOT saved with your movie; everytime a movie opens, all its channels are visible by default.

3. TIP: Remember: 'rollOver(channelNumber)' returns TRUE for invisible sprites as well, but 'set x = rollover()' and 'the rollover' return 0 for unvisible sprites. In 5.0, the 'mouseCast' does NOT return the castMember number of invisible sprites -- it will return the castMember number of the sprite underneath, or -1 if there's no other sprite under it; in 6.0, 'the mouseMember' returns <void> in such a case.

4. TIP: Director's 'printFrom' command will also print out invisible sprites.

5. TIP: You might want to turn the 'visible of sprite' back on for all sprites in your 'on stopMovie' handler during author-time. Remember: The 'on stopMovie' handler from your movie also executes anytime you stop your movie during author-time.

6. TIP: Instead of setting the 'visible of sprite' of a sprite channel to FALSE, you can puppet the sprite and move it offstage, which will also moves its cursor and script out of reach: 'set V = the locV of sprite x .. if (V > -1) then set the locV of sprite x = V - 500 .. updateStage'.

7. TIP: An interesting idea was mentioned by Patrick McClellan: Integrate the hilited versions of your buttons in the background graphic, and when clicked, set the 'visible of sprite' for that button sprite to FALSE to display its depressed picture in the background, and 'rollOver(channelNumber)' will still return TRUE for it.






[index] _ D5/601 _ 971208:


width of sprite

sprite size property

6.0 Dictionary Errors, partly the same in 5.0:

= Missing:
"Changing the 'width of sprite' needs a stage update."

"...applies only to bitmap and shape cast members."
= Should read:
"...applies to ALL sprites, but can only be set reliably
    for bitmap (with 'stretch of sprite') and shape SPRITES."

"put the width of sprite (i + 1) into howWide"
= Outdated! Example 2 should read:
"set howWide = the width of sprite (i + 1)"

= Missing:
"See Also: height of member, width of member...rect of sprite..."
 --

TIP: From William Donelson 11/97: Watch out for 'the width of sprite x'; it will give you the authored width from the score, not the current width if the 'member of sprite' has been changed by Lingo. Instead, use 'the width of the rect of sprite x'. Same applies to the 'height of sprite'.





(Top)

URL = "http://www.a3w.de/Lingo/Ldoc_Sprites.html"  (971208)

 Top [Main Page] [About...] [Error Lists] [Ldoc+ Index] [Lingo Groups]
The Ldoc+ © Copyright 97-98 by Denis Wieger Online since June 1, 1997. All rights reserved.
<mailto:Denis@a3w.de
 Top