Archive for the ‘AS2’ Category

Array.length is a read-write property.

Saturday, February 16th, 2008
Array.length is a read-write property. I should’ve know it.
I just thought it was a read-only property. I came to know it reading a copy of EAS3.0.
Array.length 속성이 리드-라이트 였네요. 이런걸 지금까지 모르고 있었다니…
당연히 Read-only일 거라고 생각하고 있었는데, EAS3.0을 보다가 알게 되었네요.
Array.lengthがread-write属性だったんですね。なぜ今まで知らなかったんだろう……
当然read-onlyだと思っていったのに、EAS3.0を読みながら分かった。

length property
length:uint [read-write]

Language Version : ActionScript 3.0
Player Version : Flash Player 9

A non-negative integer specifying the number of elements in the array. This property is automatically updated when new elements are added to the array. When you assign a value to an array element (for example, my_array[index] = value), if index is a number, and index+1 is greater than the length property, the length property is updated to index+1.

Note: If you assign a value to the length property that is shorter than the existing length, the array will be truncated.

quote from ActionScript 3.0 Language Reference

1
2
3
4
var arr:Array = new Array(0, 1, 2, 3, 4, 5, 6);
trace(arr);// output 0,1,2,3,4,5,6
arr.length = 4;
trace(arr);// output 0,1,2,3
If the newly assigned length is shorter than the existing value, items whose index is larger than the length will be removed from the array and the array will be shortened to the specified length. In some cases, it is more useful than Array.slice() or Array.splice() methods.
위와 같이 length에 현재 길이보다 작은 값을 입력하면, length 이후의 아이템들을 제거하고 배열이 입력받은 길이로 줄어들게 됩니다. 경우에 따라서는 Array.slice(), Array.splice() 보다 유용할 것 같네요.
若し、新しいlengthが現在のlengthより少ないと、それ以後の配列要素は取り去れて、その配列の長さは短くなります。時折Array.slice()やArray.splice()メソッドより便利そうです。

tweener

Wednesday, November 28th, 2007
Yesterday, jin_u told me about Tweener. Tweener is an open source(MIT License) library for tweening in ActionScript 2 and 3. It has more features than the Flash native Tween class.

For more informaton, visit the official website at Google Code and Tweener Documentation and Language Reference.

어제 사내 스터디에서 진우Tweener에 대해서 알려주었습니다. Tweener는 액션스크립트 2와 3에서 트위닝을 위한 오픈소스(MIT 라이센스) 라이브러리입니다. 플래시 내장 Tween 클래스보다 많은 기능을 가지고 있네요.

자세한 정보는 Google Code의 공식 홈페이지Tweener 도움말을 참고하세요.

昨日jin_uからTweenerについて聴いた。Tweenerはオープンソース(MIT License)ライブラリーとしてtweening機能を提供します。このクラスはフラッシュ内蔵クラスより機能が多いんです。

詳しい情報はGoogle Codeの公式ホームページ、またはTweenerマニュアルへ…

Dynamic MovieClip Registration with AS3 & AS2

Friday, March 16th, 2007

DYNAMIC MOVIECLIP REGISTRATION WITH AS3 - Oscar Trelles

Dynamic MovieClip Registration with AS2 - Darron Schall

ActionScript 2.0 to 3.0 Migration Cheatsheets!

Friday, March 2nd, 2007
This is AS2 to AS3 migration cheatsheets from actionscriptcheatsheet.com.

as3cs_migration.pdf

actionscriptcheatsheet.com에서 제작한 AS2에서 AS3로 가면서 바뀐 클래스나 메소드, 프로퍼티들을 정리해 놓은 문서입니다.

Preloading Files into the Browser’s Cache

Friday, January 26th, 2007

이미지 등을 플래시로 직접 로드하지 않고 브라우저의 캐쉬로 로드하여, 필요할 때 빨리 로드가 가능하도록 해주는 클래스입니다.

LoadVars를 이용한 트릭을 사용했다고 하네요.

Preloading Files into the Browser’s Cache