* 스위시맥스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