Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AS3 Better Practices

3,370 views

Published on

Published in: Technology
  • Be the first to comment

AS3 Better Practices

  1. 1. AS3 Better Practices
  2. 2. http://blog.eddie.com.tw aquarianboy@ptt eddie@adcube.com.tw aquarianboy@plurk eddiekao@facebook
  3. 3. !
  4. 4. (F1) Flash/ActionScript RTFM, please :)
  5. 5. Google ...
  6. 6. flash
  7. 7. Designers: Programmers: - logo cup.holder = true; - cup.render_texture = "blue"; - ...( ) cup.render_logo = new Puppy();
  8. 8. fla
  9. 9. Flash Flash ! Flash XD!
  10. 10. :)
  11. 11. !
  12. 12. ? !
  13. 13. Better Practices
  14. 14. !
  15. 15. -http debugger : httpfox
  16. 16. SVN/Git/Dropbox
  17. 17. FLA ( )
  18. 18. Preload ? http://www.prettyloaded.com/
  19. 19. 1KB !
  20. 20. Flash IDE
  21. 21. Fla ( Flash )
  22. 22. JPEG Quality 50~60 OK!
  23. 23. function/method
  24. 24. Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
  25. 25. ? var :Tank = new Tank(); . (); !
  26. 26. frame-based looping
  27. 27. Switch if/else
  28. 28. listener !( )
  29. 29. Timer interval!
  30. 30. ( )
  31. 31. var my_array:Array = [1, 2, 3, 4, 5]; // general way for (var i:int; i<my_array.length; i++) { ..... } // better way var len_of_array:int = my_array.length; for (var i:int; i<len_of_array; i++) { ..... }
  32. 32. uint int
  33. 33. int number
  34. 34. function preloader, xml loader..etc
  35. 35. CPU
  36. 36. getter & setter
  37. 37. null It is better to delete variables than to set them to null.
  38. 38. trace() ( Omit Trace Actions)
  39. 39. (inheritance) method call
  40. 40. A.swf B.swf B.swf unload B.swf delete foo.bar.CustomClass
  41. 41. Sprite MovieClip
  42. 42. DON’T import flash.display.*
  43. 43. Flash user agent user_agent =~ /^(Adobe|Shockwave) Flash/
  44. 44. Refactoring...? That’s another story :)
  45. 45. Thank You!

×