기초 플래시 강좌 - 액션 스크립트3 > 그누3 팁자료실

그누3 팁자료실

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

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

첨부파일

위치제어_화면제어_완성.fla (18.5K) 17회 다운로드 2004-06-24 10:42:10

본문

자 이번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;
}
}
추천
0

댓글 전체

전체 1,026
그누3 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT