简体   繁体   English

如何在Flash(AS3)的屏幕中间设置对象

[英]how to set object in middle of the screen in flash (AS3)

I am new in flash developer. 我是Flash开发人员的新手。 I want to set my frame at the center of the screen interdependent of screen size . 我想将我的框架设置在屏幕中心,与屏幕大小无关 but we are working on full screen view (means stage.scaleMode = StageScaleMode.EXACT_FIT ). 但是我们正在全屏显示(即stage.scaleMode = StageScaleMode.EXACT_FIT )。

Logically I want one background image at back side, which cover all part of the screen, and on that background image I want to set my frame image at center of screen with fix size of (1000 X 750 px). 从逻辑上讲,我希望背面有一个背景图像,该背景图像覆盖屏幕的所有部分,并且要在该背景图像上将帧图像设置为屏幕中心,固定大小为(1000 X 750 px)。

Thank You. 谢谢。

George Profenza is absolutely right, you need to set StageScaleMode.NO_SCALE in as3 or add parameter in html like this George Profenza绝对正确,您需要在as3中设置StageScaleMode.NO_SCALE或在html中添加这样的参数

var so = new SWFObject("swf/sample.swf", "sample", "100%", "100%", "10");

so.addParam("scale", "noscale");
so.addParam("salign", "TOP_LEFT");
so.write("flashcontent");

note you also need to set slign property to TOP_LEFT. 请注意,您还需要将slign属性设置为TOP_LEFT。

one best tutorial i recommend for you CLICK 一个最好的教程中,我建议你点击

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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