简体   繁体   中英

Flash CS5.5 AS3 bug - button works everywhere except via HTML page

I have encountered a strange bug. I have buttons advancing one frame forward and back.

It works in the SWF on its own, it works in both the .app and .exe projector files, but it does not work accessing the SWF via the HTML generated page.

Does anyone have an inkling what's going on?

The code on the two buttons is:

import flash.events.MouseEvent;

stage.displayState = StageDisplayState.FULL_SCREEN;

function next1Click(event:MouseEvent): void {
gotoAndStop(this.currentFrame + 1);
}
function back1Click(event:MouseEvent): void {
gotoAndStop(this.currentFrame - 1);
}

//EVENT LISTENER AND VARIABLE DECLARATION
balancingNext.addEventListener(MouseEvent.CLICK, next1Click);
balancingBack.addEventListener(MouseEvent.CLICK, back1Click);

Thanks in advance for any help!

It's not a bug, but the intended bevahior. For this to work, allowFullScreen must be true , and you can't activate it without a user event, otherwise the program will throw an exception (and crash, since you don't catch it).

The ActionScript that initiates full-screen mode can be called only in response to a mouse click or keypress. If it is called in other situations, it will be ignored (in ActionScript 2.0) or throw an exception (in ActionScript 3.0).

See Adobe's documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM