오

기초 플래시 강좌 - 액션 스크립트3

· 2004-06-24 (목) 10:42:10 · 2714
자 이번3에서도 앞서 1,2탄과 같은 내용에 약간의 응용만 한것입니다.

이제는 스테이지를 벗어나지 못하도록 막아봅시다.
참고로 이것은 실제 사용하는 소스가 아닌 이해도를 높히는 소스입니다.
차원이 높은 스크립트를 써야하지만 아직은 무리겠지요 ㅎㅎ

심벌을 중심으로 바깥으로 나가지 못하게 합니다.
아래 스크립트2에서 추가해봅시다.

_root.l_u_b.onRelease=function(){
_root.ggamagi._x-=10;
_root.ggamagi._y-=10;
_root.ggamagi._rotation=300;

if(_root.ggamagi._x<=0 ){
_root.ggamagi._x+=10;
}
if(_root.ggamagi._y<=0 ){
_root.ggamagi._y+=10;
}
}
_root.r_u_d.onRelease=function(){
_root.ggamagi._x+=10;
_root.ggamagi._y-=10;
_root.ggamagi._rotation=60;

if(_root.ggamagi._x>=500 ){
_root.ggamagi._x-=10;
}
if(_root.ggamagi._y<=0 ){
_root.ggamagi._y+=10;
}
}
_root.l_d_b.onRelease=function(){
_root.ggamagi._x-=10;
_root.ggamagi._y+=10;
_root.ggamagi._rotation=210;

if(_root.ggamagi._x<=0 ){
_root.ggamagi._x+=10;
}
if(_root.ggamagi._y>=400 ){
_root.ggamagi._y-=10;
}
}
_root.r_d_b.onRelease=function(){
_root.ggamagi._x+=10;
_root.ggamagi._y+=10;
_root.ggamagi._rotation=120;

if(_root.ggamagi._x>=500 ){
_root.ggamagi._x-=10;
}
if(_root.ggamagi._y>=400 ){
_root.ggamagi._y-=10;
}
}

첨부파일

댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
04-06-28 조회 2,986
04-06-27 조회 3,286
04-06-26 조회 3,086
04-06-25 조회 3,065
04-06-25 조회 3,398
04-06-25 조회 2,940
04-06-25 조회 3,082
04-06-25 조회 2,821
04-06-25 조회 2,779
04-06-25 조회 3,354
04-06-24 조회 2,715
04-06-24 조회 2,680
04-06-24 조회 2,901
04-06-23 조회 2,892
04-06-23 조회 2,874
04-06-23 조회 2,919
04-06-23 조회 3,068
04-06-23 조회 3,524
04-06-22 조회 4,251
04-06-21 조회 3,262