PROBLEM SUMMARY
You want to use a SWF file with a set of own symbols in order to customize Combobox states.
SOLUTION SUMMARY
Use the upSkin, overSkin, downSkin, and disabledSkin style properties of the ComboBox class to apply custom symbols to any combobox. These attributes can be set directly on a ComboBox instance or as part of a CSS style definition.
EXPLANATION
The first thing to do is create a file in Flash and ComboBoxSkins.swf within it to create 4 symbols of type MovieClip with different states of the ComboBox. These symbols should be named: ComboBox_upSkin, ComboBox_downSkin, ComboBox_overSkin, ComboBox_disabledSkin
If we want to put the CSS inline style do the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:ComboBox x="196" y="135"
upSkin="@Embed(source='ComboBoxSkins.swf', symbol='ComboBox_upSkin')"
overSkin="@Embed(source='ComboBoxSkins.swf', symbol='ComboBox_overSkin')"
downSkin="@Embed(source='ComboBoxSkins.swf', symbol='ComboBox_downSkin')"
disabledSkin="@Embed(source='ComboBoxSkins.swf', symbol='ComboBox_disabledSkin')">
<!-- PUT HERE THE OPTIONS OF COMBOBOX -->
</mx:ComboBox>
</mx:Application>
Continue reading 'How to skin a combobox from Flash'
Get the full url with the host name and port in actionscript?
There are several methods to help with this:
getHostName()
getPort()
getProtocol() -such as http or https
getContext() -The path after the hostname but before the url parameters
A common hurdle a developer may face is dealing with exceptions in BlazeDS. When an exception is thrown in Java, how do we handle this in flex? Here is a simple and flexible approach inspired by Scott Morgan.
1. Create a Java Class that extends RuntimeException.
package com.flexpasta.exception;
public class FlexException extends RuntimeException
{
public FlexException(String message)
{
super(message);
}
}
Continue reading ‘Exception Handling with Flex’
Flex Photo gallery in Flex using the TileList control, Image control, and the PopUpManager class.
Full code after the jump.
View MXML
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"layout="vertical"verticalAlign="middle"
backgroundColor="white">
<mx:Style>
Continue reading 'Creating a simple image gallery with the Flex TileList control'
Understanding Frameworks
It is important to understand what a framework is before you start using one for the first time.
The word “framework” is often misunderstood in the software development field. There are two different types of frameworks, one being application frameworks and the other being architectural frameworks.
For a more in-depth explanation of frameworks, refer to part 1 of Steven Webster’s series of articles at http://www.adobe.com/devnet/flex/articles/cairngorm_pt1_02.html.