Some methods newly added to Array calss in AS3 will save time to code “for” loops.
Adobe should have introduced them earlier…
AS3의 Array 클래스에 새로운 메소드들이 등장하면서 for 루프 돌리는 일이 많이 줄어들 것 같네요 ^^
더 빨리 나왔어야 했는데…

every(callback:Function, thisObject:* = null):Boolean
Executes a test function on each item in the array until an item is reached that returns false for the specified function.

some(callback:Function, thisObject:* = null):Boolean
Executes a test function on each item in the array until an item is reached that returns true.

filter(callback:Function, thisObject:* = null):Array
Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function.

forEach(callback:Function, thisObject:* = null):void
Executes a function on each item in the array.

indexOf(searchElement:*, fromIndex:int = 0):int
Searches for an item in an array by using strict equality (===) and returns the index position of the item.

lastIndexOf(searchElement:*, fromIndex:int = 0x7fffffff):int
Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===).

quote from ActionScript 3.0 Language and Components Reference

 

6월 9일에 친구랑 강원도 하조대에 다녀왔습니다.
경치가 좋아서 EV-W100으로 몇 컷 찍었는데, 화질은 그럭저럭이네요.

하조대 해수욕장 하조대 하조대 하조대 하조대 하조대

 

Ghost-corps에서 제작 및 공동운영하고 있는 남성의류 쇼핑몰입니다.
사장님의 강력한 요청에 의해 사이트 링크 걸어둡니다 ㅋㅋㅋ

lindo.co.kr

http://lindo.co.kr

 
1
2
3
4
for(var i:uint=0; i<numChildren; i++){
	var mc:MovieClip = getChildAt(i);
	trace(mc.x, mc.y);
}
This code causes the type mis-match error at compile, because getChildAt() method returns a DisplayObject.
위 코드는 컴파일 시에 다음과 같은 타입 미스매치 에러를 냅니다. 왜냐하면 getChildAt()메소드는 DisplayObject 객체를 리턴하기 때문이죠.

1118: Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip.

To avoid the compile error, you can cast the returned value as MovieClip like this.
이러한 컴파일 에러를 회피하기 위해 다음과 같이 리턴된 값을 MovieClip로 캐스팅합니다.
1
var mc:MovieClip = MovieClip(getChildAt(i));
You can also use “as”.
또는 “as”를 사용할 수 있습니다.
1
var mc:MovieClip = getChildAt(i) as MovieClip;
 

몇 일 사이에 보고 싶은 책들이 갑자기 많이 생겨났다.
아… 또 책값이 10만원 넘어가게 생겼네…

EAS3.0은 액션스크립터로서 함 봐줘야 하겠고,
워렌 버핏 책은 전에부터 보고 싶었던 책이고,
나루토는 안 볼수 없고,
디아블로 씨리즈도 다 읽었으니, 계속 읽어 줘야 겠고…

Essential ActionScrip 3.0 – Colin Moock
The Essays of Warren Buffett : Lessons for Corporate America – Warren E. Buffett
Naruto 巻の三十八 – 岸本斉史
Diablo: The Sin War #1: Birthright: Birthright – Richard A. Knaak
Diablo: The Sin War #2: Scales of the Serpent – Richard A. Knaak
Diablo: The Sin War #3: The Veiled Prophet – Richard A. Knaak

그나저나 스타2도 나오는데, 디아3는 언제나 나올라나???

© 2011 Hangun's World - Blog Suffusion theme by Sayontan Sinha