오

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

· 2004-06-24 (목) 10:42:10 · 2656
자 이번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;
}
}

첨부파일

|
댓글을 작성하시려면 로그인이 필요합니다.

그누3 팁자료실

1,026건
+
제목 글쓴이 날짜 조회
04-06-28 조회 2,942
04-06-27 조회 3,231
04-06-26 조회 3,036
04-06-25 조회 3,021
04-06-25 조회 3,339
04-06-25 조회 2,879
04-06-25 조회 3,039
04-06-25 조회 2,773
04-06-25 조회 2,735
04-06-25 조회 3,310
04-06-24 조회 2,657
04-06-24 조회 2,638
04-06-24 조회 2,854
04-06-23 조회 2,838
04-06-23 조회 2,829
04-06-23 조회 2,878
04-06-23 조회 3,025
04-06-23 조회 3,487
04-06-22 조회 4,211
04-06-21 조회 3,210