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

Archive for the 'Tips' Category

Aug 21 2010

[Game Programming] Consider A Different Approach To Cards Shuffling

Published by sunny under Flash,Flash AS3,Tips

Very commonly, computer programs (usually games) that have the need to simulate a shuffling of a deck of cards (or drawing a tile from a bag, etc.) will go the obvious way of putting the items in an array, and then randomize the order of the elements of the array. A common algorithm for doing that is the Fisher–Yates shuffle (you can find a suitable implementation easily by googling).

The purpose of this post, however, is not to discuss “how” to shuffle arrays. Rather, I would like to bring up the question of “why” (do it) in the first place.

Continue Reading »

12 responses so far

Aug 19 2010

FlashDevelop: Getting trace() Statements To Show In Output Panel

Published by sunny under Flash,Flash AS3,Tips

This is quite an obscure, little known, hidden-by-default feature, but the FlashDevelop IDE actually has a built-in Flash tracer. The plug-in is unfortunately not enabled by default, and new users of FlashDevelop often get frustrated wondering where to look for the output of their trace statements.

To get the tracer to work:

1) Go to Tools -> Program Settings (F10).

2) In the Plugins list on the left of the dialog box, look for FlashLogViewer and click on it.

3) On the right panel, look for the “Start Tracking” property, click on the drop down box and select “OnBuildComplete” (it is set to “Manually” by default).

The output of your trace statements are now shown in the Output Panel after you build your project.

One response so far

Apr 15 2010

[OSX] Goodbye, Spaces… Hello, Spark!

Published by sunny under Others,Tips

This post may come across as blasphemous to ardent Mac fanatics, but I am hoping that OSX users who are in the same predicament as me may find it useful.

I have finally disabled Spaces on Mac OSX. It’s a little painful to disable it, because I had considered it a very crucial feature, considering that without it the desktop gets cluttered quickly with the way the Mac OS presents applications and their respective windows (all mixed together in one very confusing bucket). However, the slide animation that occurs every time Spaces switches from one space to another has become really nauseating.

It was cool at first, but now it is painful to watch.

So much for Apple’s acclaimed emphasis on the “user experience”. Does nobody in the UX team ever stop to think that not everyone likes gimmicky animation stuff for frequent tasks, and there should be an easy way to disable such animations? Unfortunately, there is just no way to disable the animations – I hope to be proven wrong, but my searches have come up fruitless. A quick google visit shows there are other users who wish to get rid of the animation too (and apparently I am not the only one suffering from motion sickness, although most simply want to get rid of the animation just to save time, keeping multitasking slick and snappy).

So, now that I have disabled Spaces, what do I do now with the cluttered desktop? I am currently solving the issue with a little AppleScript and implementation of keyboard shortcuts via Spark – a free utility to create Hot Keys to launch applications and documents, execute AppleScript, etc.

Continue Reading »

No responses yet

Mar 31 2010

uiFrame: ActionScript 3.0 GroupBox

Published by sunny under Aspire UI,Flash,Tips

It is often overlooked, but the uiFrame component in the Aspire UI toolkit essentially has the same utility as the GroupBox in WPF (Windows Presentation Foundation).

A GroupBox displays a border/frame around a group of controls, with or without a caption/title. This is typically done to provide visual feedback to end-users that a collection of controls on a form is logically grouped.

When using the Aspire UI toolkit in ActionScript 3.0 projects, you can use the uiFrame component for the same results.

Continue Reading »

No responses yet

Mar 30 2010

uiColorPicker: Customizing The Colors Palette

Published by sunny under Aspire UI,Flash,Tips

In this post, we look at how the colors palette/swatch of the uiColorPicker control can be customized.

Continue Reading »

No responses yet

Mar 27 2010

uiColorPicker: Adding Drop Shadow To Popup Palette

Published by sunny under Aspire UI,Flash,Tips

The uiColorPicker control displays a single rectangular button that brings up a palette of pre-defined set of colors (also known as a color swatch). By default, this popup does not cast a drop shadow, as shown in the screenshot below:

In this post, we look at how to get the popup to cast a drop shadow, by simply adding some directives in the “rules.xml” of the theme you are using.

Continue Reading »

No responses yet

Jan 04 2010

Using AspireUI Components with MDM Zinc 3.0

Published by sunny under Aspire UI,Flash,Tips

MDM Zinc™ 3.0 is a feature-rich Rapid Application Development Tool for turning SWFs into stunning commercial cross-platform desktop applications, screensavers, widgets, CD roms, DVD’s, kiosks and more. The AspireUI AS3 library uses PNG image files for component skinning, and this ease of skinning is a good fit for Zinc™ 3.0 projects, especially if you would like to create applications that look like native desktop applications. The toolkit currently comes with four component themes – “classic”, “xp”, “vista” and “graylic”. The first three aforementioned themes are Windows OS lookalike themes.

In this short tutorial, we will look at how you can use the AspireUI library in Zinc™ 3.0 projects, and how you can easily swap component themes by simply changing one line of code.

Continue Reading »

No responses yet

Dec 17 2009

Small Caps Fonts

Published by sunny under Others,Tips

In typography, “small caps” refer to uppercase (capital) characters used in-lieu of lowercase (small) characters, where these uppercase characters are set at the same height as the lowercase characters.

Small caps are typically used for titles, headlines, column headings, etc. They are also good for any text that you would usually use all capitals. This is because the use of small caps makes the run of capital letters seem less jarring, and would also often require less space than all caps.

While many word processors and text formatting systems include an option to format text in small caps (which leaves uppercase letters as they are but converts lowercase letters to small caps), this is a feature that is lacking in most graphics editing software.

Some fonts have inherent small caps, ie they use smaller capital letters in place of the lowercase characters. These fonts are useful when you wish to use small caps to bring distinction to your designs.

Here are some fonts with inherent small caps:

Continue Reading »

No responses yet

Dec 13 2009

[AS3] Serializing A Bundle Of Bitmaps As Data Objects

Published by sunny under Flash,Flash AS3,Tips

This post is a supplement to “Serializing Bitmaps (Storing BitmapData As Raw Binary/ByteArray)”. In that article, we looked at how to convert BitmapData to a ByteArray, save that ByteArray, and re-construct the BitmapData from the saved ByteArray.

It is important to note that the technique saves the ByteArray “as is” in a flat binary file without any header or any block of metadata – this means that the file will in itself not be able to communicate its data structure and therefore, proper usage of the data requires prior knowledge of how the data has been packed (we used the first four bytes for storing the value of the width of the image). As a result, that method may be deemed as an “unorthodox” hack and unsuitable in team development.

In this post, we look at how you can employ the same basic idea while making the saved data more “consumable” by other developers.

Continue Reading »

2 responses so far

Dec 12 2009

uiWindow: Background Drop Shadow + Glow Effect

Published by sunny under Aspire UI,Flash,Tips

The default behavior of the uiWindow container is to cast a drop shadow when it is active in the foreground, and not do so when it is inactive or when it is maximized to fill the stage. This behavior is determined by the component instance’s background property value.

Continue Reading »

No responses yet

Next »