# sprite.rb # example of Ming/Ruby # http://opaque.net/ming/examples/sprite.html require 'ming/ming' include Ming set_scale(1.0) s = SWFShape.new s.set_right_fill(s.add_fill(0xff, 0, 0)) s.move_pen_to(-50, -50) s.move_pen_to(50, -50) s.draw_line_to(50, 50) s.draw_line_to(-50, 50) s.draw_line_to(-50, -50) clip = SWFMovieClip.new i = clip.add(s) 18.times do clip.next_frame i.rotate(5) end clip.next_frame m = SWFMovie.new i = m.add(clip) i.move_to(160, 120) i.set_name('blah') m.set_background(0xff, 0xff, 0xff) m.set_dimension(320, 240) m.save('clip.swf')