Thank you for your through explanation. It is greatly appreciated.
May I know this:
1. What is the purpose of
More complex behaviors may also include a "Public Methods" section which
includes so-called Accessor and Mutator methods: handlers which allow a
different script to access information inside the behavior, or to change
the value of the behavior's properties. These handlers are often written
"defensively" so that a call made using the wrong syntax will not cause
any problems:
-- PRIVATE METHOD --
on mSetJumpMode(me, aJumpMode) --------------------------------------
-- Mutator method
-- ACTION: Modifies jumpMode if <aJumpMode> is a recognized value
-------------------------------------------------------------------
case aJumpMode of
"Go to", "Play and Return": jumpMode = aJumpMode
otherwise: -- ignore the call since the value not recognized
end case
end mSetJumpMode
Sorry, I used it but I do not understand why.
2. What are the limitations to the on getPropertyDescriptionList handler
i.e., there are occasions where it can�t be used?
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?
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.
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?
I have modified the script to just the changes to three states and a sound
when clicked. Yet I still receive an error.
property pOriginalMember,pRolloverMember,pPressed
property pPlayActionSound,pActionSound,pActionLingo
property markerName, jumpMode
on getPropertyDescriptionList(me)
tPropertyList = [:]
tPropertyList[ \
#markerName] = [ \
#comment: "On mouseUp, go to marker:", \
#format: #marker, \
#default: #next \
]
tPropertyList[ \
#jumpMode] = [ \
#comment: "Jump mode:", \
#format: #string, \
#range: ["Go to", "Play and Return"], \
#default: "Go to" \
]
tPropertyList[ \
#OriginalMember] = [ \
#comment: "Original member:", \
#format: #bitmap, \
#default: #void \ -- 6. can a bitmap be considered void? How would I know?
What are the defaults? Can anything be void? Error is here: comma
expected? Why do I need a comma here?
]
tPropertyList[ \
#RolloverMember] = [ \
#comment: " Rollover member:",\
#format: #bitmap, \
#default: #void \
]
tPropertyList[ \
#Pressed] = [ \
#comment: " Pressed member:",\
#format: #bitmap, \
#default: #void \
]
tPropertyList [ \
#pPlayActionSound] = [ \
#[comment: "Play Action Sound ", \
#format: #Boolean, \
#default: #false \
]
tPropertyList [ \
#pActionSound] = [ \
#[comment: " Action Sound ", \
#format: #sound , \
#default: * *] -- 7. why is the default * *?
tPropertyList [ \
#pActionLingo] = [ \
#[comment: \ "Action Lingo", \
#format: #string \
#default: * *]
return tPropertyList
end getPropertyDescriptionList
on beginSprite me
pOriginalMember = sprite (me.spriteNum).member
case pRolloverState of
"No Rollover":
pRolloverMember = pOriginalMember
"Cursor change" :
pOriginalMember = pRolloverMember
end
pPressed = false
end
on MouseUp me
pPressed = true
sprite (me.spriteNum). member = pRolloverMember
mJumpToMarker(me)
end
if pPlayActionSound then
puppetSound pActionSound
end if
if pActionLingo <> ** then -- 8. what is the meaning of this?
----why do I specify it?
do pActionLingo
end if
end
-- 9. why is the �doAction� used on page 296? It can figure out navigation
and sound? Is it something similar to �ActionLingo�?
Have I made a mistake here by using it?
on mouseLeave me
sprite (me.spriteNum).member = pOriginalMember
on mJumpToMarker(me) ---------------------------------------------
-- SENT BY: mouseUp()
-- ACTION: Jumps the playback head to the chosen marker... if it
-- still exists
-------------------------------------------------------------------
-- Determine which frame is indicated by markerName
case markerName of
#previous: tFrameNumber = marker(-1)
#loop: tFrameNumber = marker(0)
#next: tFrameNumber = marker(1)
otherwise:
tFrameNumber = marker(markerName)
end case
if tFrameNumber then
if jumpMode = "Go to" then
go tFrameNumber
else -- play => play done
play tFrameNumber
end if
else
-- markerName no longer exists
end if
end mJumpToMarker(me)
on mSetJumpMode(me, aJumpMode) --------------------------------------
-- Mutator method
-- ACTION: Modifies jumpMode if <aJumpMode> is a recognized value
-------------------------------------------------------------------
case aJumpMode of
"Go to", "Play and Return": jumpMode = aJumpMode
otherwise: -- ignore the call since the value not recognized
end case
end mSetJumpMode
I apologize for asking so many questions, but it is all very confusing.
Where have I made mistakes?
Thanks in advance for your help.
Genevieve
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
[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!]