In case anybody might come across this issue:
I use to have my workspace on a remote network folder and created the exported air package there (Flex 4.5, Air 2.6). When doubleclicking to install the air package when it is still located in the remote folder the installation will fail saying the package is corrupt or damaged.
unfortunately I only got the german error:
"Die Anwendung konnte nicht installiert werden, da die Installationsdatei beschädigt ist. Bitten Sie den Anwendungsautor um eine neue Installationsdatei."
solution:
copy the file to your desktop and you're good to go.
Montag, 26. September 2011
Dienstag, 15. Februar 2011
Resizing Dynamically Loaded swfs using swfloader (Flex 4)
I needed to update some code from LordB8r's post for my needs, while I was writing an extension for the plugin mechanism described by Chris Cantrell.
http://flexpletives.blogspot.com/2010/12/resizing-dynamically-loaded-swfs-using.html
http://blogs.adobe.com/cantrell/archives/2010/03/extending_air_applications_with_plugins.html
Problem was the resizing of a dynamically loaded (via SWFLoader) .swf application. I got the following application layout. When moving the BoxDivider, the content of the SWFLoader should acutally scale with the size of the ViewStack, but it doesn't. The loaded plugin application always has the same size as the main application, no matter what I explicitly try to set.
This is the workaround:
- set percentWidth/percentHeight of the SWFLoader to 100
- listen for a resize of the viewStack (will be triggered either by dragging the BoxDivider or changing the window size)
- from the listener manually set the size of the NavigatorContent, and the contentGroup of the plugin application
The advantage of this variant is that there is no need for a custom function "updateDimensions" in the loaded plugin application as all spark Applications have a contentGroup that can be resized (which also resized my main application).
Disadvantage or the dirty thing here is that the stage size of the loaded plugin stays the same as the main application's, just the content is resized to the visible part.
http://flexpletives.blogspot.com/2010/12/resizing-dynamically-loaded-swfs-using.html
http://blogs.adobe.com/cantrell/archives/2010/03/extending_air_applications_with_plugins.html
Problem was the resizing of a dynamically loaded (via SWFLoader) .swf application. I got the following application layout. When moving the BoxDivider, the content of the SWFLoader should acutally scale with the size of the ViewStack, but it doesn't. The loaded plugin application always has the same size as the main application, no matter what I explicitly try to set.
- WindowedApplication
- ButtonBar (dataProvider = viewStack)
- HDividedBox
- SomeSideBarContainer
- BoxDivider
- ViewStack
- NavigatorContent
- SWFLoader
- SystemManager (part of SWFLoader)
- WindowedApplication (plugin application)
- PluginContent (search field, go button, result field)
- BoxDivider
- SomeSideBarContainer
This is the workaround:
- set percentWidth/percentHeight of the SWFLoader to 100
- listen for a resize of the viewStack (will be triggered either by dragging the BoxDivider or changing the window size)
- from the listener manually set the size of the NavigatorContent, and the contentGroup of the plugin application
// Main.as (skin = MainSkin.mxml) // viewStack, navigatorContent and loader initialization viewStack.addEventListener(ResizeEvent.RESIZE,function (e:ResizeEvent):void { if(loader.content == null || SystemManager(loader.content).application == null) return; navigatorContent.width = e.target.width; navigatorContent.height = e.target.height; (SystemManager(loader.content).application as Application).contentGroup.width = navigatorContent.width; (SystemManager(loader.content).application as Application).contentGroup.height = navigatorContent.height; }); navigatorContent.addElement(loader); loader.percentWidth = 100; loader.percentHeight = 100; loader.load(); viewStack.addElement(navigatorContent);
The advantage of this variant is that there is no need for a custom function "updateDimensions" in the loaded plugin application as all spark Applications have a contentGroup that can be resized (which also resized my main application).
Disadvantage or the dirty thing here is that the stage size of the loaded plugin stays the same as the main application's, just the content is resized to the visible part.
Abonnieren
Posts (Atom)