FAQs
Is it possible to produce compressed swf files?

Yes. If you are producing swf version > 5 and you have the %make-swf.r script newer than since 21-9-2003 you can produce compressed files using compressed: true parameter in the dialect file header or using: make-swf/save/compressed %mx-somefile

You should know that using compressed files you are probably loosing the possibility to stream that file (the file must be completely loaded to be uncompressed and processed).

How to create stand alone exe file from existing swf files?

Use the %make-projector.r script like that:

do %make-projector.r
write/binary %/j/test/jukebox.exe make-projector %jukebox.swf
Which one implements the dialect? What does the other one do?

There is list of main files included in the %make-swf.zip

  • %make-swf.r - The main dialect file which requires these files to run: swf-tag-rules.rb and actions.r
  • %swf-tag-rules.rb - file where are parsing rules for main swf tags as for example 'Shape or 'Sprite
  • %actions.r - which is file responsible for compiling actions in the dialect (usually block after 'DoAction tag)
  • If you need to convert bitmaps to bll format used in swf files, you should run img-to-bll.r or img-to-bll2.r (depends on which version of Rebol/View you are using)
  • %sound-fce.r - used for including sounds in the swf files
  • %extended-image.r file is used only for special purposes and in most cases it's not required.
  • To fix bug in some older Rebol's there is %debase-path.r by brett@codeconscious.com included in archive.
  • %exam-swf.r file is used for decompiling existing files and were made to test if compiler is working properly.
  • %exam-swf-mod.r is suposed to replace the %exam-swf.r script which just prints informations instead of returning valuable informations (this script is not finished yet).
  • %analyse-swf.r is just an experiment and it's not finished as well.
What's a bin file?

The *.bin files are binaries which contains windows flash projector executables (depends on Flash version you need). You need these files if you want to make executable file from the dialect (or any *.swf file). To make this you just need the %make-projector.r script which does nothing else that just rejoins the content of the compiled *.swf file with propper *.bin.

Are the swfpr4/5/6-win.bin files generators for Flash 4/5/6 SWF respectively?

See the previous answer. These files are just needed if you want to produce *.exe files from existing *.swf files

Is "projector" the word you use for "generator"?

No. It just a Flash standalone Flash interpreter which is able to run swf files without Flash plugin installed

Can make-swf or make-swfprojector be used as stand-alone utilities to produce SWF files, or are they intended to be used as server-side components?

Yes. I'm using make-swf to create my Flash apps. I was using the make-projector once to save compiled files as *.exe files.

I don't use these script as server-side because I don't have to (if it's possible I prefere to create dynamic content on the client side from given data, but it's possible to use make-swf on the server side as well).

If you needed to create dynamic content on the server side, I would be thinking about somethink like pre-compiler so only neccesary data would be compiled on the demand, but as I said I don't need it.

The only reason I see why you would like to use on server-side is to overcome the flash security limitations of loading variables from different domain. That means that instead of loading variables using LoadVars in action-script you can load dynamic movie which contains your variables. This is one of the examples I would prefere to make special script to handle this issue.

Does this run under any OS that runs Rebol?

Yes. I didn't test it. But it should because that's system independent. I don't use any libraries although thay should speed some things. I don't have Rebol/View/Pro or other commercial Rebol anyway.

Could give me one example of the command line that you enter in rebol to create a swf?

In my %user.r file I have this:

go:
make object! [
    swf: func [/init][
        change-dir %path_to_dir_with_all_files/swf/
        if init [
            do %make-swf.r
            do %exam-swf.r
            do %jpg-analyse.r
            do either system/version > 1.2.2 [%img-to-bll2.r] [%img-to-bll.r]
            do %extended-image.r
        ]
        what-dir
    ]
    ;more paths...
]
then when I want to work with these files I do this in console:
>> go/swf/init
To compile something I do for example:
>>swf-bin: make-swf %swf-star2.rswf
or more often:
>>make-swf/save %swf-star2
which will save the compiled swf file into location specified in the rswf header (file) or:
>>make-swf/save/to %swf-star2 %/c/star.swf
if you want to work with some already compiled files you may want to use for example this:
get-all-assets: func[
        {Returns all assets IDs found in the SWF file (require %exam-swf.r)}
        swf-file /local a
][
        swf-bin: read/binary swf-file
        swf-bin: skip swf-bin 21
        assets: make block! []

        foreach-tag swf-bin [
                tagid: tag
                tag-bin: data
                switch tagid [
                        56      [
                                ;saving the tag to file
                                a: parse-Assets
                                if none? find assets a/2 [append assets a/2]
                        ]
                ]
        ]
        assets
]

>>  get-all-assets %star.swf
ImportingAssets "niceStar" from 1
== ["niceStar"]
Where can I find more informations about SWF file format?

From the beggining I was using specification which is provided by Macromedia on their page. (You must be registered to download it but it's free).

Why you are not using ActionScript in DoActions?

Because of Rebol is not able to load content with ',' chars:(

Is it possible to use any C library for making SWF files (for example the Ming) with this dialect?

Yes. But it would require commercial version of Rebol (at least Rebol/View/Pro) which is able to work with libraries. I don't have such a Rebol so I could not test how it would speed up some things.

COMMENT:

If you have more questions feel free to ask me by email, but you have to excuse me, sometimes it takes me quite a lot of time to answer:)

Last modified: 22. September 2003 14:31:35
.-=R.U.R=-.
TOPlist