nbilyk's blog

Flex verticalScrollPolicy bug

When you have content with width set to 100%, and verticalScrollbarPolicy set to auto, when you resize the window so the vertical scrollbar is needed, you would expect the content area to adjust to handle the newly added vertical scrollbar, but it doesn't. What happens instead is a horizontal scrollbar appears.

To reproduce this bug:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
	<mx:Canvas width="100%" height="700"/>
</mx:Application>


Read more...

Flash E4X Tutorial

This is a beginner's guide to E4X.
Flash has some good documentation on using E4X at:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html?XML.html&class-list.html,
but it's hard to digest all that if you're just getting started.

You can download the example attached below and follow along.


Loading xml

Before we begin parsing any xml, I'll explain briefly how to load the xml.


Read more...

Copying typed objects

Attached below is a utility class with 3 static methods:

  • clone
  • compare
  • mergeObjects

Clone lets you copy Objects and Arrays. If you copy a different class, the public properties (and recursive public properties) will get transferred, but the private properties won't. Also, the cloned object can only be of type Object or Array.

Compare lets you compare recursively the public properties of two objects or arrays. Useful for multi-dimensional arrays.


Read more...

Adobe sucks

I've been a flash developer ever since Macromedia bought Flash from FutureSplash. When Adobe took it over after Flash 8, CS3 and CS4 has brought some great things, and brought some colossal headaches.
Things they've done right:

  • Actionscript 3.0
  • Tight integration with design tools. (Creative Suite)
  • Flash player improvements

Things they've done wrong:

  • IDE is more bloated, and harder to work with
  • Motion editor

Read more...

Removing label from ProgressBar

In case this saves anybody some time. Removing the label from a flex ProgressBar isn't exactly straightforward. This is what I had to do:

<mx:ProgressBar label="" labelPlacement="right" labelWidth="0" horizontalGap="0" />


Read more...

Flex localization example

Earlier I posted how to do Flash localization. Now it's time for an example of Flex localization. Flex localization is a bit more difficult to do, but it's a lot better done. Follow along with the example attached at the bottom of the post.

This example is for Runtime localization. This means that the resource bundles will be external swf files and will not be compiled into your main application.


Read more...

Flash Localization Example

Localization, Internationalization, or I18N, whatever you want to call it, is just a way to separate your text from your interface so that it can be translated and/or maintained apart from your application.

There are many benefits to this, even if you never plan on having your application in multiple languages. Localization makes your program more maintainable, easier to update, and more flexible to change.

Here's how to localize your content in Flash. It's a lot easier than you might think!

First, open your strings panel:


Read more...

Bug in my cereal

There was a bug in my cereal... I know this has nothing to do with Flash, but seriously, there was a big fat bug mixed in with my cracklin' oat bran.


Read more...

Flash garbage collection

The garbage collection in Flash is all done behind the scenes, and it takes some tricks up the sleeve in order to ensure things get garbage collected, and also to check whether things are garbage collected.


Read more...

Web development workflow

For the world to see, here's the tools I use in my every day workflow.

  • Flash development - FDT. FDT is a must have for larger projects and very nice for smaller ones too. It runs off the eclipse platform, and has all the code validation and refactoring tools java and .net programmers are pampered with. (About 500$)

Read more...
Syndicate content