Hypertalk Beginners Guide an Introduction to Scripting 1989.Pdf

Hypertalk Beginners Guide an Introduction to Scripting 1989.Pdf

Hyperralk·· Beginner's Guide: An Introduction to Scripting 4J File Edit Go Tool s Objects . "' . Script of card button id 4 = "Driue the car" on mouseUp put t he userlevel in to saveleve l i f t he uset·Leve I < 3 then set userleve I to 3 -- "Pa i n ti ng" i f t he userleve l < 3 t hen ex it mous eUp choose select tool doMenu "Se I ect AI I" doMenu "Select " se t dr agSpeed to 100 drag from 256, 171 to 150, 17 1 drag from 150, 171 t o 350, 171 drag from 350, 17 1 to 256, 17 1 doMenu "Se lect All" doMe11u ''Revert" choos e browse tool set user level t o savel evel end mouseUp Find ) ( Print OK (Cancel ) - . ®H yperTalkn, Beginner's Guide !!"!!!! An Introduction to Scripting - - - - ~ !"!!"'!! - - Script of card button id 4 = "D riu e the car" !""""!'' on mouseUp put the userleve l into savel evel i f the userleve I < 3 then set uset'Leve I to 3 -- "Pa inti ng" if the userlevel < 3 then exi t mouseUp - choose se lect tool doMenu "Select AI I" - doMenu "Select" set dragSpeed to 100 !""!"!'! drag from 256, 17 1 to 150, 171 drag from 150,171 to 350, 171 drag from 350, 17 1 to 256, 171 doMenu "Se lect Al l" - doMenu "Revert" choose browse tool set userleve l to s aveleve l - end mouseUp !""'!!!!! -~ Find J ( Print OK ( Cancel ) - - ti APPLE COMPUTER, INC. This manual and the software described in it are copyrighted, with all rights reserved. - Under the copyright laws, this manual or the software may not be copied, in whole or part, without written consent of Apple, except in the normal use of the software or to make a backup copy of the software. The same proprietary and copyright notices must be afftxed to any permitted copies as were afftxed to the original. This exception does not allow copies to be made for others, whether or not sold, but all of the material purchased (with all backup copies) may be sold, given, or loaned to another person. Under the law, copying includes translating into another language or format. You may use the software on any computer owned by you, but extra copies cannot be made for this purpose. The Apple logo is a registered trademark of Apple Computer, Inc. Use of the "keyboard" Apple logo (Option-Shift-K) for commercial purposes without the prior ~ written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. r r r ©Apple Computer, Inc., 1989 Linotronic is a registered trademark of 20525 Mariani Avenue Linotype Co. Cupertino, CA 95014-6299 POSTSCRIPT is a registered trademark, (408) 996-1010 and Illustrator is a trademark, of - Apple, the Apple logo, HyperCard, and Adobe Systems Incorporated. Macintosh are registered trademarks of Varityper is a registered trademark, - Apple Computer, lnc. and VT600 is a trademark, of AM HyperTalk is a trademark of Apple International, Inc. Computer, Inc. Simultaneously published in the lTC Zapf Dingbats is a registered United States and Canada. trademark of International Typeface - Corporation. r r r - ~ ~ ~ Contents -!"""l'l ~ 1""""1 !"""''' ~ """"' About This Guide ix ~ What you need to know to use this guide x ~ How to use this guide xi Conventions used in this guide xii ~ For more information xiii l!"'l'l!! 1 Getting Started 1 ~ Start up HyperCard 2 Set your user level 3 """" Create a practice stack 4 Set up the background 5 - Putting a title on the stack 6 Home, sweet Home 9 - Making a button 9 ~ Customizing the button 10 And now, a little scripting 12 Trying it out 14 - Buttons for traveling 15 !""'!'! Making two new buttons 15 Customizing the button on the right 16 - Customizing the button on the left 16 - Completing tl1e scripts 17 - iii ,..... ~ Fill out the stack 18 - Adding a label field 18 r Typing a label 19 Adding five new cards 20 I"""' A script to label all cards 20 Add a button to the Home card 22 !"""' What you've done so far 24 r 2 Special Effects 27 - Some visual effects 28 Adding graphics 29 - The Visual command 31 ~ Adding effects to the arrow buttons 31 Adding an effect to the Home button 33 ~ Adding the same effect to the My Stack button on the Home card 34 More experiments with visual effects 36 r Barn Door 36 Dissolve 38 The syntax of the Visual command 39 Some sound effects 40 Fo The syntax of the Play command 41 Specifying the notes 42 f"""! Dealing with long lines 43 F What you've done in this chapter 44 3 More About Messages 47 Sending messages 48 Create a "Receiver" button SO r Send a message with the Message box 51 Create a "Sender" button 52 !""""! Action at a distance 54 Remove the handler from the button script 55 - Move the handler to the card level 56 Move the handler to the background level 57 - Change the handler 58 It's a new command 60 iv Contents ,_ """"' Confirming actions 61 A disappearing act 61 - A command to put up an alert box 62 An additional action 65 - If structures 66 """"' What you've done in this chapter 67 Syntax summaries 69 Answer 69 - Hide 70 !!""!! Send 70 Set 71 """"' Show 71 Wait 72 """"' - 4 Fields, "It," and Other Containers 73 Fields as containers 74 - A simple calculation 75 ~ Set up the field s 75 Creating the ftrSt field 75 """"' Copying and naming the other fields 76 Labeling the fields on the card 78 - A calculating handler 79 Test the handler 82 - The handler with conunents 83 Other containers 84 - The Message box 84 The selection 84 - Variables 85 """' A few words about functions 86 What you've done in this chapter 87 Syntax summaries 88 - The arithmetic commands 88 - Get 89 Put 90 !!"!"' ~- """"' - Contents v 5 Animation 91 - Animation on a single card 92 Make something to animate 92 Drawing a circle 92 Drawing a smaller circle inside the frrst one 93 Filling in the smaller circle 95 Write a handler to use tools and menu commands 96 Finding the starting point 96 r- Finding the ending point 97 Making a button and completing the handler 98 - Trying it out 99 Repeat structures 100 Animation using several cards 101 r Set up the cards 101 Copying and pasting the image once 101 I"""" Adding more cards 102 ,.... Copying and pasting the image twice more 103 Write a handler to show the cards 103 Another way to control the spin 105 r Some fmishing touches 106 What you've done in this chapter 107 - Syntax summaries 109 ~ Choose 109 DoMenu 109 r Drag 110 Show Cards 110 ~ r 6 Stacks You Can Build 111 r"""! A travel records stack 112 Creating the stack 113 The second background 115 r The third background 117 How the stack would work 118 r r r r vi Contents r r !"!""'! - A flash card stack 120 Creating the stack 120 - Features of the stack 122 The scripts 124 - The stack script 124 !"!"'!!'! The background script 125 The bunon scripts 126 !""'!!~ How the stack would work 127 Where to go from here 128 """" Jl!!!!!!!l Appendix Jl!!!!!!!l HyperTalk Summary 129 Syntax statement notation 130 Commands 130 - Functions 133 Keywords 137 - Properties 138 Constants 140 - System messages 141 !!"!!"'! Operator precedence 142 Shortcuts for seeing scripts 143 - Synonyms and abbreviations 143 """" Glossary 145 - Index 148 - Quick Reference Card - -1""!!!11 - - Contents vii - p R E F A c E About This Guide WcCOME TO THE HYPERTALK BEGINNER'S GUIDE. THIS GUIDE PROVJDES YOU 1 - with a starting point for exploring HyperTalk M, the language that's built into HyperCard® software. With HyperTalk, you can write your own instructions, called scripts, for HyperCard to carry out. Writing scripts is - called scripting. You can create, customize, and personalize HyperCard stacks without learning how to write scripts; but scripting with HyperTalk allows you even more control over what your computer can do for you. - ix If writing scripts sounds a lot like programming to you, you're right-they are very similar; however, you do not need any previous experience with programming to be able to write scripts. If you can read this paragraph, then you can write a script. This guide introduces you to some basic scripting using a practice stack you - create yourself. In this stack, you'll learn how to write scripts for traveling - between cards, creating special effects, simulating animation, performing calculations, and more. Later on after you've completed this book, you can - use your practice stack on your own as a place to try out new scripts. What you need to know to use this guide To get the most out of this guide, you should already know the basics of using your Macintosh® computer; for instance, how to use the mouse and r the icons on the screen. You should also be familiar with how to get around in HyperCard. If you have gone through the first three or four chapters of - the HyperCard User's Guide, you probably know enough to begin. Specifically, you should know how to use buttons to get around in stacks r and how to use the HyperCard menus and tools. You should have browsed through some stacks, looked through part of the Help system, and perhaps personalized a stack-for example, you might have used the Address stack to store some information. If you already have experience with programming in another language, you r""'' might want to go directly to the HyperCard Script Language Guide.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    166 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us