Re: Change button state image
Steve Thomas <sthomas1-gQhbkF4bah9Wk0Htik3J/[email protected]> Wed, 3 Jul 2013 12:53:26 -0400
| Newsgroups | gmane.comp.lang.smalltalk.squeak.squeakland |
|---|---|
| Message-ID | <CAGa9PAYL2VvDzZGq2DnmZ-EjgGTX-jLpcss-NWrqg3fXnbT7TA@mail.gmail.com> |
Mike, Good to hear from you. Still swamped, but never so much I can't find time to help you or one of your students. First you do not need the *mouseWatcher* script. mouseDown/mouseUp are event listeners that are always listening, no need to start those scripts or keep them running. Try deleting that script and your project will still work. Okay, a couple of other options depending on how David wants to use this. 1) You can use a holder to hold the two (or more) images you want to switch between, then iterate through the holder on each mouse down. See page 2 of attached project. This has the advantage of introducing David to collections and iterating through the collections (in a visual way where the holder can help visualize the concepts. See page 1 of attached project. 2) You can use show/hide with two objects where if you click on one object it hides itself and shows the other (an visa versa). See page 2 of attached project) 3) You can get really elaborate and create your own Memorize Game (which students can use to build their own (see page 3 of attached project, I may need to find a way to make the code simpler and more readable, but it works). 4) You could create your own scripting tile (well not a real scripting tile, which would be cool if you could do that) if I have time I might demonstrate that later. Also FYI, I am working on a project to allow disabled kids who can only say squeeze a stuffed animal an have some gross movement skills to communicate with others using Etoys. And also allow their teachers and parents to create their own pictographs the child can use to communicate. More on that later. Cheers, Stephen On Wed, Jul 3, 2013 at 2:15 AM, Mike Lee <[email protected]> wrote: > Hi Steve, > > I hope this email finds you well and not too buried under work. > > My Zambian student David asked me today for a solution to changing a > button graphic to another on mouse down. He intends to use this to "flip" a > card (rectangle object) over to show answer. > > I'm proud to say that I came up with something that works, but there > probably is a better solution. > > If you have a minute to look and respond, that would be great. If not, no > worries. > > Mike > -- To some of us, writing computer programs is a fascinating game. A program is a building of thought. It is costless to build, weightless, growing easily under our typing hands. If we get carried away, its size and complexity will grow out of control, confusing even the one who created it. This is the main problem of programming. It is why so much of today's software tends to crash, fail, screw up. When a program works, it is beautiful. The art of programming is the skill of controlling complexity. The great program is subdued, made simple in its complexity. - Martin Harverbeke (from Eloquent JavaScript<http://eloquentjavascript.net/index.html> ) _______________________________________________ squeakland mailing list [email protected] http://lists.squeakland.org/mailman/listinfo/squeakland
David Change on click.002.pr
(application/octet-stream, 440.4 KB) - not displayed