If you've experimented with Flash video then you've most likey run into the scenario where you'd like to be able convert to flv on the fly. While Flash has support for certain video formats such as .mpg, .avi, and .mov this is usually handled by importing your video into the IDE and then exporting to .flv format.
Using a tool such as ffmpeg you can do the encoding on the fly. From the command line you can do something like:
ffmpeg -i video.mpg -r 12 -b 10 video.flv
The -i parameter tells the program to accept video.mpg as the input file.
The -r parameter sets the frame rate for the encoded flv video, in this case 12 frames per second.
The -b parameter sets the bitrate for the encoded flv video, in this case 10kbps.
The best thing of all is that this utility is completely free! I'm working on a ColdFusion app that allows you to upload small video clips and encodes/plays them on the fly through the Flash player. I'll post a link when it's ready.
I recently finished a project for a friend who needed a recursive tree component built in Flash. Instead of reinventing the wheel, I decided to extend the Macromedia V2 Tree component. I'm working on delivering the file as a compiled clip and if you're interested in a copy then please post a comment here or send an email to dennisbaldwin at gmail dot com. You can see an example of the component here:
This example is fed from a tree.xml file that has label and id attributes for each node. Whenever a selection is made the value is stored in an id array which can then be passed to your backend application for processing.
Another interesting feature is that it has the ability to handle duplicate id's within the tree. For example, if you drill down to Customers > Mail > Inbox and select it you'll notice that the Mail node (the 2nd one) gets selected as well. That's because the id's are duplicates.
Right now there is only support for a single icon type but I have plans to extend this to support many different types. If you have any suggestions that you'd like to see implemented then please feel free to comment or shoot me an email.
If you've dealt with Flash MX Pro 2004 and runtime sharing of the WebServiceClasses component, then you've most likely run into errors during compilation. Under normal circumstances, you drag the WebServiceClasses into your movie, compile, and off you go. For larger applications you might find that it makes more sense to create some sort of shared assets library.
I stumbled across this a few months ago when converting the SensorLogic M2M Portal to Flash. We make extensive use of the WebServiceClasses component and it didn't make sense to include it in every single Flash file. So we created a shared assets library and used the same little 25kB component over and over.
Once we integrated Flash into our automated build process we ran into some major headaches when compiling. We were basically checking to see if the IDE threw any errors when compiling all of our .flas. Of course the compiler complains when the WebServiceClasses do not exist in the movie that references them. They'll exist during runtime, because they've been preloaded. Yet the IDE isn't smart enough to know this.
So here comes a workaround that I found to be EXTREMELY useful. If you try to compile a movie that has the following code:
import mx.services.*;
var ws:WebService = new WebService("http://www.xmethods.net/sd/2001/TemperatureService.wsdl");
var wsResult:PendingCall = ws.getTemp("75214");
wsResult.onResult = function(result)
{
trace(result);
}
and doesn't have a WebServiceClasses component in it's library you'll get the following error:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: The class 'WebService' could not be loaded.
var ws:WebService = new WebService("http://www.xmethods.net/sd/2001/TemperatureService.wsdl");
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: The class 'PendingCall' could not be loaded.
var wsResult:PendingCall = ws.getTemp("75214");
Total ActionScript Errors: 2 Reported Errors: 2
So to suppress this error you need to place a few intrinsic class files in your ActionScript Classpath. These files are simply stubs that specify which methods are contained within the class, but the compiler does not check their validity. If you'd like to see an example check out the Boolean.as file. The class files are generally located at:
C:\Documents and Settings\Username\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes
So I ultimately placed a WebService, SOAPCall, and PendingCall intrinsic class file in the following location:
C:\Documents and Settings\Username\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\mx\services
Now my .flas compile with no problems at all. If you'd like to see an example of this technique please feel free to download the following zip file and place the intrinsic class files at the location listed above. Be sure to unzip all of the files into a single location and run them. The main file that you'll want to test with is called "temperature_service.fla". I would recommend trying to run it intially (to see the errors), then place the intrinsic class files in their correct location and try again. It should work and if not please feel free to drop me a line!
Click here to download the sample files.