Nice conditional coding tip

Posted By Thaylin on May 13, 2010

Tyler from FCNY turned me on to a nice tip on conditional coding.

Let’s take for example we have a variable that we need to associate with another variable. For instance, we pull in some flashvars and need to check if these exist and if not give them a default value. Let’s look at a couple of the standard ways we can do this. (more…)

Handy code snippets plugin for Flex/Eclipse

Posted By Thaylin on April 7, 2010

For all of those unaware of snippets, these are code shortcuts to increase coding productivity and are damn handy. For an extended idea of what you can do with these visit this blog post I ran across:

On a side note, the poster doesn’t tell you how to install CFEclipse so I’ll just touch on that real quick so you can use these as your reading the blog post. In Eclipse (assuming 3.4.2 Ganymede), go to help>software updates>Available Software – click on Add Site, add http://www.cfeclipse.org/update, select CFEclipse CFML Editor and choose the latest build. Choose to install and follow the prompts. Once you have that installed you’ll be able to access the Snippet Tree View by going to Window>Show View>Other and opening the CFML folder. There you’ll see the Snippet Tree View. Then visit the blog link below and enjoy using wonderful shortcuts!

[link]http://blog.mxunit.org/2009/04/timesavers-cfeclipse-snippets.html[/link]

Dynamic class property retrieval

Posted By Thaylin on December 11, 2009

I’m taking a break from the pattern tutorials for the moment to write the as3 facebook connect integration library I’ve been meaning to write. With that said, here’s a little method I didn’t realize was around to pull properties from classes. Normally the for..in method you can pull properties available within an object, but this doesn’t work on classes you create. (more…)

Singleton Pattern introduction

Posted By Thaylin on November 11, 2009

Staying on the course of my tutorial kick I’m now moving to the Singleton pattern. Understanding this pattern will help later in understanding patterns such as the Factory Pattern which I will be discussing later.

Another pattern, or rather anti-pattern according to some, is called the Singleton Pattern.

The Singleton pattern, as the name implies, allows for the use of one and only one object of a particular class. This pattern is a bit overused but it can be handy in some areas. For instance (more…)

MVC (Model-View-Controller) introduction simplified

Posted By Thaylin on November 4, 2009

It recently came to my attention that while working alone I have lost a bit of the ability to explain programming patterns. It’s not that I’ve forgotten about them, as I use variations of them in everyday work, but I’ve just lost touch with the ability to easily explain the workings of them.

So what better way to refresh myself than to publish some tutorials on them!

Looking through the web I’ve noticed there’s not to many just simplified and easy to understand explanations of MVC, how it really works, and why would one even want to use that as opposed to just coding willy nilly.

I’ll spare you the history of MVC and just send you to the wiki page instead to read for yourself if you want : MVC Wiki

Basically it works like this:
(more…)

See the code Flex generates for you

Posted By Thaylin on September 24, 2009

A fascinating way of seeing all the code that the mxmlc compiler generates from your flex apps is to set a compiler flag for your project.

-keep

This takes all the generated code from your mxml files and places it in a “generated” folder in your src folder. This is great because it gives you the option of seeing just what it is that the compiler is generating so your not completely blind to the process.
Enjoy!

Spiraling through a matrix

Posted By Thaylin on August 21, 2009

As I was saying in my previous post, I ran into a little trickiness with circling through the squares in my matrix of squares. Now there may be a better way to do this, and by all means if there is let me know, but here is the best way I figured out how to do it.
(more…)

Papervision 3D Audio Matrix

Posted By Thaylin on August 21, 2009

I’m in the process of getting to know Papervision 3D more finally. With that I decided to play around with it and music. I created a group of squares and each squares Z axis is controlled by a byteArray set with SoundMixer.computeSpectrum. I run through the byteArray, assigning each square it’s own Z pos based on that byte value in a spiral formation (which on it’s own was a tricky feat). Mind you this is only one side of the spectrum with only 256 instances.

Here’s the initial creation. I set row colors so I could tell what row was the starting row for the group.

Click to view:

SoundTester1

FireBugLogger class update

Posted By Thaylin on June 3, 2009

So a while ago I wrote a class that I called FireBugLogger that uses the console.debug as well as the rest of the FireBug method calls.

Today I came across a great way to help the other developers that may be implementing your flash on the html side. Though you’ll have to call the debug methods calls yourself in the flash, the html or backend developers that might be seeing an issue and aren’t sure if it’s data related can turn on the debugger when needed. By just adding an ExternalInterface.addCallback(’enabledDebug’, enableDebug) and then in then enableDebug method enable your FireBugLogger. This way it’s generally turned off unless the developers need to debug various things.

Just a thought.

crossdomain gateway or “How can I get that data!”

Posted By Thaylin on May 29, 2009

A lot of sites today are very open with their APIs allowing users from other sites to retrieve their data, but sometimes you’ll come across websites that may not have that same open access. When their sites limit the access that other sites can retrieve data from via the crossdomain file it’s frustrating to say the least.

This issue also comes into play when you’re working on a site that may have strict crossdomain policies and you want to be able to test on a local server and call this data.

So what to do? How can we access this data easily when we don’t have the ability to simply change the crossdomain file?

It’s known that you can use php to act as a gateway to pull data from other sites, but what if you have a url that you need to call and pass various parameters through to? You could just use the $_GET['myParam'] to retrieve each and every variable you may need to reference but that can get cumbersome if you start needing to set lots of parameters or it changes from time to time.

So here’s what I’ve found to be the easiest way to access this. (more…)