At 22:21 +0800 05/01/2002, noelle cheng wrote:
>May I know how a cast member script is written?
You slect a Cast member, such as a button or #text member or
whatever, and click the script icon in the Cast window frame. This
will open a Cast member script. The scripts are 'linked' to the Cast
member itself.
>I have hardly read your book beyond the first five modules, and I
>am making so many ( or rather too many) mistakes...
> How could it be so?
When you learned English, did you expect to be fluent after reading
the first five chapters of your language course material? When you
studied algebra did you believe you were doing poorly because, after
the fifth week, you still were not doing differential equations in
your head? After your first semester of biology did you become
discouraged because you couldn't map the human genome from memory?
New concepts always take time to absorb, and ideally -- if you're
really trying -- you'll make a load of mistakes. Why do you make the
mistakes? Because you've taken the initiative and chosen to try
things on your own. Throughout the history of the human species this
is the only true way to learn that has ever been discovered. No one
can pour the information into your head; you have to find out for
yourself how things work, and why. That means trying, doing, and
making mistakes. It also means *practice*.
>But I did not do it originally. Actually the sound file was 10
>frames long - which you actually recommended that I do not do.
I did? You can span a sound file across frames if you want.
>After that, I used a transition. But now the transition does not
>work either. How do I solve this?
No idea why anyting there could be going wrong, unless for some
reason the playback head isn't going through the transition frame
itself. Like if the movie stops playing before it gets there.
>You mention using a framescript, I believe you mean this:
>
>property pEndTicks
>on beginSprite me
>pEndTicks = the ticks + (4*60) -
>end
>
>on endSprite me
>if the ticks < pEndTicks then
>go to the frame
>end if
>end
>
>Why is it that a timer not suitable for this?
I don't believe I said a timer is unsuitable for this.
>At frame 139, I have this script to soften the introductory music
>and fade it away.
>
>on exitFrame me
> if sprite(27).volume > 0 then
> sprite(27).volume = sprite(27).volume - 1
> go the frame
> else
> go to marker ("firstmarker")
> end if
>end
>
>Does writing this code conflict with the volume control behavior you wrote?
No, it shouldn't have any effect on it at all.
> And 'firstmarker' contains the code in frame 140 (the ticks) But
>the playhead still stops at 'firstmarker'. Why?
Look at the code:
property pEndTicks
on beginSprite me
pEndTicks = the ticks + (4*60) -
end
on endSprite me
if the ticks < pEndTicks then
go to the frame
end if
end
There is a handler called 'endSprite'. You don't want an endSprite
handler here. You want to use exitFrame instead. What will happen
then is the playhead will cycle on that frame for 4 seconds, then
continue along the Score's timeline. What *is* happening right now is
(probably) yourt playhead blows through the frame containing this
script as though it didn't even exist.
>Also ( sorry,this is more of a re-assurance) the behavior you wrote
>is generic.
>So it should not conflict with the rest of the code I wrote?
That is correct; it's meant to be encapsulated.
>But there is still something I do not understand. In the original
>movie, the code worked with lingo pause, transitions ,everything. I
>did many score based things with no problems.
>
>However, when I added the volume control behavior the movie refused to run.
>
>Yet even button behaviors do not work now. Is it because there was
>something wrong with what I had originally done?
My guess would be that the original code was written from an
assumption of using 'pause' and score controls to handle navigation.
Using code to do it is more complex, and not always 100 percent
compatible with score-based control. It's more flexible, of course,
but it does require more programming and a somewhat different
approach.
--
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://www.osborne.com/indexes/beginners_guides.shtml
[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!]