header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Anurag
Points:50
Posts:3
Answered

3/15/2010 6:16:55 AM

Title: to get floating structure in flex


I want to know that how can I make my flex page as floating i.e.it get resized on resizing the window???



Deter
Points: 0
Posts:0
3/15/2010 8:30:39 AM



in flex we need to specify the scale mode property. In your case you need to set


stage.scaleMode= StageScaleMode.SHOW_ALL;

which will resize your flex application according to size of page. You can set this property on application event of main application tag , so that as soon as application is initialized it resizes to fit the page. Remember that you also need to specify the width and height property in HTML flash tag (embed and object) to 100%.

Anurag
Points: 50
Posts:3
3/16/2010 10:00:39 PM



but it doesnot make the application adjust its length according to the size of the window.

Inder
Points: 2480
Posts:0
Accepted Answer
3/16/2010 10:37:21 PM



@Anurag you can set either of four properties to achieve the desired scale mode

I think you need Exact fit which makes the flex application fit into height and width completely. You must specify the height and width in html to 100% to make this work. But this can distort / stretch the movie if height and width are not in proportion with browser window area.


stage.scaleMode= StageScaleMode.EXACT_FIT;


Other scale modes are following :

// No border sets expands flex application proportionally to maximum height and width but some area of application may be cropped to avoid distortion.
stage.scaleMode= StageScaleMode.NO_BORDER;

// No scale makes movie stick to fixed size and never scale
stage.scaleMode= StageScaleMode.NO_SCALE;

// Show all makes flex application scale to maximum height and width but preserving the proportion to avoid any distortion. This is the recommended for most applications because it makes maximum area available without distorting the proportion.
stage.scaleMode= StageScaleMode.SHOW_ALL;

Anurag
Points: 50
Posts:3
3/16/2010 10:59:15 PM



hi,first of all thanx for ur help your solution is working somewhat.I have a datagrid(uneditable),button,grid control on my application.Now I want that these control should adjust according to size of the explorer window and the control should come to next line if width is very less of explorer window

Tyson
Points: 0
Posts:0
3/17/2010 6:44:08 AM



you can use width as 100% for your components so that they resize as the window is resized. I don't think the components can be wrapped as you want them to be. If the width is decreased below the min area scroll appears rather than wrapping components. You have to write a custom code to achieve this functionality. I can give you some idea.

If your components are inside a container like titlewindow then you can write a function on some page resizing event which can set the layout mode of title window to vertical when minimum width is reached and again set to horizontal when width is increased.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions