Главный файл Main.fla
Код AS3:
btn_st_1.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(2);
});
btn_st_2.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(3);
});
btn_exitM.addEventListener(MouseEvent.CLICK, exit);
function exit(e): void
{
gotoAndStop(1);
}
************
Открытие флэш-файла
Код AS3:
import flash.net.URLRequest;
import flash.display.Loader;
import caurina.transitions.*;
stop();
var mcCurrTestNoRes = this;
function loadResourceTestNoRes()
{
var swfRequestTestNoRes = new URLRequest("1.swf");
var swfLoaderTestNoRes = new Loader();
swfLoaderTestNoRes.x = 0;
swfLoaderTestNoRes.y = 0;
swfLoaderTestNoRes.load(swfRequestTestNoRes);
var mcTestNoRes_ = this.work1.workMc;
var ncTestNoRes = mcTestNoRes_.numChildren;
if (ncTestNoRes)
{
var load_mcTestNoRes = mcTestNoRes_.getChildAt(0);
mcTestNoRes_.removeChild(load_mcTestNoRes);
load_mcTestNoRes = null;
}
mcTestNoRes_.addChild(swfLoaderTestNoRes);
swfLoaderTestNoRes.contentLoaderInfo.addEventListener("complete", finished_loadingTestNoRes);
swfLoaderTestNoRes.contentLoaderInfo.addEventListener("progress", progress_loadingTestNoRes);
}
function progress_loadingTestNoRes(e:Event)
{
loader.rotation +=5;
}
function finished_loadingTestNoRes(e:Event)
{
loader.visible = false;
Tweener.addTween(mcCurrTestNoRes, {transition:"easeOut"});
}
loadResourceTestNoRes();
*******
1.fla
Код AS3:
stop();
//timer = new Timer(100);
//timer.addEventListener(TimerEvent.TIMER, handlerOnPlaying_Test_6);
//timer.start();
btn_exitMain.addEventListener(MouseEvent.CLICK, function(e)
{
MovieClip(parent).gotoAndStop(2);
//timer.removeEventListener(TimerEvent.TIMER, handlerOnPlaying_Test_6);
});
bt_1.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(2);
});
bt_2.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(3);
});
bt_3.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(3);
});
/*btn_exitMain.addEventListener(MouseEvent.CLICK, function(e)
{
gotoAndStop(1);
});
*/
Как после нажатия на кнопку "крестик" перейти на флэш Main.fla? У меня кнопки закрытия и перехода (btn_exitMain и btn_exitM) не действуют...
========
Код AS3:
fr_1.btn_exit.addEventListener(MouseEvent.CLICK, exit);
function exit(e): void
{
gotoAndStop(1);
}