[원문] - http://www.kirupa.com/forum/showpost.php?p=2108585&postcount=328
play , stop 을 컨트롤 하기 위해서는 별도의 클레스를 만들어서 대리자 역할을 하는 play와 ,stop() 메소드르 ㄹ활용하여 컨트롤 바와 동기화 할 수 있다.
그러나 얼마나 귀찮은 일인가...
action script 3.0에서는 movie를 exteds 하여 재정의 하여 사용 하면 해결 할 수 있다.
컨텐츠 파일에 아래와 같은 클래스를 등록 하고
Document class로 등록 하면,, swf가 실행 될 때 즉 movie를 기준으로 생성이 된다.
그러면 컨트롤 바에서무비가 stop()되는 것을 컨트롤 할 수 있다.
if (myMovie.isPlaying) {
myMovie.stop();
}
식으로...
체그 하면 될듯 ..
package {
import flash.display.MovieClip;
/**
* MovieClip class that adds an isPlaying property
* to indicate whether or not the movie clip is
* currently playing. Have your classes extend this
* class instead of MovieClip or set this class as the
* Base class of your movie clip(s) in the library to
* have those instances gain the isPlaying property.
*/
public class MovieClipWithIsPlaying extends MovieClip {
/**
* Private property to internally keep track of whether or
* not the current movie clip is being played
*/
private var _isPlaying:Boolean = true;
/**
* Getter function creating a public, read-only isPlaying
* property allowing users to get but not set the _isPlaying
* property to determine if the movie clip is playing
*/
public function get isPlaying():Boolean {
return _isPlaying;
}
/**
* Constructor
*/
public function MovieClipWithIsPlaying(){
super();
}
// override all timeline commands for movie clip that would
// affect the isPlaying property of the movie clip:
public override function gotoAndPlay(frame:Object, scene:String = null):void {
_isPlaying = true;
super.gotoAndPlay(frame, scene);
}
public override function gotoAndStop(frame:Object, scene:String = null):void {
_isPlaying = false;
super.gotoAndStop(frame, scene);
}
public override function nextFrame():void {
_isPlaying = false;
super.nextFrame();
}
public override function nextScene():void {
_isPlaying = true;
super.nextScene();
}
public override function play():void {
_isPlaying = true;
super.play();
}
public override function prevFrame():void {
_isPlaying = false;
super.prevFrame();
}
public override function prevScene():void {
_isPlaying = true;
super.prevScene();
}
public override function stop():void {
_isPlaying = false;
super.stop();
}
}
}