Ayan Ray

Thoughts on Software Engineering

AssetLoader Updates – we have video!

As promised, I’ve updated the AssetLoader and pulled it into the 21st century. It is a lot more… flex-ible if you get what I mean (of course you do). Anyways, as a reminder, you can sync up with the following repository to get the code: http://assetloader.googlecode.com/svn/trunk

A word of warning: the new repository is now a home for all my code related to AssetLoader and that means it’s larger and more complex. What could be in there other than the value-added loading code you might ask? Well, I’ve got loader tests, which include examples to prove to myself that video, sound, images, and xml work (I assume images and xml work since it’s been working since the beginning) and I’ve got unit tests (with hamcrest and flex unit 4). Although the tests and the unit tests are not complete, I will be adding more as I get more experience using video in flash and more experience using flex unit.

A note about the video loading: Take a look at the video example in the AssetLoaderTests folder. You will notice that I have to save a reference to the netStream. In order to close out the AssetLoader and remove all references (clean up for garbage collection), I must null all variables created within the AssetLoader. Thus, if you try to add the video without storing a reference to the netStream, you will either see a blank screen or a frame of the video (however far it got until the netStream was deleted). So, keep a reference of the netStream for all videos you load and show (you can delete the references if you don’t need it of course) in order to get around this issue.

If you really only care about the source code, and I expect most of you to fall into that category, sync up with this repo: http://assetloader.googlecode.com/svn/trunk/AssetLoaderSource

It’s got everything you need to get up and running.

And finally, if you really just want the source to play around, you can download the SWC source from google repository: http://code.google.com/p/assetloader/source/browse/#svn/trunk/AssetLoaderSource/bin

or the zip file here: http://www.ayanray.com/downloads/assetloader_v1.3.8

Comments, feature requests, and feedback are always appreciated! I’m making this class available to help you! If it doesn’t do something that you think it should, hit me back.

Roadmap


1.5  -> Array Support

1.6 -> Perhaps I’ll do support for wave files and other embeddable but not loadable files (through ByteArray)

« »

© 2017 Ayan Ray. Theme by Anders Norén.