Flex Optimization Tip: Evaluate Your Setter Parameter

Social Share Toolbar

Flash Builder makes it easy to generate getters and setters from a variable definition. Just select the variable, right-click and choose Source > Generate getters/setters.

The generated code is simple; the getter returns the value and the setter sets the value:

private var _myData:String;

public function get myData():String {
    return _myData;

public function set myData(value:String):void {
   _myData = value;

Oftentimes in Flex, however, changing a variable is a trigger that causes other code to run or update. But why would you want this extra processing to occur if the value that is being assigned hasn’t changed?
Continue reading “Flex Optimization Tip: Evaluate Your Setter Parameter”

Swiz ‘Could not get a reference to class’ Gotcha

Social Share Toolbar

I’ve been implementing Swiz framework in my most recent Flex project. It’s worked great so far, but this one error sidetracked me for an hour or so:

"Could not get a reference to class for YourEvent.YOUR_EVENT_TYPE. Did you specify its package in SwizConfig::eventPackages?"

Continue reading “Swiz ‘Could not get a reference to class’ Gotcha”