From: Kazuhiro Yoshida Date: 2001-01-08T15:34:38+09:00 Subject: [ruby-talk:8825] Re: Dynamic Flash movies from Ruby Hi, I created ming/Ruby extension for mswin32: http://www.moriq.com/ruby/archive/mq-ming-0.0.1.zip lib and sample package for Apollo (Ruby+Delphi): http://www.moriq.com/ruby/archive/ap-ming-0.0.1.zip sample code (animation.rb): -- require 'swf' class Spinner @@font = Swf::Font.new "../common/test.fdb" def initialize(r, g, b, a, rot, x, y, scale, string) t = Swf::Text.new t.font = @@font t.set_color r, g, b, a t.height = 960 width = t.get_string_width(string) t.move_to -width/2.0, 220 t.add_string string @x = x @y = y @rot = rot @scale = scale @i = $m.add t @i.rotate_to rot @i.scale scale, scale end def step @rot = 19 * @rot / 20.0 @x = (19 * @x + 1200) / 20.0 @y = (19 * @y + 800) / 20.0 @scale = (19 * @scale + 1.0) / 20.0 @i.rotate_to @rot @i.scale_to @scale, @scale @i.move_to @x, @y end end string = "ming!" $m = Swf::Movie.new $m.rate = 24.0 $m.set_dimension 2400, 1600 $m.set_background 0xff, 0xff, 0xff i1 = Spinner.new 0xff, 0x33, 0x33, 0xff, 900, 1200, 800, 0.03 , string i2 = Spinner.new 0x00, 0x33, 0xff, 0x7f, -560, 1200, 800, 0.04 , string i3 = Spinner.new 0xff, 0xff, 0xff, 0x9f, 180, 1200, 800, 0.001, string (1..100).each do |i| i1.step i2.step i3.step $m.next_frame end $m.save "test.swf" -- Apollo - Delphi Ruby interface http://www.users.yun.co.jp/~moriq/apollo/index-en.html Ming - an SWF output library and PHP module: http://www.opaque.net/ming/ moriq ---- Kazuhiro Yoshida moriq.kazuhiro@nifty.ne.jp