Top Banner

Click here to load reader

of 66

第 20 章

Jan 03, 2016

Download

Documents

aiko-woodard

第 20 章. ActionScript 指令與語法. 本章提要. 20-1 變數與變數範圍 20-2 資料類型 20-3 運算子 20-4 判斷條件與迴圈 20-5 Flash 的路徑階層觀念. 20-1 變數與變數範圍. 變數 是用來讓程式暫存資料的 , 變數中所存的資料就叫做變數的「值」 , 變數的值可以是字串、數字、布林值 ... 等資料 ( 關於資料型態請參考 20-2 節 ) 。在使用變數時 , 必須要注意變數的有效範圍 , 否則可能造成程式運作結果錯誤。 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 20-1 20-2 20-3 20-4 20-5 Flash

  • 20-1 , , ... ( 20-2 ), , Flash , , Flash , , ,

  • ActionScript , var Flash, , , Flash ,

  • , (), , , ( Java C...) ActionScript

  • varvar , /,

  • var

  • var

  • ActionScript , Flash Unicode (), Flash , (JavaScriptASPPHP...) , _ () ,

  • ActionScript (playstopgoto...), (truefalse), my , , myComputer, myPlay,

  • , carCARCar, , , myScore, a1a2x ...,

  • set variableset variable , /,

  • set variable

  • set variable

  • ActionScript 3 , (function ) ,

  • , , , (20-5 ), , ,

  • trace myVar1 10 , myVar2 undefined (), myVar2 , testVar

  • Flash , () ,

  • , (),

  • , Actions , ActionScript , [Ctrl] + [Enter]

  • , , , , ,

  • 20-2 ActionScript () , Nullundefined,

  • " "' ', , ,

  • typeof (/) , myData

    String,

  • ().-

  • , true (), false (),

    10

  • NullNull , null, , , , ...

  • undefinedundefined , undefined, undefined (), , undefined

  • ActionScript , (Properties) (Method), fish X , myVar

  • ActionScript , Flash ActionScript , , ,

  • ActionScript , , Flash , ,

  • 20-3 , , ActionScript , , , =, ActionScript , , =

  • Flash , 3

  • 20-4 , , / / , if ,

  • if if true , , false , if , , , , ( true false), if

  • if

  • if

  • Flash , Flash , , goto 5 , 1 goto 3 , 3 1

  • Flash , 5 , ,

  • 20-5 Flash ActionScript () , (), , ActionScript , Flash , Flash , , ActionScript

  • Flash 19 , Flash stop goto /, ,

  • Flash , ActioinScript (19-4 ) Flash , Flash , ActionScript

  • Flash , , Flash (level) _root, 19-4 19-02.fla , ,

  • _root, _level0 _level0 ( 0 ), _level1_level2 loadMovie (//) Flash (.swf) , .swf

  • Flash , , .swf ( _level0),

  • , _root, _level1 _root.stop();, , _level1 level0 _level0.stop(); , _level0

  • 6 , () ActionScript , , (depth) ( Z , ),

  • duplicateMovieClip attachMovie , , , swapDepths , Flash

  • , 1 ,

  • ActionScript , , ActionScript ActionScript 2.0 //MovieClip/ gotoAndStop

  • , , , loadMovie , ActionScript .swf , , , ,