Luar's Flash Playground:將Flash 6 ActionScript Export為Flash 7要注意地方
新聞(100)
觀點或評論(93)
Flash書(63)
教程(65)
Design Patterns(3)
FlashCom筆記(45)
Flash Remoting筆記(27)
Flex筆記(11)
Flash Lite筆記(14)
PHP資訊(22)
Ajax筆記(9)
習作(47)
組件(15)
酷站(31)
學習資源(28)
書籍推介(15)
本站與我(90)
RSS瀏覽器
聯絡
熱愛鑽研
Ajax
ActionScript
Flash
Flash Lite
Flex
Flash Remoting
FlashCom
Director
Lingo
PHP
Multiplayer Game

搜尋
VCASMO
將Flash 6 ActionScript Export為Flash 7要注意地方 (25-09-2003)
我自己都遇過這問題,有一些以前在Flash 6運作正常的ActionScript,只是Export為Flash 7後便無法運作,但用Flash Player 6去播放,又運作正常,難道Flash Player 7對兼容舊Flash 6 ActionScript有問題?原來不是,只是自己的不良編程習慣所致!Flash 7對ActionScript編程語法要求嚴謹了很多:
  • Case Sensitive,無論是Variable、Function、ActionScript指令,大小草都是有分別!例如math.cos()是錯,應該是Math.cos();
  • 未定義的Number會返回NaN,不像過往返回0,例如:

    Flash 7:
    myCount +=1;
    trace(myCount); // NaN

    Flash 6:
    myCount +=1;
    trace(myCount); // 1
     
  • Undefined的值轉為String會返回Undefined而不是""(Empty String),例如:

    Flash 7:
    firstname = "Luar ";
    lastname = "Yen";
    trace(firstname + middlename + lastname); // Luar undefinedYen

    Flash 6:
    firstname = "Luar ";
    lastname = "Yen";
    trace(firstname + middlename + lastname); // Luar Yen
本文章由luar發表。
同組文章

Movable Type 3.15系統支持,Luar's Production版權所有。