Ming/Ruby is a library for Ruby to generate Macromedia Flash (SWF). It is a wrapper around Ming (a SWF output library).
The original Ming has a Ruby extension based on SWIG. However it seems not work well (for Ming version 0.2a). Then, I decided to write another wrapper. Though SWIG is simple to use, unfortunately I don't know about SWIG very much, and this Ming/Ruby library is not based on SWIG.
require 'ming/ming'
include Ming
@movie = SWFMovie.new
@movie.set_dimension(50, 50)
@font = SWFBrowserFont.new('_serif')
@text = SWFTextField.new
@text.set_font(@font)
@text.add_string('Hello, world')
@info = @movie.add(@text)
9.times { |j|
@info.move_to(0, j * 5)
@movie.next_frame
}
@movie.add(SWFAction.new('stop();'))
@movie.save('hello.swf')