简体   繁体   English

在浏览器中调整Flex应用程序的大小。 如何设置自动扩展高度

[英]Resizing flex application in browser. How to set autoexpanding height

I am developing small application for training purposes. 我正在出于培训目的开发小型应用程序。 There after click on the button is done, the new panel is added to application, to the button of the application. 单击按钮完成后,将新面板添加到应用程序中,并添加到应用程序的按钮中。 Once I come across strange problem. 一旦我遇到奇怪的问题。 The vertical scroll bar never appears. 垂直滚动条永远不会出现。

Here is how I embedded swf: 这是我嵌入swf的方法:

<script type="text/javascript" src="/site_media/js/swfobject.js"></script>
<script type="text/javascript">
  var flashvars = {};
  flashvars.siteurl = "http://";
  var params = {};
  var attributes = {};
  attributes.id = "plist";
  swfobject.embedSWF("/site_media/apps/submitproblemme.swf", "myAlternativeContent", "710", "700", "9.0.0","/site_media/apps/expressInstall.swf", flashvars, params, attributes);
</script>

Here is how I defined application: 这是我定义应用程序的方式:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:ns1="ui.*" creationComplete="main(event)" width="730">

So after the click is done small panel is added to the bottom so my application must dynamically expand to the button (or at least create scroll bar). 因此,单击完成后,会将一个小面板添加到底部,因此我的应用程序必须动态扩展到按钮(或至少创建滚动条)。

Here is a screenshot: http://img.skitch.com/20100208-xhh1mi93acyn5y19r8r8spn974.png 这是屏幕截图: http : //img.skitch.com/20100208-xhh1mi93acyn5y19r8r8spn974.png

Please help! 请帮忙!

Hey, I've run into this problem myself. 嘿,我自己遇到了这个问题。

The best thing to do here is to use the browser scrollbars. 此处最好的方法是使用浏览器滚动条。 When your Application SWF gets larger than the browser viewport, you want the browser window to resize. 当您的应用程序SWF大于浏览器视口时,您希望调整浏览器窗口的大小。

You can do that using this javascript library: SWFFit . 您可以使用以下JavaScript库来实现: SWFFit Make your browser window 800x600 or so, and run this swffit example . 将浏览器窗口设置为800x600左右,然后运行此swffit示例 It will make the scrollbars appear. 它将使滚动条出现。

It works by resizing the object tag added by swfobject. 通过调整swfobject添加的object标签的大小来工作。 You have to call those methods whenever you figure out your application has resized. 一旦确定应用程序已调整大小,就必须调用这些方法。

If you want to use the canvas scrollbars instead of the browser scrollbars, could you show the code you're using adding your panels to the application? 如果要使用画布滚动条而不是浏览器滚动条,是否可以显示将面板添加到应用程序时使用的代码?

This is the easiest method. 这是最简单的方法。 We no need another plugin/tool. 我们不需要其他插件/工具。 In index.html file, within style declaration, paste following code, 在index.html文件的样式声明中,粘贴以下代码,

html, body  {height:100%; width:100%; min-width:800px; min-height:600px; overflow:auto; position:absolute;}

i hope it should works.Scroll bar should appear if screen size less than 800X600. 我希望它能正常工作。如果屏幕尺寸小于800X600,则会出现滚动条。 and also you can specify max-height as well as max-width, if you want. 如果需要,还可以指定max-height和max-width。

Another that may or may not help you: Some containers have a "resizeToContent" property. 另一个可能会或可能不会帮助您的情况:某些容器具有“ resizeToContent”属性。 I know viewStack has it. 我知道viewStack有它。 Might make life easier for you. 可能会让您的生活更轻松。

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

相关问题 如何将Flex应用程序设置为在浏览器窗口中打开 - How to set Flex application to open in browser windows 如何在FLEX中更改火花应用程序的宽度和高度? - How to change the spark Application width and height in FLEX? 如何在ActionScript中获取在Web浏览器的Flash Player中运行的Flex应用程序的宽度和高度 - How to get the width and height in ActionScript for a Flex application running inside the flash player in the web browser 在Flex中调整浏览器大小时,如何调整hbox的大小以适合其中的内容 - How to resize the hbox to fit the contents in it when resizing the browser in flex Flex浏览器应用程序初始化 - flex browser application initialization 如何在Flex 4项目中将AS类设置为默认应用程序 - How to set an AS class as Default Application in Flex 4 Project 如何创建具有动态高度的Flex应用程序? - How can I create a Flex application with dynamic height? 如何将flex组件的高度绑定到浏览器窗口的高度? - How can I bind a flex component's height to the height of the browser window? 如何在浏览器的子窗口中加载我的flex应用程序? - How to load my flex application in child window of browser? 如何将SWF对象设置为Flex 4应用程序的背景 - How to set SWF object to the background of the Flex 4 Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM