Sha256: 12628ecc135c7540809e75119694320e00fbeb1435e9058c05d043dd7070fb4d

Contents?: true

Size: 631 Bytes

Versions: 2

Compression:

Stored size: 631 Bytes

Contents

# code: 
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: flash.rb 189 2004-12-13 21:38:05Z gmosx $

require 'nitro/service'
require 'ming/ming'

module N


# = FlashService 
#
class FlashService < N::Service
	include Ming
	
	SOURCE_FILE = __FILE__

	def show_text
		create_flash
	end	
	
private

	def create_flash
		m = SWFMovie.new
		f = SWFBrowserFont.new('_serif')
		t = SWFTextField.new
		t.set_font(f)
		t.add_string(@params['text'])
		m.add(t)
		@response.header['Content-Type'] = 'application/x-shockwave-flash'
		m.save('tmp.swf')
		@out = File.read('tmp.swf')
	end

end

end # module

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.7.0 examples/flash/lib/flash.rb
nitro-0.8.0 examples/flash/lib/flash.rb