GhostWire Studios - Flash/Flex UI Components Development And Consulting Services
Quality User Interface Controls For Flash Application DevelopmentAspireUI Components

Archive for November, 2009

Nov 19 2009

uiModel: Using External XML As Data Source During Run-Time

Published by sunny under Aspire UI,Flash,Tips

The com.ghostwire.ui.data.uiModel class is used to represent a collection of items used as data source for various components in the Aspire UI library. Data-driven components such as the uiComboBox, uiListBox, uiMenu, uiMenuBar, and uiTabView are populated using uiModel objects.

A uiModel object can be populated using an array of data objects (duplicates will be ignored), an array of strings, or an XML object. When populating using XML, the XML can either be embedded with the rest of your application code, or loaded from an external XML file during run-time.

Continue Reading »

One response so far

Nov 18 2009

[AS3] Drawing Outline on Text Glyphs

Published by sunny under Flash,Flash AS3,Tips

Here is how you can draw an outline on text glyphs during run-time via ActionScript. This method works with embedded as well as non-embedded fonts.

Continue Reading »

No responses yet

Nov 17 2009

uiToggleFrame Example

Published by sunny under Aspire UI,Flash

This is a small SWF featuring the new uiToggleFrame component from Aspire UI Standard Edition (the component was added to the library in the recent Version 1.3 Update):

Continue Reading »

No responses yet

Nov 16 2009

[AS3] Applying ROT128 Encryption On Binary XML

Published by sunny under Flash,Flash AS3,Tips

This is Part III of our discussion on ROT128 Encryption.

Part I: “Applying ROT128 Encryption On ByteArray”
Part II: “Applying ROT128 Encryption On Embedded/Module SWFs”

In “Saving XML As Binary”, we looked at how text XML can be stored in a ByteArray object so that it can be compressed and made non-human-readable. In this post, we look at how you can integrate ROT128 into the XML-to-ByteArray-to-XML routines. Binary XML is used only as an example; you can definitely apply the same concept to other binary data.

Continue Reading »

2 responses so far

Nov 13 2009

[AS3] Applying ROT128 Encryption On Embedded/Module SWFs

Published by sunny under Flash,Flash AS3,Tips

This post is a supplement to “Applying ROT128 Encryption On ByteArray”.

Some time back, we posted a simple technique for hiding assets and AS3 code from prying eyes by embedding one SWF within another SWF. In this post, we revisit that topic and look at how ROT128 can be used to provide an additional layer of protection.

Continue Reading »

3 responses so far

Nov 12 2009

[AS3] Applying ROT128 Encryption On ByteArray

Published by sunny under Flash,Flash AS3,Tips

In this post, we will look at a very simple algorithm for weak encryption. You should not use this method for real cryptographic security. However, because it is so simple to implement, the light-weight algorithm could easily escape prying eyes and avoid being the target for decryption in the first place.

I should also clarify that the term “ROT128″ does not actually exist. The original idea comes from ROT13, a variant of the Caesar Cipher (named after Julius Caesar of ancient Rome who used it to encrypt messages, but it is not clear who first invented or started using the cipher).

Continue Reading »

No responses yet

Nov 10 2009

uiImage: Using Embedded And/Or Dynamically Generated BitmapData

Published by sunny under Aspire UI,Flash,Tips

The uiImage component is used to display non-interactive images.

The source property is a String value and determines the image source, which can be an external image file (property value specifies the file name) or an image embedded in the SWF (property value specifies the class name).

This means that the image source has to be expressed as a String value, which is not always possible. For example, a Bitmap could be dynamically generated during run-time and you may wish to (re)use its BitmapData as the source in uiImage instances.

As of Aspire UI Version 1.3, the uiImage class has a static registerBitmapData() method. You may use this method to register a BitmapData object in the image cache, giving it a unique id. Subsequently, you will be able to use the id as the image source for uiImage instances.

Continue Reading »

No responses yet

Nov 09 2009

Aspire UI: Applying Background Glow+Shadow

Published by sunny under Aspire UI,Flash,Tips

The “background” property defined by the com.ghostwire.ui.core.uiComponent class determines the style of the background for a component instance – color, opacity, border color, border width, gradient fills, and corner radius.

By default, no background will be drawn. The following is an example on how to draw a simple background:

Continue Reading »

No responses yet

Nov 07 2009

[AS3] Simple Editor For Loading And Saving XML As Binary

Published by sunny under Flash,Flash AS3,Tips

This post is a supplement to “Saving XML As Binary”.

As mentioned in the previous post, you can save XML in binary and get the benefits of compression, but doing so would make it impossible to edit the data through a text editor.

This post explores a simple tool you can create easily using Flash/ActionScript 3, a tool that will allow you (or your clients and end-users) to load, read, edit and save XML in compressed binary format. As shown below, this is a minimalist approach – feel free to beautify and/or customize it to fit your own requirements.

You can find the source code at the end of this post. The code does not use any UI component, not from Aspire UI, Flex or Flash, just plain native Flash Player classes so you can compile the AS3 class alone without any additional library.

Continue Reading »

7 responses so far

Nov 06 2009

[AS3] Saving XML As Binary

Published by sunny under Flash,Flash AS3,Tips

This could be useful if you have an external large, verbose XML file which your application must load during run-time. By saving the XML as binary, you can compress the data and get a much smaller file. Of course, the amount of compression you can get depends on the complexity of your data, but it would typically be over 50% (conservative estimate).

Admittedly, having the XML data in compressed binary format contradicts the original intention of using XML in the first place – to allow human-readable data. Therefore, you will have to decide what exactly is important for your application before proceeding. Perhaps having cryptic external data is indeed what you want – allowing data to be externalized so they can be changed without requiring the SWF to be recompiled, and yet would prefer the data to be non-human-readable.

Continue Reading »

6 responses so far

Next »