1

フレーム 1 に戻ろうとするたびに、SWF がクラッシュします (Flash でテストしたときではなく、Flash からエクスポートしたときです!)。フレーム 1 には、いくつかの変数宣言、1 つの enter.frame イベント リスナー、4 つの mouse.click イベント リスナー、および 1 つの stop を配置しました。後で単純な gotoAndStop(1); を使用します。戻る。ボタンをクリックすると、1 秒間停止し、その後 SWF が閉じます。

SWF は、発行および実行時に、Adobe Flash の外部でのみクラッシュします。

アクションレイヤー:フレーム1

var req1:URLRequest = new URLRequest("1.mp3"); 
var req2:URLRequest = new URLRequest("2.mp3"); 
var req3:URLRequest = new URLRequest("3.mp3"); 
//var req4:URLRequest = new URLRequest("4.mp3"); 
var autSnd:Sound = new Sound(req1);
var spriSnd:Sound = new Sound(req2);
var sumSnd:Sound = new Sound(req3);
//var wintSnd:Sound = new Sound(req4);
var soundChannel:SoundChannel = new SoundChannel();
var sound:Sound;
var sng=1;

stop();

addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler);

function fl_EnterFrameHandler(event:Event):void
{
    L.width = stage.stageWidth;
    L.height = stage.stageHeight;
    L.alpha = (soundChannel.leftPeak + soundChannel.rightPeak)/2;
}

aut.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
    sound = autSnd;
    sng=1;
    gotoAndStop(2);
}

spr.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler1);
function fl_MouseClickHandler1(event:MouseEvent):void
{
    sound = spriSnd;
    sng=2;
    gotoAndStop(2);
}

sum.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler2);
function fl_MouseClickHandler2(event:MouseEvent):void
{
    sound = sumSnd;
    sng=3;
    gotoAndStop(2);
}

wint.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler3);
function fl_MouseClickHandler3(event:MouseEvent):void
{
    //sound = wintSnd;
    //gotoAndStop(5);
}

アクション レイヤー: フレーム 2

var pausePoint:Number = 0.00;
var isSPlaying:Boolean;

xstop.addEventListener(MouseEvent.CLICK, clickStop);
xplay.addEventListener(MouseEvent.CLICK, clickPlayPause);

nm.gotoAndStop(sng);
soundChannel = sound.play();
isSPlaying = true;

function clickPlayPause(evt:MouseEvent) {
    if (isSPlaying) {
        pausePoint = soundChannel.position;

        soundChannel.stop();
        isSPlaying = false;
    } else {
        soundChannel = sound.play(pausePoint);

        isSPlaying = true;
    }
}

function clickStop(evt:MouseEvent) {
    if (isSPlaying) {
        soundChannel.stop();
        isSPlaying = false;

    }
    pausePoint = 0.00;
}

function StopS() {
    soundChannel.stop();
    isSPlaying = false;
    pausePoint = 0.00;
}

ボタン レイヤー: フレーム 2

nm.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_aur);
function fl_MouseClickHandler_aur(event:MouseEvent):void
{
    StopS();
    gotoAndStop("menu");
}
4

0 に答える 0