At 18:59 -0300 03/08/2002, Mercedes Rossetti wrote:
>I am aware this sounds very simple to you but it's the Himalayas for me
>who's just starting.
Welcome to the joys of lingo!
>I need to have a button that will display text when
>clicked and hide it when clicked again. This is PC and Director 8.
There are two Lingo keywords that are most pertinent here: 'sprite'
and 'visible'. Essentially you would attach a behavior to your on/off
button which, on a mouseUp event, would set the visibility of the
text sprite to true or false.
As an example, if the text you wanted showing or hidden was located
in channel 5, you would attach this behavior to your on/off button:
on mouseUp me
sprite(5).visible = not ( sprite(5).visible )
END mouseUp
What's up with the 'not'? Well, this is a toggle. It switches the
visibility of the sprite to the opposite of whatever it is at the
time the command is issued.
Thus if the sprite is not visible now, after you click the button it
will appear; similarly if it is visible this command will make it
vanish.
By default the text sprite will always be visible when the movie
first runs. If you want to change that so it starts out *not* visible
(off), you would attach a behavior like this one to the text sprite
itself (not its on/off button):
on beginSprite me
sprite(me.spriteNum).visible = FALSE
END beginSprite
'me' is a keyword behaviors use to reference the single behavior
instance itself as it applies to a given sprite. 'me.spriteNum'
refers to the sprite number to which the behavior is attached. That
way the behavior always knows which sprite to make invisible -- the
one that it's attached to.
I've got a 28-page tut online that might be of merit to you, as well
as other pages of freebies, discussion and so on. And, of course,
I've got a book out (who doesn't these days) -- all relevant links
are in my sig. The book *says* it's 8.5, by the way, but it would
apply to 7 and 8 as well, since I have only one brief section on 3D
and nothing, really, on imaging lingo.
Have fun with it! Hope this helped!
--
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!]