레이어 2개 있다고 가정한후
레이어1에는 1프레임, 2프레임 둘다 다음버튼 이전버튼 그리고 mov가 있다고 하고
레이어2에는 1프레임에는 버튼0이 2프레임에는 버튼1이 있다고 하고
레이어1에는 다음과 같은 액션을
import flash.events.MouseEvent;
다음.addEventListener(MouseEvent.CLICK, 다음으로);
function 다음으로(e:MouseEvent):void
{
gotoAndStop(this.currentFrame+1);
}
이전.addEventListener(MouseEvent.CLICK, 이전으로);
function 이전으로(e:MouseEvent):void
{
gotoAndStop(this.currentFrame-1);
}
import fl.video.VideoEvent;
var _Array:Array = [ \"http://spazzy.tistory.com/attachment/cfile28.uf@182A09274C5D668A9849E6.flv\",
\"http://jjs13579.tistory.com/attachment/cfile7.uf@176CDB1E4C3E7D7D029BB7.flv\" ];
mov.addEventListener(VideoEvent.COMPLETE, completeHandler);
function completeHandler(e:VideoEvent):void
{
e.currentTarget.play();
}
function _클릭1(e:MouseEvent):void
{
trace(_Array[e.currentTarget.i]);
mov.stop();
mov.play(_Array[e.currentTarget.i]);
}
레이어 2의 프레임 1에는 이렇게
var i:int;
i=0;
while (i < 1)//숫자가 1인것은 버튼이 하나라서..
{
this[\"버튼\" + i].buttonMode = true;
this[\"버튼\" + i].addEventListener(MouseEvent.CLICK, _클릭1);
this[\"버튼\" + i].i = i;
i++;
}
stop();
레이어2의 프레임2일때는 이렇게..
while (i < 2)//숫자가 2인것은 1프레임 2프레임 다하면 버튼이 2개라서
{
this[\"버튼\" + i].buttonMode = true;
this[\"버튼\" + i].addEventListener(MouseEvent.CLICK, _클릭1);
this[\"버튼\" + i].i = i;
i++;
}
그러면 위처럼 나오는데 코드좀 절약할려고 햇더니
힘드네요 아주..
차차루야!
읭?
차차루야! 혹시 플래시에서 지원되는 List 콘트롤 디자인같은건 공유하는데 없나영
그러게 왜 낮에안해주고 도망자 PlanB?!... ⓑ
저 네톤에서 안보일때는 제가 안할때임요..
리스트 디자인은 공유하는데를 모르겟네요.. 다른 커뮤니티들은 안다녀서..