ActionScript Elements

ActionScript là một ngôn ngữ mà các cầu khoảng cách giữa những gì bạn hiểu và hiểu những gì Flash. Như vậy, nó cho phép bạn cung cấp cho cả hai hướng dẫn hành động theo định hướng (làm điều này) và hướng dẫn theo định hướng logic (phân tích này trước khi làm điều đó) trong dự án Flash của bạn. Giống như tất cả ngôn ngữ, ActionScript chứa nhiều yếu tố khác nhau, như từ ngữ, dấu chấm câu, và cơ cấu-tất cả trong đó bạn phải sử dụng đúng cách để có được dự án Flash của. | ActionScript Elements ActionScript is a language that bridges the gap between what you understand and what Flash understands. As such it allows you to provide both action-oriented instructions do this and logic-oriented instructions analyze this before doing that in your Flash project. Like all languages ActionScript contains many different elements such as words punctuation and structure all of which you must employ properly to get your Flash project to behave the way you want it to. If you don t employ ActionScript correctly you ll find that interactivity either won t occur or won t work the way you intended. Many of these elements as well as several other elements such as logical statements and expressions will be covered in more detail throughout the book. To begin to understand how ActionScript works look at this sample script which contains many of the essential elements that make up a typical script. After the script is a discussion of these elements and their role in the script s execution. We can assume that this script is attached to a button on release set the cost of the mug var mugCost Number set the local sales tax percentage var taxPercent Number .06 determine the dollar amount of tax var totalTax Number mugCost taxPercent determine the total amount of the transaction var totalCost Number mugCost totalTax display a custom message The total cost of your transaction is totalCost send the cashRegister_mc movie clip instance to frame 50 cashRegister_mc .gotoAndPlay 50 Although at first glance this may look like Latin once you become acquainted with some of its elements you ll understand. NOTE Other script elements for example objects functions loops properties and methods are discussed in detail throughout the book. Events Events occur during the playback of a movie and trigger the execution of a particular script. In our sample script the event that triggers the script is on release . This event signifies that when the button to

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
31    85    2    19-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.