CSC 101 Computer Literacy

Lab4

Merrie Bergmann

Ileana Streinu

Dominique Thiebaut

Thursday, September 26, 1996

Please read the whole description of the lab assignment before proceeding. It will help you plan ahead how much time you want to spend on each feature. Please THINK about what you are doing: several things have been encountered during last week's lab, or they may appear on your handout before you are requested to do a certain task. You may want to refresh your memory on things that you have forgotten: use the help menu for this purpose, or use last week's lab handout (a copy is always available on the web through the class home page!) and go over features that have been explained at that time.

1. Connect to the Seelye server and get a copy of today's demo "Musical Lessons" from the Literacy folder. You can put the copy on the desktop of your computer and also make a copy on your own diskette for further reference.

2. Launch Netscape and follow the links to the class web page and from there to the "Tentative schedule". Click on Lecture number 6 (last class), and read again the specifications for the "Musical Lessons" stack.

3. Following those specifications, you will now create a similar stack. I want you to use your imagination to "teach" the "user" of your stack some other topic than playing the piano or the trumpet! The structure of the stack should be identical to the one described in class. The purpose of this exercise is to practice button linking and basic scripts.

Here are more details about the technical aspects. Launch Hypercard from the hard drive of your local Mac or, from the Apple Menu, use the shortcut that takes you directly to Hypercard. Start with a fresh, new stack, with a completely empty card: no background, no fields, no buttons. To avoid accidentally copying the background of the currently open Home stack, you must remove the X in the "Copy current background" box in the New Stack dialog box.

This lab is intended to exercise your knowledge of buttons, fields and scripts, and only minimally graphics (the homework concentrates on graphics). So please enter all the text in fields (rather than painting the text on the card with the text tool, A). You may, of course, use as much graphics as time permits, but if you spend too much time on graphics, you may not finish. So try to restrain yourself!

You have learned how to create a button in the previous lab. There are two ways to label the button: with text in a field next to the button (or you could paint the text, but I would prefer all text to be in fields for this lab); or by giving the button a name and selecting ShowName.

To link a button to a card you choose Tasks from the Button Information window (which, as you know by now, is obtained by choosing the button tool, selecting the button and then Button Info from the Objects menu). You can either choose to go to the next/previous card, or, if you want to link it to a specific card, you have to do the following steps. While in the Tasks window, go back to the stack and go to the card to which you want to link this button. That will become the current card. Then go back to the Tasks window (by clicking once in it - you might have to move the windows around a bit to get to this one).Select Current card.

Another possibility is to type the actual script that will take you to the appropriate card. Remember what you saw in class today. If you forgot, look into your copy of the Musical lessons demo which we created in class today and copy and modify the scripts that I created for each card. Be careful: you should insert the appropriate card id number (or next, first, etc. as appropriate) not the one copied from my Musical lessons.

For your reference, the most useful script commands that you will encounter are listed below:

on mouseUp

...

end mouseUP

on openCard

...

end openCard

go to card id 2345 --- (or whatever id number your card has)

go to next card

go to card "main" (or whatever name that card has)

hide field "myfield" (or whatever name your field has)

show field "myfield"

(similarly you can hide and show cards and buttons)

play "voice" TempoValue "notes"

where voice can be either: boing, harpsichord or flute, TempoValue is any number between 1 and 800 (if you do not specify it, it is 100 by default), and the notes are a,b,c,d,e,f,g. You can also specify duration, octave and sharp/flat, but that is more complicated. For those of you who are interested in this aspect, a page with the full description of the Play command is attached.

4. Your next task is to expand the stack that you have just created with an additional lesson and a few more features. The purpose of this last exercise is to make you think about the steps involved in modifying an existing stack, inserting a card at the proper place, reusing existing features (such as buttons), removing existing features (such as the buttons I created in the Musical Lessons demo for going to the other lesson) and adding new features to all the cards (which should suggest using the background) or just to one of them (such as graphics on the foreground). The specifications are not as detailed as the ones I gave for the Musical instrument, since here I expect you to figure out where certain things should go (foreground/background, etc), although if you read carefully, you'll see that I give sufficient hints! The guidelines are detailed below.

But before plunging into this, please read everything and think about what you will do: what will go on the background, and what on the foreground cards. Planning ahead will save you time in the long run. You can either start with a fresh new stack, or simply modify the previous one. But in the end you should have something that has all the specified buttons and fields together with the appropriate scripts.

1. The final stack should have at least four cards, i.e. at least one more than you have just created. Each card should be numbered someplace, 1, 2, 3, 4. It makes sense to create a field on the background to hold this number, and then to type a different number on each card.

2. The first card should be the title card you have created before, containing the name of lessons, your name and having now three instead of two buttons linking to the remaining cards (everything else should be the same on the first card).These buttons should be labeled with a short description of where the button will take you.

3. The three cards that are not title cards should each have a button that returns the user to the title card, and is clearly labeled (e.g., "Return to Lessons"). (This button should not appear on the Title card itself.) Since all these buttons have the same effect, once you have one linked and working, you can copy it and paste it onto the other two cards. This is much easier than making three buttons and linking each separately.

4. All four cards should each have "left" and "right" buttons that cycle amongst the four cards. This is most easily accomplished by putting these buttons on the common background, copying them from the Literacy/ClipArtetc/ButtonIdeas stack. When you copy the _ button (for instance), you also copy its "script," so it will be operable immediately.

5. You should include some original graphics on each card. For example, you might border the background nicely with the rectangle or oval tool. The graphics does not have to be well-done. Just show me you know how to make graphics. You'll get to exercise graphics in the homework.

In summary, the common background for the stack should have at least two buttons (to go to the previous/next card) and one field (the number of the card). The title card should contain three buttons to take you to the lessons and one for the hidden help field (but the two buttons on the background will show through and be accessible, too!!). The other three cards should each contain one button to take to the title card (but again the background buttons will show through). And the text on the cards should be in fields.

Name your stack Lab4.Name1.Name2 and drag it to the Literacy/DropBox. No hardcopy necessary.