Standalone Flash / AS3中的阶段突然缩小

时间:2014-03-09 01:36:51

标签: actionscript-3 flash

我有一个独立的测验游戏Flash应用程序,具有固定的窗口大小(1280x720)。我引用“stage”的唯一一次是说“stage.focus = stage”,以便识别按键。在第一次按键后,所有内容都出现在窗口的中心部分(约1212x680)中,带有黑色边框。其他一切都正常运作。

将这些行添加到帧的开头:

stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;

没有效果。

一旦出现这种情况,一切都会缩小到这个略小的中心矩形。在游戏中的某个时刻,在我在FLVPlayer实例中播放电影并完成之后,事情就会恢复到正常范围 - 只会稍后再缩小。我在下面的代码中包含以下代码。

当发生这种情况时,我没有任何物体位于舞台的可见部分之外。

我没有3D绘图。所有对象的z值均为0.

有什么想法吗?提前致谢。很抱歉在代码中如此罗嗦,但我花了2个小时而且没有领先。

- 肯(这些年后仍然神秘)富兰克林

//this is the frame where the shrinkage happens
scoreArray[0].visible = false;  //each item in scoreArray is a custom class, 400x200 
scoreArray[1].visible = false;  // containing an FLVPlayer instance, a very small 
scoreArray[2].visible = false;  // movieClip, and two TLFTextFields
qcategory = qcatarray[qselected];
qworth = qwortharray[qselected] * multiplier;
qquestion = qquestarray[qselected];
qa1 = qa1array[qselected];
qa2 = qa2array[qselected];
qa3 = qa3array[qselected];
qa4 = qa4array[qselected];
qcorrect = qcorrectarray[qselected];
qcatarray = lose1(qcatarray,qselected);      //lose1 traverses an array and skips
qwortharray = lose1(qwortharray,qselected);  // the one I want to delete
qquestarray = lose1(qquestarray,qselected);
qa1array = lose1(qa1array,qselected);
qa2array = lose1(qa2array,qselected);
qa3array = lose1(qa3array,qselected);
qa4array = lose1(qa4array,qselected);
qcorrectarray = lose1(qcorrectarray,qselected);
catArray[0].visible = false;  //catArray objects are a custom class, 800x150,
catArray[1].visible = false;  // containing two TLFTextFields
catArray[2].visible = false;
nextupCat.visible = false;
nextupWorth.visible = false;
nextupCat.text = qcategory;
nextupWorth.text = String(qworth);
pumpText.visible = false;

this is where everything pops back:
//last frame with shrunken screen
dodIntroPlayer.source="DODIntroSkinny.flv";
debugQCount.visible=false;
dodIntroPlayer.addEventListener(VideoEvent.COMPLETE, introDone);
//introDone just calls nextFrame();

//first frame where everything pops back
stop();
dodStage1Button.addEventListener(MouseEvent.CLICK, moveToNextFrame);
ddcategory = dcatarray[0];
ddvalue = multiplier * 500;
//more calculations here

0 个答案:

没有答案