Monthly Archive for August, 2006

Page 2 of 2

ActionScript 3.0 Tip of the Day

[퍼온글] 출처 : http://www.kirupa.com/forum/showthread.php?t=223798

The release of Flex Builder 2 is around the corner and though the next version of Flash is still a ways away, ActionScript 3 will be a big part of Flex 2 and the impending release of Flash Player 9 (which arrives with Flex). ActionScript 3 is the next step forward and to help with the transition (for those of you deciding to make it), I thought, since I’ve been working with AS3 a bit lately, I’d make a new Tip of the Day thread for ActionScript 3 to help people prepare. So here we go:

ActionScript 3 Tips and Tricks:

  1. 06-19-06: Change the frame rate of your movie
  2. 06-20-06: Class scope is now bound to class methods
  3. 06-21-06: Graphics Object and the Drawing API
  4. 06-22-06: New Variable Types
  5. 06-23-06: Display Objects
  6. 06-24-06: New Import Directive
  7. 06-25-06: Type Casting and the as Operator
  8. 06-26-06: Unique Class Variables
  9. 06-27-06: New MouseMove Behavior
  10. 06-28-06: The delete Keyword and Class Members
  11. 06-29-06: The Dictionary Class
  12. 06-30-06: Label Statements
  13. 07-01-06: Detecting When the Mouse Leaves the Movie
  14. 07-02-06: SimpleButton Instances
  15. 07-03-06: Commas in Shorthand Array Definitions
  16. 07-04-06: Package Block
  17. 07-05-06: Same-file Helper Classes
  18. 07-06-06: Access Attributes
  19. 07-07-06: Abstract Classes
  20. 07-08-06: The override Keyword
  21. 07-09-06: Using prototype
  22. 07-10-06: Regular Expression (RegExp) Support
  23. 07-11-06: Approach to Depth Sorting
  24. 07-12-06: Deep Object Copies with ByteArray
  25. 07-13-06: Similarly Named Instance and Static Properties
  26. 07-14-06: EventDispatcher
  27. 07-15-06: Events and Event Types
  28. 07-16-06: Writing Inline XML
  29. 07-17-06: Determine Instance Class or Superclass
  30. 07-18-06: super() Placement (Now Anywhere)
  31. 07-19-06: Determining Current Frame Label
  32. 07-20-06: Multiple Arguments in trace()
  33. 07-21-06: Calling Event Handlers without Events
  34. 07-22-06: URLRequest for URL Strings
  35. 07-23-06: XML vs. XMLDocument
  36. 07-24-06: Loading Text and XML with URLLoader
  37. 07-25-06: is Operator (vs instanceof)
  38. 07-26-06: Flash 9: Timelines as Classes
  39. 07-27-06: RegExp: Email Validation
  40. 07-28-06: Render Event
  41. 07-29-06: XML: @ Operator for Attributes
  42. 07-30-06: Event Propagation Support
  43. 07-31-06: Get Sound Spectrum Information
  44. 08-01-06: Number() Conversion No Longer Interprets Octals
  45. 08-02-06: Garbage Collection: Reference Counting & Mark and Sweep
  46. 08-03-06: Weak References
  47. 08-04-06: Flash 9: BitmapData and Bitmaps from the Library
  48. 08-05-06: Changes in typeof
  49. 08-06-06: getBounds() vs getRect()
  50. 08-07-06: for..in and for each..in

_______________________________________

Additional Resources:

Download:

ExternalInterface bug (Firefox)

Just a quick warning to people using ExternalInterface. When you are calling Javascript functions that open new windows your Flash movie will lose all mouse interaction (no rollovers etc) and the button you pressed to open the popup will stick on its “over” state. This is only in Firefox, (and possibly only when the popup contains a Flash movie, tbc).

flash8 에 새로운 External API. 인 ExternalInterface…..

실무에 적용하여 사용한적은 없는것 같다. 그다지 쓰이지 않아서 그런진 몰라도…

Firefox에서 새로운 팝업창에서의 플래시 무비가 전혀 마우스 반응을 하지 못하는 버그가 있다.

팝업창을 사용하지 않는것이 좋겠지만 어쩔수 없이 사용해야할 경우, 그리고 꼭 firefox에서도 지원해야할경우

이때는 간단히 getURL 로 javascript 호출하면 된다.

Alpha Gradiant Masks

flash8 이 출시된지 반년 이상이 지났다.
정말 출시전에는 엄청난 기능상의 변화, 그리고 놀라운 퍼포먼스의 향상과 같은 프리뷰 내용으로 잔뜩 기대감에 부풀어 있었지만 정작 뚜껑을 열어보고 사용해보니 기대가 너무 컸던 탓일까…
지금에 와서는 좀 아쉬는 생각이 든다.
플래시에서도 photoshop과 같은 필터효과를 줄 수 있다라는 말에 정말 이젠 플래시로 표현 못하는것이 없겠구나 하는 했지만….원하는 정도의 효과를 사용한다면 너무 느려지는 퍼포먼스로 인해 도저히
봐줄수 없는 상태……

물론 BitmapData 의 도입으로 기존에는 할수 없었던 것들을 할수있다.
하지만 게으름때문인지는 몰라도 이런 위의 문제점으로 성능상에 문제가 있을거야 하는 내나름의 한계를 그어버리는 건지도 모른다. as3.0이 본격적으로 사용되면 최대 9배 이상의 성능향상이 있다고 한다. 그렇게 되면 핑계도 없어질텐데….
정말 해봐야 할것 많은데…몸이 따라주질 않는다..

전에 한번 flash 8 에서 비트맵을 지원해서 Mask 에서도 alpha 값을 사용할 수도 있다는 내용을 본적이 있어 이것저것 테스트 해보았는데 정말 alpha gradiant 를 Mask 에서도 사용할수 있었다.

maskee.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;

actionscript 에서 적용하려면 mask 무비클립과 mask 되어지는 무비클립에 cacheAsBitmap 을 적용해 비트맵으로 전환한다.
그리고 alpha gradiant  를 적용할 mask를 제작하여 적용하면 된다.

movieclip property 창에서 적용할 수도 있다. Use runtime bitmap caching 을 체크해주면 위와 똑같은 기능을 한다.

flash를 사용할때면 alpha 값이 적용된 mask를 꼭 한번 사용할 일이 있을것이다.
그때 잊지말고…..

Static textfield Error

static textfield 를 사용하여 텍스트를 사용할 경우 한가지 주의하야할 사항이 있다.
영문은 해당하지 않고 한글을 사용할때의 문제다.

짧은 내용의 글을 입력할 때는 상관이 없다. 하지만 anti-alias 정보가 많이 포함되는 텍스트일 경우,
즉 텍스트의 길이가 어느정도 이상일경우 보이지 않는 현상이 발생한다.
flash MX2004 때에도 이런 문제가 있었는데 여전히 고쳐지지 않았다.

static field 를 사용해서 이문제를 해결하려면 device font 를 사용하는 수 밖에 없다.
이런 문제로 사용자가 지정한 폰트를 사용할 수 없다면 여간 화가 나는 상황일 수 밖에 없다.
따라서 dynamic textfield 를 사용하여 text 를 embed 해야한다. 물론 폰트크기에 따라 늘어나는 용량은 감안해야한다.

요즘같이 인터넷 대역폭이 많이 개선된 상황에서는 100-200k 용량 늘어나는 것이 그다지 큰 부담이 되지는 않겠지만 그래도 단지 버그로 인해 폰트를 임베는 한다는 것이 좀 찜찜하다.

한글….참 과학적이고 조형적인 글자라고 한다….하지만 이럴때 정말 한글을 쓴다는 것이 참 원망스럽다. 정말 혁신적인 한글문자 조합이 나와 영문과 같이 조합형의 구성으로 표현하지 않는한…..
이런 문제가 해결될 수 있을까…….?

(주의점…..한가지 dynamic textfield 를 사용할경우 꼭 multiline 으로…)