태그자료

스위시맥스4 스크립트기초 예제10

rndjr 2013. 1. 11. 10:57

 

 

* 스위시맥스4 스크립트기초 예제10

1. Outline 패널에서 각각의 버튼에 다음과 같이 스크립트를 입력한
   다.

- 상 :
on (release) {
   if(_root.nabi._y > 70){
   _root.nabi._y = _root.nabi._y - 30;
   _root.nabi._rotation = 360;
}
}

- 상우 :
on (release) {
   if(_root.nabi._x < 530 and _root.nabi._y > 70){
   _root.nabi._y = _root.nabi._y - 30;
   _root.nabi._x = _root.nabi._x + 30;
   _root.nabi._rotation = 45;
}
}

- 우 :
on (release) {
   if(_root.nabi._x < 530){
   _root.nabi._x = _root.nabi._x + 30;
   _root.nabi._rotation = 90;
   }
}

- 우하 :
on (release) {
   if(_root.nabi._x < 530 and _root.nabi._y < 380){
   _root.nabi._x = _root.nabi._x + 30;
   _root.nabi._y = _root.nabi._y + 30;
   _root.nabi._rotation = 135;
}
}

- 하 :
on (release) {
   if(_root.nabi._y < 380){
   _root.nabi._y = _root.nabi._y + 30;
   _root.nabi._rotation = 180;
}
}

- 하좌 :
on (release) {
   if(_root.nabi._x > 70 and _root.nabi._y < 380){
   _root.nabi._y = _root.nabi._y + 30;
   _root.nabi._x = _root.nabi._x - 30;
   _root.nabi._rotation = 225;
}
}

- 좌 :
on (release) {
   if(_root.nabi._x > 70){
   _root.nabi._x = _root.nabi._x -30;
   _root.nabi._rotation = 270;
}
}

- 좌상 :
on (release) {
   if(_root.nabi._x > 70 and _root.nabi._y > 70){
   _root.nabi._x = _root.nabi._x -30;
   _root.nabi._y = _root.nabi._y -30;
   _root.nabi._rotation = 315;
}
}

- 초기화 :
on (release) {
   _root.nabi._x = 300;
   _root.nabi._y = 225;
   _root.nabi._rotation = 360;
}

 

 

 

첨부파일 script10.swf

 

 

첨부파일 script10.swi