Aug 11, 2011 7:19 AM
How do you resize a Extension after creation
-
Like (0)
Hi,
I've created a panel that is 200x200, but now I want it to load at 400x350, how can I changed the size the panel loads. I saw that you enter a height and width when first creating the panel (via the wizard), but I can't change the height/width set in the manifest.xml.
Stephen
You can change the width and height defined in the manifest using the Bundle Manifest Editor.
Right click the project and go to CS Extension Builder > Bundle Manifest Editor, then in the editor click the Extension tab at the bottom.
Then click User Interface and you can edit the default width/height, as well as other UI properties.
What if you wanted to do it dynamically? Lets say that (during creation) the number of fields in your panel chenged from load to load and you wanted the panel size to change with the number of fields?
Then you can use CSXSWindowedApplication as your MXML root component, and set the width and height properties on it. CSXSWindowedApplication is delivered in CSXSLibrary.
There are examples of how to CSXSWindowedApplication across the forum, e.g. http://forums.adobe.com/message/3487857#3487857
THANKS! And forgive my ignorance, but:
When I switch to a CSXSWindowedApplication the "addchild" method that I use to dynamically create UI controls becomes "undefined". I wonder why? If I switch to purely WindowedApplication (which guess CXSXWindowedApplication inherits from), the "addchild" method remains defined and I am able to modify the size of the panel with "this.height" as in the example you linked to. So, my problems appeared to be solved by using a WindowedApplication, but I wanted to write and ask the difference between WindowedApplication and CSXSWindowedApplication to make sure I wasn't doing anything sacrilegious.
You should not use WindowedApplication for extensions - it causes memory leaks (your extension, which is actually a Flex sub-application, is not fully garbage collected when quit). The only difference between WindowedApplication and CSXSWindowedApplication is that the latter unhooks some event listeners that allow proper garbage collection, so you shouldn't see problems with addChild as far as I know.
If you upload a minimal code sample that shows the problem that would be helpful
Gotcha. Thanks so much. I am not very good at this and I failed to include the xmlns attribute that goes with the csxswindowedapplication tag. SO MANY LETTERS! Thanks, again.
-Bill
hi david_a_clark,
It is possible to resize a extension in case of Application mxml component having flex version 4.5.1?
That's not something I've tried. When you set the width or height of an Application you're only setting the size of the Flash stage. You'd also need to somehow resize the extension's NativeWindow too.
You can get a handle on the NativeWindow like this:
var nativeWindow:NativeWindow = systemManager.stage.nativeWindow;
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2011 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).