Flash&ActionScript/ActionScript
2010/03/05 23:24
액션스크립트 깊이 더하기
for each, for in
var info:Object =new Object();
info.city="toronto";
info.country="canada";
순환문으로 변수값 접근하기
for each(var detal:* in info) {
trace(detail);
}
변수명 알아내기
for (var detailName:* in info) {
trace(detailName);
}
속성값 접근
for (var detailName:* in info) {
trace(info[detailName]);
}
순환문 피하기
info.setPropertyIsEnumerable("city",false);
for (var detailName:* in info) {
trace(info[detailName]);
}
info.city="toronto";
info.country="canada";
순환문으로 변수값 접근하기
for each(var detal:* in info) {
trace(detail);
}
변수명 알아내기
for (var detailName:* in info) {
trace(detailName);
}
속성값 접근
for (var detailName:* in info) {
trace(info[detailName]);
}
순환문 피하기
info.setPropertyIsEnumerable("city",false);
for (var detailName:* in info) {
trace(info[detailName]);
}
try {
예외가 발생할 수 있는 문장
} catch(error type) {
예외처리
} catch(error type) {
예외처리
} finally {
반드시 실행할 명령
return;//이후 문장 미처리
}
예외가 발생할 수 있는 문장
} catch(error type) {
예외처리
} catch(error type) {
예외처리
} finally {
반드시 실행할 명령
return;//이후 문장 미처리
}
prototype 객체 변수
SomeClass.prototype.doFunc = function():String{
return "동적추가";
}
var ins:SomeClass = new SomeClass();
trace(ins.doFunc());
return "동적추가";
}
var ins:SomeClass = new SomeClass();
trace(ins.doFunc());

