*** This is part one of a two-part reply ***

Genevieve Young <[EMAIL PROTECTED]> wrote:
> More complex behaviors may also include a "Public Methods" section...
> 
> on mSetJumpMode(me, aJumpMode)
... 
> Sorry, I used it but I do not understand why.

Hi Genevieve,

I just included this handler as an example of how a public method can be
used.  You were working on a "jump to marker" behavior, so all the handlers
I suggested are related to that.  You are unlikely to need to change the
value of the marker to jump to at run-time, so you can safely ignore this
particular handler.

> 2. What are the limitations to the on getPropertyDescriptionList handler
> i.e., there are occasions where it can't be used?

The getPropertyDescriptionList() provides a handy way to change the
parameters for a single sprite.

If you are designing a control that uses several sprites, it can become
impractical to set the parameters for each sprite separately.  In this case,
I will tend to not to use behaviors at all.  Instead I will create a parent
script and tell it which sprites it "owns".  Suppose I am creating a search
facility, where the user will enter a phrase in a field, click on one of a
pair of radionbuttons to select whether the search should be for all of the
words in or for any of the words, and then click on Search button.  My
parent script would receive keyDown events from the field and mouseUp events
from all of the buttons.  All the code would be in a single script.

> 3. I have studied the behaviors in the library palette in the
> software and note that the behaviors  for markers there do not use     the
> getPropertyDescriptionList.
> But I can combine them?

Are you talking about the simple behaviors in the Navigation palette?  Most
of these do not use the getPropertyDescriptionList().  Instead, each
behavior jumps to the marker specified in its name: go next, go previous,
...  If you put two of these behaviors on the same sprite, they will all act
one after the other, each behavior overriding the previous one.  Only the
last behavior on the sprite will appear to have any effect.

Try it and see.

> 
> 4. May I specify more than just markers in a  getPropertyDescriptionList? I
> would like to do rollovers and preferably  produce a sound when the mouse is
> clicked.

Yes of course.  You can specify almost anything.  Take a look at the entry
for getPropertyDescriptionList in the Lingo dictionary.  It gives a list of
all the #format types you can use:  #integer, #float, #string, .... #ink,
#boolean.  The list does not appear to be complete.  It does not include
#flash and #vectorshape, both of which appeared in Director 7, but it does
include #richtext which was last seen in Director 6.

> In Special Edition using Director 8 Page 290  Rosenzweig has built a
> complete button  behavior.
> 5.    Why does he use addProp  list?  What's the difference?

There are many ways of creating the nested property list that is returned by
the getPropertyDescriptionList() handler.  Each developer has his or her own
ritual for it.  Using addProp ensures that a new property/value pair are
added at the end of a property list.  The following all give you the same
result:

myList = [#property: "value"]
--
myList = [:]
myList.addProp(#property, "value")
--
myList = [:]
myList[#property] = "value"

However, the last example is actually equivalent to the setaProp command.
Try this to see the difference:

myList = [#property: "value"]
myList.addProp(#property, "new value")
put myList
-- [#property: "value", #property: "new value"]

myList = [#property: "value"]
myList.setaProp(#property, "new value")
put myList
-- [#property: "new value"]

myList = [#property: "value"]
myList[#property] = "new value"
put myList
-- [#property: "new value"]

Using addProp adds a second property with the same name to the list.  Using
setaProp or the brackets access replaces the existing value with the new
value.

If you use the same property name twice in the list returned by the
getPropertyDescriptionList() handler, the dialog will not appear correctly.
So, in this particular case, the three forms all yield the same result.


[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!]

Reply via email to