Today I was pulling up the radar on weather.com. I have the flash debug version and got a sweet error:
Hello I am the iMap and I would like to discuss something with you.
We are attempting to load an icon library resource from a location that is not currently available.
The reasource url that attempted to load is located at http://s.imwx.com//img/swf/lib-imap-iconset-flex-std.swf
Don’t worry we can try again later and maybe we will have better luck.
at Resource/onIconLibraryIOError()
at layers.points::IconLibraryLoader/onIOError()
Thank you for the humor, weather.com developer.
One of the most basic ways to improve the feel of a Flex application, is to add transitions and effects when a change in the viewstack occurs. Here is an example of the code using the “showEffect” and “hideEffect” property on the NavigatorContent class.
<mx:ViewStack id=”vs” width=”100%” height=”100%”>
<fx:Script>
<![CDATA[
import spark.effects.Fade;
]]>
</fx:Script>
<s:NavigatorContent label=”Link 1″ width=”100%” height=”100%” hideEffect=”{new Fade()}” showEffect=”{new Fade()}”>
<s:VGroup/>
</s:NavigatorContent>
<s:NavigatorContent label=”Link 2″ width=”100%” height=”100%” hideEffect=”{new Fade()}” showEffect=”{new Fade()}”>
<s:VGroup/>
</s:NavigatorContent>
</mx:ViewStack>
There are many effects and transitions to play for a hide or show. This is just one simple example to illustrate how easy it is to do. The effect gives the user a less jerky and smooth transition from one view to the next. The simple Fade effect for hide and showing prevents the screen from snapping from one view to another. There is no waiting for a page to load in Flex, so it is good to have some transition for the user.
Tinkering around with the new scrolling method s:Scroller in Flex 4. I like it much more than Flex 3. Less overhead and more control of scroll bars. Still the overall frustrations with scroll bars and where they should appear still remains. Thought and trial/error are required to get it just right.
I was recently trying to do a full application scroll bar rather than those “in component” ones. I was using a viewstack and having all sorts of issues with getting the scroll bars to actually activate. I have a simple example of my problem. Can you easily figure out the solution?!?!
Code Before
<?xml version=”1.0″ encoding=”utf-8″?>
<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark” pageTitle=”Booyah”
xmlns:mx=”library://ns.adobe.com/flex/mx” minWidth=”955″ minHeight=”600″ height=”100%” xmlns:local=”*”>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>
</fx:Declarations>
<s:Scroller width=”100%” height=”100%” verticalScrollPolicy=”on”>
<s:VGroup width=”100%” height=”100%”>
<mx:LinkBar dataProvider=”{vs}”/>
<mx:ViewStack id=”vs” width=”100%” height=”100%”>
<s:NavigatorContent label=”Link 1″ width=”100%” height=”100%”>
<s:VGroup/>
</s:NavigatorContent>
<s:NavigatorContent label=”Link 2″ width=”100%” height=”100%”>
<s:VGroup height=”100%” width=”100%”>
<s:HGroup width=”100%” height=”500″>
<mx:Image source=”http://www.wallpaperbase.com/wallpapers/photography/greece/greece_6.jpg” height=”100%”/>
<s:Label text=”Some Text 2!” width=”50%”/>
</s:HGroup>
<s:HGroup width=”100%” height=”500″>
<mx:Image source=”http://www.photoatlas.com/photo/italy_venice_03.jpg” height=”100%”/>
<s:Label text=”Some Text 3!” width=”50%”/>
</s:HGroup>
<s:HGroup width=”100%” height=”500″>
<mx:Image source=”http://www1.pictures.zimbio.com/gi/St+Louis+Cardinals+v+Cincinnati+Reds+5GwTSG7xvgfl.jpg” height=”50%”/>
<s:Label text=”Some Text 4″ width=”50%”/>
</s:HGroup>
</s:VGroup>
</s:NavigatorContent>
</mx:ViewStack>
</s:VGroup>
</s:Scroller>
</s:Application>
When I run this, I am expecting a scroll bar on the application. Here is a screen shot of the output:
Checking out the right side, I see my scroll bar, but is disabled, despite content hanging off the bottom of the screen. The only reason the scroll bar is showing up at all is because I have verticalScrollPolicy=”on” for demo purposes. Looking the source can be a bit challenging to figure out a solution, even in a simple example. Figured out where the problem is?
A while ago I wrote an example on how to run command line in an AIR app. This worked great until trying to actually release my application to the world. The problem: AIR files cannot run Native processes. While the AIR app will run fine in Flash Builder, when I try to export a release build, it will throw an error if the profile is set to extendedDesktop(which I need for a native app). This is because the file must be an .exe file under windows to support native integration. The ability to export a release build .exe file is not baked into Flash Builder. The command line must be used. When using the command line, another issue arises. YOU MUST run the command line from the directory where the SWF file is sitting. For example c:\projects\flashbuilder\TestProject\bin-debug\. I didn’t do this at first and I got an error like MyNativeApp.exe does not exist. Well MyNativeApp.exe is the one I am trying to generate!!
2 1/2 years ago I published annotations for BlazeDS that allowed for placing tags on Java getters/setters to determine if a value is serialized to the Flex client. Soon I will publish a 3 part BlazeDS extension that does the following(with annotations of course).
- Serialization Profiles with BlazeDS - This was mentioned in a previous post and I will be releasing this soon along with the rest of the annotations code.
- Mate Code Generator - More details to come, but if you are familiar with the Mate Framework, this code generator will create complete EventMaps/DataManagers/Events from Java services(and it runs for the life of the project).
- Model Code Generator - This isn’t the kind where a button is pressed once to create Flex remote object bean classes. I don’t like code generators that only generate the file initially. I also don’t like when a code generator creates generated code that then the developer must extend(ex: Customer extends _Customer). I have created a code generator that does neither but still can be run endless times for the life of the project. Here is an example output file. The developer can add any code to the area marked as such in comments. Every time the generator is run it will clear out the rest of the file and regenerate the properties from the matching Java class.
/* File Generated by FlexPastaDomainGenerator v. 1.0
* Only edit the file in the designated area.
* All other changes will be lost
*/
package com.company.model
{[Bindable]
[RemoteClass(alias=”com.company.model.Address”)]
public class Address
{
public var country:String;
public var lot:String;
public var parcel:String;
public var state:String;
public var streetName:String;
public var streetNumber:String;
public var subdivision:String;
public var uuid:String;
public var zipCode:String;//**********EDIT AREA**********
//**********END EDIT**********
}
}
Looks for more details in the coming weeks!
