Lecture #8

CSC101 Computer Literacy

Fall 1996

Tuessday, October 1, 1996

Ileana Streinu

0. Questions

1. Review Hypercard + new simple features.

2. Animation in Hypercard.

3. Midterm Review, other topics.

4. Break: administrative

[If time allows:

5. Video: "Inventing the future"]

6. More Questions

0. Questions? [10 min]

Some administrative problems: old lab and homework assignments: are there if you want to look at them BEFORE the lab day, but they may be changed. The current version is made available on the Web no later than the 1:00 lab on Thursday. [Show time stamp on file - when it was created]. If you miss the lecture/lab, you should get a copy of the current lab AFTER 1:00 on Thursday. [ I can remove the old versions, if this causes confusion...]

1. Review of Scripts and more Simple scripts (Hypercard).

a. Where scripts go:

-on stack, if something is to happen when stack is open:

on openStack

...

end openStack

-on card, if something is to happen when card is open:

on openCard

...

end openCard

-on buttons and fields, if something is to happen when you click on button or field"

on mouseUp

...

end mouseUp

Remarks:

1. end openCard or end mouseUp should be interpreted as saying: stop executing the sequence of commands that you started executing on openCard or on mouseUp.

2. there are many other events {mouseDown, mouseClick, etc.) that signal Hypercard that some script should be executed [can take a whole course in Hypercard programming]. We only do the basics!

b. Simple commands (mostly for simple multimedia applications; we do not do complicated commands for which you need to study programming in HyperTalk.)

- Visual effects: hide/show button/field

hide card field "instructions" --->> means the field is on foreground

hide field "instructions" --->> means the field is on background

(similarly for show and for fields).

- Sound: play command

New: from text to voice --->> Demo:

-open a new stack with one card.

-create a new button. name it "What is your name?"

- Button Info -> Tasks -> (scroll down) Speak text -> Female voice, type in text :What is your name?"

- demo: back to browse mode, click on button.

- go-ing to cards. Effect: navigation; moving from one card to another (as linked by buttons). Also for showing cards -->> animations.

go to next card

gp to previous card

go back

go home

go to card id 3676

go to card 3 --> means card 3 in current stack

"to" can be omitted, e.g.

go card 3

(All these scripts can be insterted with Button Info -> tasks -> Go to Destination)

New:

- wait 3 seconds -->> to produce a delay.

e.g.

- wait 5 seconds after playing the harpsichord to play the "What is your name?" sound track.

- animations: next!

2. New:Simple Animation in Hypercard. Show examples with scripts. Read scripts. Eg Earth animation.

Example: "sunset over the mountains" animation.

- open new stack

- create three cards

- put some mountains on the background

- put a sun of different size on each card

- put script on stack:

on openStack

go card 1

wait 1 second

go card 2

wait 1 second

go card 3

wait 1 second

end openStack

Other animation tricks:

on openStack

show all cards -->> for 1 second

end openStack

Repetitively:

on openStack

repeat 100 times

go to next card

wait 1 second

end repeat

end openStack

or:

on openStack

repeat number of cards times

show card

wait 2 seconds

end repeat

end openStack

or, repeat until something happens:

on openCard

repeat until the mouseClick

show all cards

end repeat

end openCard

3. Midterm Review, other topics. Show "Midterm review" stack.

- hidding/showing "graphics" using opaque fields

- clicking on "graphics" to make things happen: transparent buttons.

Other usefull stuff:

- set userlevel to 5 [Go/Message to get Message box]

- show field "instructions" [type in Message box if you have hidden a field and cannot get it!]

------>>>> Useful in DEBUGGING!!

to debug a program: to find why it doesn't work; to find the errors and to correct them.

Source: Grace Murray Hopper, early 50's: actual "bug" (moth) found inside the computer - got burned on wires (hardware bug!).

Example [if time allows]:

One-card stack. Black background. Three opaque fields with some text. Fields hidden when card is open. Fields shown afterwards with some delay. Flash. Hidden button to play "I love New York".

4. [Break] Administrative.

5. Video clip: "Inventing the Future" - about ENIAC and the beginnings of the Computer Industry. [intro + video = 15 min]

Why?

- to get an understanding on how the computer industry started; how it evolves: competition; not always the best product wins... [that might come later!]; market oriented: need money to pay for developing new features and move ahead: a lot of experimentation!

- software projects tend to take much more time, cost much more money than initially planned; not always fully debugged -->> just like some of your homework projects! --> Later we'll talk about Computer Risks and the effect on society of "computer bugs".

[Why? because they are not routine tasks: usually need a lot of experimentation with new ideas.]

[ If 5. doesn't work:

6.Show color demo. Color tools. Too much space!!

7. Graphic calculator (demo part); animation paradigm.

8. Show scripts on earth animation demo.

9. More Questions?