Link:INB Home|INB English| INB русский язык|INB العربية|INB Türkiye|INB فارسی|INB Español|INB Français|INB Português|INB Deutsch|INB 國語|INB 中文|INB 日本语|INB 한국어|INB ภาษาไทย|INB tiếng Việt||자습서 플래시Flash 강좌,[플래쉬] [액션스크립트] as파일과 fla파일 연동하기
INB 한국어 포럼
(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com
INB 한국어 포럼
(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com
INB 한국어 포럼

(산업 및 기본 과학자)에 오신 것을 환영합니다 여기에 산업 시대는 원시 생물 정신 과학자와이 네트워크 공간을 통해 당신과 내가 둘 다 미친 실험실에 온, 투지로 가득하다. 홈 INBforum.com, 영구 이름 :twtmo.forums2u.com


You are not connected. Please login or register

《《《《《《《上一页INBforum   Go down

上一页INBforum》》》》》》》이전 주제 보기 다음 주제 보기 Go down  메시지 [페이지 11]

1자습서 플래시Flash 강좌,[플래쉬] [액션스크립트] as파일과 fla파일 연동하기 Empty 자습서 플래시Flash 강좌,[플래쉬] [액션스크립트] as파일과 fla파일 연동하기 Tue May 24, 2011 5:44 am

Admin


Admin
실행순서
Animal.as
cat.as
Animal.as
dog.as
animal.fla

Animal.as
class Animal extends MovieClip {
private var speed:Number;
private var name:String;
function Animal() { //trace("Animal.as-Animal "+this.name);
this.speed = 5;
this.name="Animal";
this.onRollOver = function() {
this.useHandCursor = false;//마우스가 버튼의 히트영역에 들어갔을때 손모양의 커서로 바꿀것인지
this.attachMovie("balloon", "balloon_mc", 0);//라이브러리에서 복제해서 인스턴스 [You must be registered and logged in to see this image.] 네임과 심도를 부여한다
this.balloon_mc._x = this._xmouse;
this.balloon_mc._y = this._ymouse - 50;
this.balloon_mc.name_txt.text = this.name;
};
this.onRollOut = function() {
this.balloon_mc.removeMovieClip();//마우스가 영역을 벗어났을때 무비클립 지우기
};
this.onPress = function() {
this.startDrag(false);//마우스 따라가기
}
this.onRelease = function(){
this.stopDrag();//더이상 마우스 따라가지 않기
}
}

function run() { //trace("Animal.as-run "+this.name);
this.onEnterFrame = function() {
this._x += this.speed;
};
}
function stop() { //trace("Animal.as-stop");
delete this.onEnterFrame;
}
function setName (tempName:String){ //trace("Animal.as-setName");
this.name = tempName;//private이기 때문에 이 메소를들 이용해서 값을 집어넣기
}

}

Cat.as
class Cat extends Animal {
private var catSound:Sound;
function Cat() {//trace("Cat");
this.speed = 1;
}

function meow() {//trace("meow()");
catSound = new Sound(this);
catSound.attachSound("Meow");//라이브러리에서 가져온다
catSound.start();
}
}

Dog.as
class Dog extends Animal {

private var dogSound:Sound;

function Dog() {//trace("Dog()");
this.speed = 2;
}
function bark() {//trace("bark()");
dogSound = new Sound(this);
dogSound.attachSound("Bark");//라이브러리에서 가져온다
catSound.start();
dogSound.start();
}
}

animal.fla
dog_mc.setName("Fido");//setName메소드를 이용해서 무비클립의 name변수에 Fido값 넣기
cat_mc.setName("Fluffy");
dogRun_btn.onRelease = function() {
dog_mc.run();
};
dogStop_btn.onRelease = function() {
dog_mc.stop();
};
dogSound_btn.onRelease = function() {
dog_mc.bark();
};
catRun_btn.onRelease = function() {
cat_mc.run();
};
catStop_btn.onRelease = function() {
cat_mc.stop();
};
catSound_btn.onRelease = function() {
cat_mc.meow();
};





[You must be registered and logged in to see this image.]
http://www.mbc-academy.co.kr]

http://kr.inbforum.com

上一页INBforum   Go down

上一页INBforum이전 주제 보기 다음 주제 보기 위로  메시지 [페이지 11]

Permissions in this forum:
답글을 올릴 수 없습니다

Copyright ©2009-2010 LTD Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

IT:SINGLESERVGoogle谷歌翻译TranslateFORUMSOFTLAYERGoogle谷歌广告联盟AdSenseAsia

 

Free forum | ©phpBB | Free forum support | 악용 사례 신고 | Latest discussions