flex example

warning: Creating default object from empty value in /home/nbilyk/nbilyk.com/wwwroot/modules/taxonomy/taxonomy.pages.inc on line 34.

Flex History Manager

When building flex or flash applications, it is extremely important to think about browser navigation. The browser's back button is the most commonly used control on the web, so if your application doesn't allow for forward and back navigation, you are severely limiting your user's experience.

If you are working in Flash, you've probably heard of SWFAddress. Use it. It's simple, it's solid, it will take you ten minutes to learn.


Read more...

XML Namespaces

This article isn't to teach you what namespaces are, how they work, and why you would use them, this article is just to help you take the first step to figuring out how to parse xml with namespaces in it.

var xml:XML = <root>
	<h:table xmlns:h="http://www.w3.org/TR/html4/">
	  <h:tr>
	    <h:td>Apples</h:td>
	    <h:td>Bananas</h:td>
	  </h:tr>
	</h:table>
 
	<f:table xmlns:f="http://www.w3schools.com/furniture">
	  <f:name>African Coffee Table</f:name>
	  <f:width>80</f:width>
	  <f:length>120</f:length>
	</f:table>
 
</root>


Read more...

Automatic scroll on tab focus

A common requirement in a Flex application is to make the page automatically scroll to show the field that you tabbed into.
This article will show how to do this.


Read more...

Kinetic scrolling example

Flex source code for kinetic scrolling.


Read more...

Flex repeaters tutorial

Flex Repeaters can save you a lot of time. As long as they work, but troubleshooting these little guys can be a serious pain in the butt. In this article I'm going to talk about some best practices to avoid some major headaches.


Read more...

Replacement Flex DataGrid

If you've ever built a highly customized project before, using the Flex DataGrid, you'll know how much of a headache it can be.

  • It chokes on sorting 20K or more rows on custom fields like Dates, case-insensitive Strings, or other data types.
  • When you have custom item renderers, you have no easy way of accessing the cell instances.
  • It's nearly impossible to extend or add your own functionality.
  • Editing with it is troublesome and the UI leaves something to be desired.

So I wrote my own.


Read more...

URLValidator

In case somebody needs it. Here's a URLValidator. I'm sure there are plenty out there, but it was quick to write, so here it is.

package com.nbilyk.flex.validators {
	import mx.validators.ValidationResult;
	import mx.validators.Validator;
 
	public class URLValidator extends Validator {
		public function URLValidator() {
			super();
		}
 
		private var _invalidUrlError:String = "This is an invalid URL.";
 
		[Inspectable(category="Errors", defaultValue="null")]
 
		/**
		 *  Error message when a string is not a valid url. 


Read more...

Make scrolling in flash not scroll in browser

I found a great article I thought I'd share:
http://avatar-soft.ro/blog/?p=4

It's how to prevent your browser from scrolling when you are scrolling with flash content.

I fixed a minor bug and made it as a js file, so to use it, just download the js file (remove the .txt) and add this to your html code.

  <script type="text/javascript" src="hookMouseWheel.js"></script>

Easy enough?


Read more...

How to get html text in a Flex Alert panel.

A client asked me to do something seemingly simple.
"I want the Alert to have just this one sentence bolded."

Well, it's not exactly simple, so here's how you do it:

  var str:String = "There was a problem with your form. ";
  str += " <b>Would you like to continue without saving?</b>";
  var alert:Alert = Alert.show(str, "Problems in data entry", Alert.YES | Alert.NO, 
                                                         Application.application as Sprite);
  use namespace mx.core.mx_internal;
  IUITextField(alert.alertForm.textField).htmlText = str;


Read more...

Better FormItem

Download a better FormItem class. Allows multiline, selectable, and maxWidth properties.


Read more...
Syndicate content