Flex Web 应用程序调整大小方法(和缩放 X/Y)不适用于服务器,但适用于本地 Flex Builder
我在调整大小方面遇到了一个完全不同的问题。我有一个 Flexbook 组件,它使用屏幕的中间部分(中心)以及 html 页眉菜单和页脚。
问题: 当我们在本地机器(Flexbuilder)中运行时,缩放效果非常好。 但是当我们将其部署到服务器时,就像缩放从未存在过一样。
要求:
当用户最大化或最小化窗口时,Flexbook 应该调整大小以适应屏幕。
我使用了顶层的 resize() 方法:
protected function application1_resizeHandler(event:ResizeEvent):void
{
var scaleX: Number = Application.application.width / 1024;
var scaleY: Number = Application.application.height / 762;
this.scaleX = this.scaleY = (scaleX>scaleY?scaleY:scaleX);
for (var i:int = 0; i < this.numChildren - 1; ++i) {
if(this.getChildAt(i))
this.getChildAt(i).scaleX = this.getChildAt(i).scaleY = (scaleX>scaleY?scaleY:scaleX);
}
}
感谢是否有人可以解释为什么会发生这种情况:
- 服务器/html 端是否需要任何东西(用于启用缩放的参数/选项等?)
- 我们可以在 Flex 中做一些事情吗?
I have a quite different problem with resizing. I have a Flexbook component which uses the middle part of screen (center) with a html header menu and footer.
The problem:
The scaling works perfectly when we run in the local machine ( Flexbuilder). But when we deploy it to the server its like scaling never existed..
The requirement:
when user maximizes the window or minimizes it, the Flexbook should be resized to fit the screen.
I've used resize() method of top layer:
protected function application1_resizeHandler(event:ResizeEvent):void
{
var scaleX: Number = Application.application.width / 1024;
var scaleY: Number = Application.application.height / 762;
this.scaleX = this.scaleY = (scaleX>scaleY?scaleY:scaleX);
for (var i:int = 0; i < this.numChildren - 1; ++i) {
if(this.getChildAt(i))
this.getChildAt(i).scaleX = this.getChildAt(i).scaleY = (scaleX>scaleY?scaleY:scaleX);
}
}
Appreciate if anyone can explain why its happening:
- is there anything needed form server/html side ( parameter/options to enable scaling etc?)
- can we do something from within Flex ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,服务器端没有什么可做的。您在开发者机器和服务器上使用哪种浏览器?
我将在 Flex 构建器中使用远程调试器,并检查变量以及是否有人调用该方法。
BR
坦率
as far as i know, nothing is to do on server side. Which browser do you use on developer machine and server?
i would use the remote debugger in flex builder and would check the variables and if anyone calling the method.
BR
Frank