A FP9 and an FP10 version of a class

Now and again, I use features in a class that are only available for FP10, however, I usually make a FP9 version, because otherwise I would be like Microsoft and only target a specific platform allowing for no past compatibility whatsoever, expecting everyone to conform to using FP10 because it is newer. So, in those case, I usually create an FP9 version as well.

Currently, I may create a version named “MyClassCS3” and a separate one named “MyClassCS4”. It probably might be better just separating it into a separate directory, which I also do at times.

However, when I need to make updates to the class, I need to go in and make sure I do the exact same thing to both versions.

Now, there must be some smoother way of doing this. Any ideas?

In addition, anyother problem which would make development easier, I want both classes to be available to me at need. For instance, let’s say I usually work on FP10 projects. I could copy the FP10 version to my global classpath, and pretty much only use that. Then one day, I’m developing a game for FP9, I could copy the class directly to that game directory. It’s a hassle, but it works.

However, mid development, I’m required to switch over to FP10. Then I need to go back and swap out my CS3 classes with CS4 versions. Or I could make a class that keeps track of which classes classes have multiple versions, and does something like this:
public static const MyClass:Class = MyClassCS3;

Something REALLY smooth would be to tell the compiler directly which lines to include if it was targeted for FP10, and which lines to include if targeted for FP9. Then you only need one file, and it may look something like this:

[VERSION=9.*]
private var myArray:Array = new Array();

public function store(item:int)
{
   myArray.push(item);
}[/VERSION]

[VERSION=10.*]
private var myVector:Vector.<int> = new Vector.<int>();

public function store(item:int)
{
   myVector.push(item);
}[/VERSION]

So, how do you guys deal with FP version compatibility?