As the latest FDT version ( Beta 4 ) does not set compiler arguments concerning SWF-size, framerate etc. by default I started using SWF-Metatags to specify these settings.
I'm talking of these things:
Actionscript:
-
[SWF(width="910", height="610", backgroundColor="#FFFFFF", frameRate="40")]
Just set this tag above your class opening in the one you're going to compile. Here is a complete list of (useful) arguments you can pass in:
- width
- widthPercent
- height
- heightPercent
- scriptTimeLimit
- frameRate
- backgroundColor
So basically this is the fastest way to set up common compile-arguments to your project. By the way there is no Flex-Framework required - these tags also work in pure AS3 projects.



July 22nd, 2010
Marvin Blase
Posted in
Tags:
Useful! Thanks!
[...] This post was mentioned on Twitter by Marvin Blase: published: swf compile meta tags | http://bit.ly/cSdTXY [...]
Hi,
thx for the post. In the beta we've decided to leave them out.
It's defienitely best practice to use the SWF meta tag as you explained here.
You think it's better to put the arguments in again by default?
Michael
Hi Michael,
Well, I think the best solution on that would be adding another stub which can be checked when creating a class (leads to: "This class will be compiled" -> Configure Output). This might be an easy way for users to set up their final SWF whenever they create a class which will be compiled. These options will be just set up as meta-tags in your class then, so you can still re-configure them.
Creating a project completely without meta tags by default is a bit strange to me.
when working with compiler-presets: isn't their a possibility to add some dropdown and textinput-fields in the project compiler tab in fdt? so you can just set up everything in an easy interface.
Hey,
yep - why not? Still better then working in the arguments (in the Compiler-tab) itself. Would be cool if these settings will affect the SWF-Launcher then as well :)
My biggest gripe (today) with the way FDT handles this is that it doesn't then change the default size of the output window to reflect the size of the compile swf!?
You would think that viewing an 800x600 swf at 800x600 is the default behaviour, and viewing it at say 550x400 would be a strange but configurable thing to do. Not so! You have to configure it away from 800x600. For me, this pretty much obviates the main usefulness of the [SWF...] metadata.
Hi Alec,
jep - that´s true, the compiled size should affect the External SWF Player's one. I think setting the Adobe Flash Player as Default-Viewer would be a workaround as it's adopting the size automatically.
VRy fascinating to read it.