1/18/2011 8:10:52 AM
Title:
application size dynamically
Hi ,
I have a flex application with height 300px and it is embedded in HTML page . The html page has other contents . flex app has just login form . Once user logs in I want to set flex application size to 100% . I tried
this.percentHeight=100
application.percentHeight=100
percentHeight=100
but none of them worked . Could someone shed some light on this ?
Thanks
1/18/2011 8:31:18 AM
found the problem , but could not get the solution . When I set the application size to 300px , in HTML AC_FL_RunContent is set to 300px. How do I change AC_FL_RunContent height dynamically using flex application ?
Regards
Kiran
Kiney
Points: 600
Posts:0
1/18/2011 9:06:46 AM
you need to change the height and width of flash in html and not in flex. To do this you need to write a javascript function in your html page which can change your your flash object height and width. now call that javascirpt function from flash application when login is successful using externalInterface class in flash.
1/18/2011 11:26:31 AM
Hi Kiney,
Thanks for it . Any Java code snippet that helps me ? I see AC_Generateobj ( in AC_OETags.js) and that is where it is written to the document . Do I have to get this Object in Java script function ( My own java script function) and have to setup height ..? I know calling Java script from Flex , but confusing part is java script . I am a beginner in Java script
Regards
Kiran
1/18/2011 12:40:54 PM
Kiney,
I am done with 50% . But still having issue . I am calling the below lines of code
percentHeight=100;
ExternalInterface.call("function() { document.getElementById('testing').height='100%'; }");
and the size of the application is 100% , but inside the app the components are not growing . I even set the size to 100% before creating child components in it ..
any ideas ?
1/19/2011 1:43:08 AM
you also need to set proper scale mode so that flex swf can rescale itself when height of object is changes in the html. Use the following code in flex on application initialize handler, to cover whole area without distortion. It will expand proportionally to fit the page , so there can be some white area on the sides or bottom.
stage.scaleMode= StageScaleMode.SHOW_ALL;
1/19/2011 8:05:17 AM
Thanks Brig for your response . But this is making screen bigger and things are not coming up properly . Even I tried other values , they haven't helped .
I found bit related to it
http://forums.adobe.com/message/2833630
but not sure how to do it .
any help on this ..?
1/19/2011 8:07:57 AM
One more I want to point out if add Alert.show to show some message after calling the java script , it is coming up fine . But unfortunately I don't want to Alert to be there..
ExternalInterface.call("function() { document.getElementById('testing').height='100%'; }");
this.addChild(main);
Alert.show("this is testing");
1/20/2011 12:46:06 AM
@Bujji1 can you share your running swf with html on some server so that I can see whats the problem you are facing. To me it seems that you want the flex compoenents inside the swf to resize when the size is changed to bigger. If so then along with changing swf size in HTML you should also change the size if componenet inside flex mannually setting there appropriate height and width.
Scale mode will only zoom the object but wont resize it
1/20/2011 2:04:34 PM
Hi Troy,
Thanks for your help . It helped me . I was setting percentHeight didn't help me . But setting using "height " helped me . Once again thanks for your help .
Regards
Kiran