Actionscript 3 RSS Reader Demo

I made this as a simple test for RSS parsing for a job a little while back, and it never was used for anything, so I’ll post it here as it may be of use to someone.

Its a simple RSS parser that uses the RSS and Atom libraries http://code.google.com/p/as3syndicationlib/ to handle parsing its RSS feeds. Although parsing RSS is trivial, I wanted to use a provided Adobe library for the hell of it.

The file is not overly documented and uses my scrolling panel and scrollbar classes to handle scrolling the RSS items.

An example is below.

The Flash plugin is required to view this object.

Source Files
Here is the relevant source file; Rss Reader Demo (357)

By downloading, you agree to the terms of use, outlined here: http://www.blog.noponies.com/terms-and-conditions

Dependencies
Zero

Using Asdoc under OSX

At work I’m without my install of Flex, and its various niceities like ant builds for creating ASDoc documentation for my various classes and work projects.

In the past I’ve messed around with the commandline controls for creating ASDoc documentation, but without a great deal of success.

However, at work today, I decided to get it working and create some documentation. There are a range of options for creating asdoc documents on the mac, I’ll list them below.

1 / Command line. Downloading the Flex SDK and kicking it command line style.

2 / Getting a copy of Flex, and using Ant to build your docs.

3 / Using either the SDK, or Flex but a front end tool like Dita to generate the shell scripts for you, that you then run in terminal to create your docs.

I’ve used Dita and Flex with an Ant build on my home mac. At work, I use the command line approach.

Heres how I got it to work, using the new Flex 4 SDK beta and the OSX terminal.

a / Make sure you have downloaded the latest Flex SDK. Unzip it and place it somewhere on your hard drive. Mine lives in the “Developer” folder of my OSX boot disk.
b / Open up a text editor. I always find it easier to work out my terminal commands in a text editor, and simply paste in what I want into termainl when I’m ready.
c / Find the path to your bin folder within your Flex SDK folder. The simplest way, is to simply drag n drop the bin folder into an empty terminal window, which will then give you the path to the folder. Or simply, type it out manually. You now need to tell terminal to work from this ‘bin’ directory, via the ‘cd’ command. The syntax for that is below;

cd path-to-you-flex-sdk-bin-folder

d / Now you can simply run the various asDoc commands to generate your documentation. The various commands I’ve used to create the documentation for my NpFSObjectresize class are listed below. Make sure the asdoc commands are all on one long line. For some reason, I had to have the footer and window title before the -doc-sources parameter.

cd /Developer/SDKs/flex_sdk_4.0.0.7219/bin/
./asdoc -main-title="NpFSOBjectResize Class" -window-title="Noponies NpFSOBjectResize Class" -footer="Copyright <a href='http://www.blog.noponies.com' title='Visit Class Author'>Noponies</a> 2009" -doc-sources=/Users/dsattler/Desktop/sample/noponies -output=/Users/dsattler/Desktop/sample/docs

As you can see from the example above, I have a folder called ’sample’ on my desktop with my actionscript residing in a folder called ‘noponies’. I’m simply outputting my docs to a folder called ‘docs’ which resides within that ’sample’ folder.

When you are ready, simply paste in your ASDoc commands into terminal, and you should see the asdoc tool run through its various steps. One thing I’ve noticed is that the Flex 4 ASDoc tool is much more strict about correctly closing html tags etc within your documentation. A missing closing /p caught me out.

ActionScript 3 LoadMovie Snippet

Over on kirupa, one of the users was complaining about the lack of LoadMovie in AS3.

While not being something that has ever concerned me in the slightest, I thought I’d whip up a quick AS3 version of the same general idea.

Its pretty simple. A singleton class, with a simple “loadMovie” method that accepts the string URL of the asset to load, the container to load it into, and an optional Boolean flag for deciding if the containers existing children (if it has any) are removed with each new load.

I doubt this will have much use, but who knows.

Source Files
Here is the relevant source file; LoadMovie (716)

By downloading, you agree to the terms of use, outlined here: http://www.blog.noponies.com/terms-and-conditions

Dependencies
Zero