Your SlideShare is downloading. ×
Programming scripting
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Programming scripting

296
views

Published on

Published in: Education, Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
296
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PROGRAMMING SCRIPTING
    Action Script 2.0
  • 2. ACTION SCRIPT 2.0
    Merupakan bahasa pengaturcaraan berasaskan objek (objek oriented programming)
    Ianya boleh dibina/dibentuk sendiri selain menggunakan Action Sript yang sedia ada
    Ia digunakan kepada ‘objek’ iaitu:
  • ANIMASI
    Animasi merujuk kepada proses menghidupkan sesuatu yang statik agar kelihatan dinamik. Macromedia Flash menawarkan pelbagai teknik dan kaedah membina animasi berdasarkan perubahan yang berlaku di antara satu frame dengan frame lain.
  • 5. Pelbagai jenis animasi dapat dihasilkan dengan pengunaan ActionScript. Pengunaan ActionScript tidak melibatkan banyak pengunaan grafik. Apa yang dilakukan di sini ialah memaklumkan tindakan (Action) yang perlu dilaksanakan bagi sesuatu peristiwa (event) itu berlaku. ActionScript membenarkan pengguna untuk mereka movie interaktif yang dimainkan dalam turutan nonlinear dan respon terhadap input pengguna daripada keyboard atau mouse.
  • 6. Mengapa Perlu Belajar ActionScript?
    Selain mengetahui kod disebalik Flash, ActionScript juga berguna di dalam membangunkan aplikasi interaktif tambahan terhadap movie yang dibina atau menggerakkan objek dari satu kedudukan ke kedudukan lain.
  • 7. Bagaimana Menulis ActionScript?
    Menulis ActionScript adalah tidak lain daripada menulis arahan. Setiap arahan yang dimasukkan memaklumkan kepada Flash untuk melakukan sesuatu secara spesifik. Contohnya, “play”, “stop”, “or” dan sebagainya. Dengan menentukan arahan bagi setiap baris ActionScript secara spesifik, membenarkan pengguna mencantumkan dan menghasilkan arahan yang lebih baik. Tetapi  harus di ingati bahawa setiap “sentence”( baris kod) merupakan arahan yang tunggal.
  • 8. ActionScript berasaskan masaialah apabila arahan actionscript dimasukkan pada frame. Action yang diarahkan akan dimainkan apabila playhead sampai pada frame yang mengandungi action.
    ActionScript berasaskan penggunaberlaku apabila butang action mengandungi arahan actionscript . Action yang diarahkan pada butang dimainkan apabila pengguna memberi input, biasanya dalam bentuk mouse event
  • 9.
  • 10. Action Toolboxmengandungi action atau script yang telah sedia ada dalam Flash
    Script Pane memaparkan turutan action yang dimasukkan
    Script Navigatormemaparkan semua script dalam movie pada scene & timeline
    • Selain daripada di Action Toolbox, anda juga boleh memilih action yang diperlukan dengan menekan butang Add Statement
  • 10
    Actions
    Tell Flash to do something
    Frame actions
    Object actions
    Actions also can have parameters
  • 11. 11
    gotoAndPlay
    This frame action sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.
  • 12. 12
    Functions
    Perform a specific task
    Like in a spreadsheet program (Excel)
  • 13. 13
    getVersion
    Returns the Flash Player version number and operating system information.
    You can use this function to determine whether the Flash Player that is in use can handle your Actionscript.
  • 14. 14
    Properties
    All available information about an object
    You can use ActionScript to read and modify object properties
    All property names begin with an underscore (e.g., _visible)
  • 15. 15
    _visible = false
    This property make an object invisible
    Assign the following action to a button…
    On (release) {
    _visible = false;
    }
    Button disappears on mouse click
  • 16. 16
    Method
    Similar to actions in that they effect objects
    Built into objects
    Invoked (Executed) through dot notation
  • 17. 17
    RocketMC.gotoAndPlay(“BlastOff”);
    ActionScript notation must end in ;
    Movie clip Rocket MC goes to a frame labeled BlastOff and plays
  • 18. 18
    Variables
    hold data for use in your Flash movies
    Variables can hold any type of data
    You could store:
    User name
    Result of calculation
    True or false value
  • 19. 19
    Expressions
    An expression is any statement that Flash can evaluate and that returns a value.
    You can create an expression by combining operators and values or by calling a function.
  • 20. 20
    Operators
    Expressions use operators to tell Flash how to manipulate the values in the expression.
    They are the commands that say “add these values” or “multiply these numbers”
  • 21. 21
    Some types of operators
    Assignment:
    are used to assign values to variables.
    The most common is (=). It makes the variable on the left equal to the value of the variable or expression on the right.
    Comparison and equivalence:
    (<), (>), (< =)
    Numeric:
    perform mathematical operations on values
  • 22. 22
    Looping
    When you need to repeat certain actions in your movies more than once.
    Makes coding more efficient, using the same set of commands as many times as necessary to complete a task.
  • 23. 23
    Looping examples
    while
    Creates a loop that continues to repeat as long as a condition remains true
    for
    Creates a loop that executes a specific number of times using a counter
    for…in
    Creates a loop that executes once for each member of a group of objects (class)
    This makes certain that the entire group of objects is processed in the same way
  • 24. 24
    Hints
    Before you begin writing scripts, formulate your goal and understand what you want to achieve.
    Planning your scripts is as important as developing storyboards for your work.
    Start by writing out what you want to happen in the movie, as in this example:
    I want to create my whole site using Flash.
    Site visitors will be asked for their name, which will be reused in messages throughout the site.
    The site will have a draggable navigation bar with buttons that link to each section of the site.
    When a navigation button is clicked, the new section will fade in at the center of the Stage.
    One scene will have a contact form with the user's name already filled in.