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

Aug 28 2010

On Permutations, Probabilities and Psychology

Published by sunny under Others

Shuffling an array of items is a common topic in programming, especially as an academic exercise. In my previous post, I wrote about a different approach towards cards shuffling in programming – which is to not do it. Instead, you can randomly select and remove an item from the array whenever you need to retrieve an item. As far as distribution of probabilities goes, there is no difference between the two methods.

The seemingly controversial topic received some interesting comments. Due to certain fallacies introduced by a commenter, I thought I should clarify those points for the benefit of any reader who might become confused after reading his comments. My reply got a little too long, so I am posting it here.

Continue Reading »

One response so far

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

Aug 04 2010

Mac OSX Keeps Restarting On Its Own?

Published by sunny under Others

Ever since I first started using Mac OSX, I have been haunted by this strange behavior. On Windows, if I leave the machine to take a much needed break, or to take a phone call, go for a run, take a shower, etc. I can return to the machine later, with my work-in-progress intact, safe and sound. Or downloads in Firefox completed. Or whatever tasks that were left running, either still running or completed.

On the Mac, I have lost much work and time due to the Mac OSX intrusively restarting on its own. Drafts not saved? Say farewell – lost forever. Downloads disrupted – start over (unless resume miraculously works). This is especially exasperating, considering that Apple requires you to update the iPhone SDK/Xcode by re-downloading the whole package. Not patching, but re-downloading a 2GB+ file.

So, why exactly is the Mac restarting on its own, even when it is not idle such as having a download-in-progress?

Turns out that this is due to a rather useless Security feature. Ridiculously, the “Log out after 30 minutes of inactivity” setting is the culprit. So, to save yourself some agony, make sure you turn it off:

If your Mac has been suffering from this problem, hope the above helps!

Seriously, I have no idea what purpose this Security feature serves, other than to make you lose progress in your work. By comparison, on Windows, if the OS logs you out due to inactivity, it actually restores your session with your work-in-progress intact the next time you log in. You can even safely switch between user accounts on Windows, and log back into an account with its last session intact.

P/S: As far as security goes, you should just check the “Require password” option.

2 responses so far

Apr 22 2010

uiImage: Loading Resources From Foreign Domains

Published by sunny under Aspire UI,Flash

The uiImage component is used to display an image (JPG/PNG/GIF). The path to the image is specified by the source property. By default, the uiImage object will attempt to load resources from the “assets/images/” folder (path is relative to the application SWF). To load from a different path, for example the folder “resources/images/”, prefix the source with “url:”, example “url:resources/images/garden.jpg”.

In order to load images from a different domain, the Flash Player will need to read a crossdomain.xml file from the foreign domain (and this file must grant permission to your domain to access the required resources). Typically, you would expect to need to specify a checkPolicyFile property somewhere. In the case of the uiImage component, there is no checkPolicyFile property to set because this would be unnecessary.

Continue Reading »

No responses yet

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

Mar 26 2010

Aspire UI Components Update v1.4

Published by sunny under Aspire UI,Flash,News

The Aspire UI Components toolkit has been updated to version 1.4 (changelog).

Continue Reading »

No responses yet

Next »