| Class | Sprout::SWFMillTask |
| In: |
bundles/as2/lib/sprout/tasks/swfmill_documentation.rb
bundles/as2/lib/sprout/tasks/swfmill_rdoc.rb bundles/as2/lib/sprout/tasks/swfmill_task.rb |
| Parent: | ToolTask |
Compile a set of assets (pngs, gifs, jpegs, mp3s, fonts, etc) into a library swf using SWFMill.
The resulting SWF file can be a Flash Player 6, 7 or 8 file format and is appropriately used as asset input for MTASC or MXMLC compilation.
This task simplifies SWFMill usage so that you can essentially point it at a directory of images, set the task as a prerequisite for an MTASCTask or an MXMLCTask, and have them self-configure to include the output.
A simple example is as follows:
swfmill 'assets/skins/SomeProjectSkin.swf' do |t|
t.input = 'assets/skins/SomeProjectSkin'
end
# File bundles/as2/lib/sprout/tasks/swfmill_task.rb, line 27 def initialize_task @default_gem_name = 'sprout-swfmill-tool' add_param(:simple, :boolean) do |p| p.value = true p.hidden_value = true p.prefix = '' p.description = "Set the SWFMill simple flag. This setting will determine what kind of xml document the compiler expects. Unless you really know what you're doing with SWFMill, this setting will usually be left alone." end add_param(:input, :string) do |p| p.hidden_name = true p.description ="The input can be one of the following\n* SWFMill XML document: Create and manually manage an input file as described at http://www.swfmill.org\n* Directory: if you point at a directory, this task will automatically include all files found forward of that directory. As it descends into child directories, the items found will be exposed in the library using period delimiters as follows:\n\nThe file:\n yourcompany/yourproject/SomeFile.png\nWill be available in the compiled swf with a linkage identifier of:\n yourcompany.yourproject.SomeFile\n" end add_param(:output, :file) do |p| p.hidden_name = true p.description = "The output parameter should not be set from outside of this task, the output file should be the task name" end add_param(:template, :file) do |p| p.description = "An ERB template to send to the generated SWFMillInputTask. This template can be used to generate an XML input document based on the contents of a directory. If no template is provided, one will be created for you after the first run, and once created, you can configure it however you wish." end self.output = name.to_s end
The input can be one of the following
The file:
yourcompany/yourproject/SomeFile.png
Will be available in the compiled swf with a linkage identifier of:
yourcompany.yourproject.SomeFile
# File bundles/as2/lib/sprout/tasks/swfmill_documentation.rb, line 16 def input=(string) @input = string end
The input can be one of the following
* SWFMill XML document: Create and manually manage an input file as described at http://www.swfmill.org * Directory: if you point at a directory, this task will automatically include all files found forward of that directory. As it descends into child directories, the items found will be exposed in the library using period delimiters as follows:
The file:
yourcompany/yourproject/SomeFile.png
Will be available in the compiled swf with a linkage identifier of:
yourcompany.yourproject.SomeFile
# File bundles/as2/lib/sprout/tasks/swfmill_rdoc.rb, line 16 def input=(string) @input = string end
The output parameter should not be set from outside of this task, the output file should be the task name
# File bundles/as2/lib/sprout/tasks/swfmill_rdoc.rb, line 21 def output=(file) @output = file end
The output parameter should not be set from outside of this task, the output file should be the task name
# File bundles/as2/lib/sprout/tasks/swfmill_documentation.rb, line 21 def output=(file) @output = file end
Set the SWFMill simple flag. This setting will determine what kind of xml document the compiler expects. Unless you really know what you‘re doing with SWFMill, this setting will usually be left alone.
# File bundles/as2/lib/sprout/tasks/swfmill_rdoc.rb, line 4 def simple=(boolean) @simple = boolean end
Set the SWFMill simple flag. This setting will determine what kind of xml document the compiler expects. Unless you really know what you‘re doing with SWFMill, this setting will usually be left alone.
# File bundles/as2/lib/sprout/tasks/swfmill_documentation.rb, line 4 def simple=(boolean) @simple = boolean end
An ERB template to send to the generated SWFMillInputTask. This template can be used to generate an XML input document based on the contents of a directory. If no template is provided, one will be created for you after the first run, and once created, you can configure it however you wish.
# File bundles/as2/lib/sprout/tasks/swfmill_rdoc.rb, line 26 def template=(file) @template = file end
An ERB template to send to the generated SWFMillInputTask. This template can be used to generate an XML input document based on the contents of a directory. If no template is provided, one will be created for you after the first run, and once created, you can configure it however you wish.
# File bundles/as2/lib/sprout/tasks/swfmill_documentation.rb, line 26 def template=(file) @template = file end