태그자료

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

rndjr 2013. 1. 11. 10:49

추천 0 |2012.04.21. 16:02 http://cafe.daum.net/bingxue57/8v1O/191 


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

1. Properties 패널의 Movie Properties 버튼을 클릭하여 다음과 같
   이 설정한다. Bg color=검정, Width=700, Height=500,
   Frame rate=15, Export Settings for Movie... : SWF 9

2. Scene1선택 Content로 Image  4장불러와. Stage 로 불러오고
   W=700 H=500 Transform에서 O=X 센타 X=350 y=250으로
   설정

3. Timeline 패널에서 각각의 이미지에 다음과 같이 설정한다.
   이미지1선택 1Frame에 Place 20Frame에 Remove
   이미지2선택 20Frame에 Place 40Frame에 Remove
   이미지3선택 40Frame에 Place 60Frame에 Remove
   이미지4선택 60Frame에 Place 80Frame에 Place

4. Outline 패널에서 4장의 이미지를 모두 선택 우클릭→Grouping→
   group as movie clip 이름은 image로 한다.

5. Scene1선택 Content의 Image 4장을 Stage 로 불러오고.
   Properties 패널에서 이름 아래서부터 img1~img4로, W=70
   H=50으로 Transform에서 O=X 센타 X=350 Y=470 img4만
   X=620으로 알라인 정렬 이미지의 순서를 image 무비클립안의 순
   서와 같게 한다.

6. Tools의 Text Tool을 클릭하여 stop버튼을 만든다.
   글씨체=Arial, 크기=20, 색=흰색, B, stop입력 O=X 센타 X=270
   Y=470으로 설정

7. Timeline 패널에서 stop텍스트의 1프레임에서 마우스 우클릭→
   Core Effects→Transform을 클릭한다.

8. Outline의 stop에 우클릭→Grouping→group as movie clip .
   이름은 stop으로 한다.

9. Tools의 Text Tool을 클릭하여 play버튼을 만든다.
   글씨체=Arial, 크기20, 색=흰색, B, play,입력 O=X 센타 X=200
   Y=470

10.Outline 패널의 play에서 마우스 우클릭→Grouping→Group as
   Button을 클릭한다. 버튼이름을 play라고 한다. Properties 패널에
   서 Has separate over state, Has separate down state,
   Has separate hit state를 체크한다.

11. Outline 패널의 play버튼열고 Up에는 play, Over에는 재생,
   Down에는 始作으로 내용을 입력한다.

12. Script 패널에서 play, stop, 이미지버튼 4개의 스크립트를 다음
   과 같이 입력한다.

- play : on (press) {
            _root.image.play();
         }

- stop : on (press) {
            _root.image.stop();
         }
         on (rollOver) {
            _root.stop1.stop();
         }
         on (rollOut) {
            _root.stop1.play();
         }

- img1(버튼용) : on (rollOver) {
          _root.image.gotoAndStop(1);
      }

- img2 : on (rollOver) {
          _root.image.gotoAndStop(20);
      }

- img3 : on (rollOver) {
          _root.image.gotoAndStop(40);
      }

- img4 : on (rollOver) {
          _root.image.gotoAndStop(60);
      }

14. Outline 패널에서 image 무비클립을 1번 더 무비클립으로 묶었
   을 때 버튼스크립트(이름 : image2)

- play : on (press) {
            _root.image2.image.play();
         }

- stop : on (press) {
            _root.image2.image.stop();
         }
         on (rollOver) {
            _root.stop1.stop();
         }
         on (rollOut) {
            _root.stop1.play();
         }

- 1 : on (rollOver) {
          _root.image2.image.gotoAndStop(1);
      }

- 2 : on (rollOver) {
          _root.image2.image.gotoAndStop(20);
      }

- 3 : on (rollOver) {
          _root.image2.image.gotoAndStop(40);
      }

- 4 : on (rollOver) {
          _root.image2.image.gotoAndStop(60);
      }

15. Outline 패널에서 image 무비클립을 언그룹 했을 때
   버튼스크립트

- play : on (press) {
            _root.play();
         }

- stop : on (press) {
            _root.stop();
         }
         on (rollOver) {
            _root.stop1.stop();
         }
         on (rollOut) {
            _root.stop1.play();
         }

- 1 : on (rollOver) {
          _root.gotoAndStop(1);
      }

- 2 : on (rollOver) {
          _root.gotoAndStop(20);
      }

- 3 : on (rollOver) {
          _root.gotoAndStop(40);
      }

- 4 : on (rollOver) {
          _root.gotoAndStop(60);

 

 

 

첨부파일 script3.swf

 

첨부파일 script3.swi

 
//