[as3] How to use flex/as3 examples in flash 9

I want to test some things in AS3, and am currently trying to use some things i found on the internet. A lot of the examples are made for flex (i think)… they just dont work.
Take for example the pngencoder from adobe. Copy pasting it obviously doesnt work, so could anyone explain how to change it?..

Cant wait to try out all these examples :azn: