How can I affect multiple sprites?

Hi:
I am trying to affect multiple sprites when I roll over a
button. Basically it says:
on mouseEnter me
sprite(3).visibility = 1
sprite(4).visibility = 1
sprite(5).visibility = 1
end
on mouseLeave me
sprite(3).visibility = 0
sprite(4).visibility = 0
sprite(5).visibility = 0
end
How can I tell it to affect the 3 of them in one line? I
tried:
on mouseEnter me
sprite(3,4,5).visibility = 1
end
but this didn't work.
It is not an issue when its is only a few sprites...but I
might need to affect 10-15.
Any help would be great...
Thanks!
Rafael.

You could use a repeat loop where you make a list of the
sprite numbers
then go through that list
on mouseEnter me
repeat with i in [3,4,5]
sprite(i).visibility = 1
end repeat
end
OR
on mouseEnter me
mySprites=[3,4,5]
repeat with i in mySprites
sprite(i).visibility = 1
end repeat
end
That would be how to affect them directoly. You may not want
to use a
lot of tight repeat loops if there are large amounts of
these, since
that will tend to lock up Director until the repeat loop is
finished.
An easier way is to use sendAllSprites.
In the script that is on the sprites that you want to control
the
visibility of, add a custom handler like this:
on setVisible me, vVis
sprite(me.spriteNum).visible=vVis
end
Then, on your button, you would have code like this:
on mouseEnter me
sendAllSprites(#setVisible,1)
end
on mouseLeave me
sendAllSprites(#setVisible,0)
end
Now, when the mouse is over (or leaves) that sprite, any
sprite which
has that custom handler will turn its visibility on or off

Similar Messages

  • How can I have multiple WINDOWS (NOT tabs) with INDEPENDENT content?

    How can I have multiple '''windows''' (''not ''tabs) with '''independent''' content?
    I used to be able to open separate windows with Firefox, and the content could be completely different in each window. No matter what I did in any window, no OTHER window open at the time, nor any of the content therein, was affected. This is no longer the case and it is extremely frustrating for me.
    I do ''not ''like tabs and do not use them. I prefer multiple windows plus I am so used to using them, for so many years now! But with v9.0.1 I suddenly can no longer do what I've always done with my browser without this aggravating problem constantly reminding me that I can't have what I want in firefox anymore.
    Or can I? Does anyone have a solution I don't realize exists?
    Thanks,
    Sowelu

    AppleScriptObjC can use pretty much everything in the Cocoa API, so yes, it is possible.
    Note that a view is not the same as a window, and a window can have multiple views. There are also many ways to implement "tabs";  take a look at some of Apple's applications - they use various mixtures of toolbars, checkboxes, and radio buttons, for example.  An application such as this will be a lot more involved than what you have done so far though, using custom classes and subclassing existing ones, so be prepared to do a lot of reading and researching.

  • How can I have multiple users on iTunes (in order to connect to a shared office iPad)?

    How can I have multiple users on iTunes (in order to connect to a shared office iPad)? Currently each of us has our own iTunes account, so I've made an "all office" Apple ID. However, I can't seem to get two different accounts (my personal and the office) to work on my machine. Even when I login as "the office", my personal library is still showing. Additionally, when I try to setup with a first-time use in iTunes, I get an error that I don't meet the minimum age requirement - no matter what birthdate I enter!

    The library exists regardless of which user is logged in.
    The only way around that is to create different user accounts on the computer.
    There is no way to have 20 unique iTunes users access a shared iTunes under a single login on the computer.

  • How can I save multiple titles under the same DVD?

    I use HandBrake to rip DVD's into iTunes. How can I save multiple titles under the same DVD? For instance, I have a Jimi Hendrix documentary that comes with special features, such as concert performances. I would like to have the main feature and the special features saved in my iTunes under the same title, perhaps as different 'tracks' (kind of like how different songs can be saved under the same album).
    Is there a way for me to do this, or am I chasing phantoms?

    *This response is for iPhoto 11 (v9). If you're using an earlier version, please post back and let us know. Troubleshooting steps are not the same for different versions. To find out which iPhoto you have: iPhoto Menu -> About iPhoto)*
    Duplicate the photo first. (Photos -> Duplicate). This means that you will have multiple copies of the master as well as the edited version.
    If you use versions like this often and wish to have only one master then you can do this with Aperture.
    Regards
    TD

  • HT201317 how can I add multiple photos to camera roll

    how can I add multiple photos to camera roll

    If you mean from photo stream, open your photo stream album on your phone in the thumbnail view, tap Edit, tap all the photos to select them, tap Share, then tap Save to Camera Roll.

  • How can I convert multiple files at one time and not one at a time

    How can I convert multiple files at one time and not one at a time

    Hi Plissey1950,
    Sorry for the lengthy delay to a response.  Are you trying to convert multiple files to individual PDF files at the same time? (not combine them).  If so, you'll need to use Adobe Acrobat for this function. The CreatePDF service does not have the ability to convert multiple files to multiple individual PDF files.
    Thanks,
    David

  • How can I activate multiple tags at one time?

    How can I activate multiple tags at one time?

    I'm pretty sure you can run this on a sub tree of /etc/tags
    http://dev.day.com/docs/en/cq/current/wcm/page_publish/tree_activate.html

  • How can I print multiple PDF files at once using Windows 7?

    How can I print multiple PDF files at once, on an HP LJ Pro 400 xcolocr printer without opening each
    one separately using Windows 7?

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial printer. You can do this at http://h30499.www3.hp.com/hpeb/
    I hope this helps.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Preview; How can I open multiple PDF's in one window with Preview?

    How can I open multiple PDF's in one window with Preview?
    I have gone to Previews preferences and selected 'Open groups of images in the same window' and have tried every setting imaginable and nothing works. What am I doing wrong?

    Hi, a few ways..
    http://www.monkeybreadsoftware.info/Freeware/CombinePDFs.shtml
    http://www.monkeybreadsoftware.info/Freeware/CombinePDFs.shtml
    http://www.macosxhints.com/article.php?story=20060327192826493&lsrc=osxh

  • How can you delete multiple copies of the same songs without deleting one at a time?

    I have multiple copies of most of the songes in Itunes. How can I delete multiple copies without doing it one at a time?

    Select/highlight more than one at a time followed by selecting Delete.

  • How can i create multiple accounts but use the same itunes?

    how can i create multiple accounts but use the same itunes?

    Hi iCloud is Making Me Go Crazy,
    You will need to create a new Apple ID for your GameCenter and iCloud services.  You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish. 
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Cheers,
    - Judy

  • How can I print multiple copies of same photo onto one page on iPhoto 9.5.1?

    How can I print multiple copies of same photo onto one page on iPhoto 9.5.1? I was able to do it on the old iPhoto, but can't seem to be able to do it on the new iPhoto. Grrr...

    Photos does the same thing.... Only workaround I can come up with is to create a template in Pages and copy & paste.

  • How can I have multiple users on one apple id?

    How can I have multiple users on one apple ID?
    ie: I have my apple ID with my own credit, how can I set up credit for my son under the same apple ID, so that he can still access the same apps I've already downloaded and paid for?

    I've been trying to figure out a clean way to do this too. I think you may need more than one Apple ID – one that is shared and used to purchase "sharable" items and then "individual" Apple IDs for you and your son. That's the idea that I'm pursuing for the moment.
    It seems that there must be a way to do this, App Store purchases for the Mac are licensed across multiple machines. iPhone app purchases have "all your devices" licensing. Makes me think that Apple has a process in mind for sharing an account (or associating a device with multiple accounts).
    Other things I've learned:
    - Apparently you can't merge Apple ID accounts. I asked about this once at an Apple Store and was told that there was no way to do it.
    - If you share an Apple ID the Messages app behaves in a somewhat surprising manner. It must use your Apple ID to decide where messages should be sent because all users get all messages. This can make it very hard to organize a surprise party :-)

  • HT204053 how can i create multiple icloud accounts for my family members

    how can i create multiple icloud accounts for my family members

    Thanks...  I appreciate the reply.  Since I wrote the previous email, I actually went and changed my apple id (the main id) and the documentation I looked at said iCloud will set mail up automatically(?)...  I had it working before. 
    Also, I tried to manually set up the ID via the Mail Accounts screen(s) and I can't figure out what my server information is...  Pop or Imap?  What's the outgoing server and the incoming server?
    I typically have never had problems setting up mail accounts (in apple mail) with no problem.
    Can anyone point me in the right direction?
    Thanks in advance!

  • How can I create multiple versions of a video within the same project?

    OK...this is a probably a very basic question but I'm not sure how to word it clearly.
    How can I create multiple versions of a video within the same project? What I mean is that I have a bout 50 minutes of video and I want to make two DVDs using different clips from this original 50 minutes of footage. It would be a real pain to have to re-import the video AGAIN for the second DVD. I suppose I could drop anything I don't want to burn to DVD back into the clips pane but that would wipe out all my transitions wouldn't it? I want to save each project in their “raw” form so I can burn additional DVDs later otherwise I would just do them one at a time and not care about one of them being destroyed.
    Wow...that was a mess. Does anyone understand what the heck I’m asking? I hope so.

    How can I create multiple versions of a video within the same project?
    You can't. You make separate projects using the same or different clips, segments, transitions, titles, etc. You can even duplicate the first project and then modify/make the desired changes in the duplicated project. Each project can then be burned as a different DVD or as different titles on the same DVD if there is enough room.

Maybe you are looking for