*blog... kind of... *rss
png2swf.jsfl & folder_png2swf.jsfl v1.2
9 comments written so far...I must be the only one using these scripts, but just in case... I've changed them a bit.
The reason I use them is because I compile directly from Flex SDK, which means that I lose the feature of Flash IDE which compresses .png files at compile time. Which is sweet because it generates .jpg files with alpha channel. Thinking about it now, I can't believe there isn't a format like this for the HTML world, you know lossy + transparent.
So what these Flash IDE do is load any .png, add it to the stage and save it as a .swf. They have been working very well until this last project, where I had to load these .swf from another domain. After a bit of research, I found out that the solution was to add this line 'Security.allowDomain("*");' on the first frame of the generated .swf. So the script will now ask you if you want that line to be added, and as a bonus will also ask if the bitmap should have 'allowSmoothing = true' or not.
So, if you use them, enjoy!
png2swf.jsfl
folder_png2swf.jsfl
The reason I use them is because I compile directly from Flex SDK, which means that I lose the feature of Flash IDE which compresses .png files at compile time. Which is sweet because it generates .jpg files with alpha channel. Thinking about it now, I can't believe there isn't a format like this for the HTML world, you know lossy + transparent.
So what these Flash IDE do is load any .png, add it to the stage and save it as a .swf. They have been working very well until this last project, where I had to load these .swf from another domain. After a bit of research, I found out that the solution was to add this line 'Security.allowDomain("*");' on the first frame of the generated .swf. So the script will now ask you if you want that line to be added, and as a bonus will also ask if the bitmap should have 'allowSmoothing = true' or not.
So, if you use them, enjoy!
png2swf.jsfl
folder_png2swf.jsfl
Thanks for this. I have a similar script so it's interesting to see your implementation since JSFL doesn't have the best documentation in the world. It's like a dying art.
March 12th 2009, Tim Robles
BTW maybe you've met an issue with Flex SDK 3 (and earlier): you can't [Embed(source='some_library.swf#SymbolID')] while SymbolID is a BitmapData made of transparent JPEG. In this case everything will screw up, the BitmapLoader in Flex 3 can't handle transparent JPEG bundles (24bit image + 8bit JPEG grayscale alpha). Everything you'll get is an empty object. While finding this out I've lost a great part of my hair. And wow, unbelievable, it's fixed in Gumbo.
Another story: I still don't understand why there is no compression settings when embedding an image in Flex/pure AS3. Looks like Adobe doesn't think somebody would like to fine tune compression? Yeah, fck that, our machine is best, it knows when to select lossy and when to provide you bits you know and love.
Peace.
Another story: I still don't understand why there is no compression settings when embedding an image in Flex/pure AS3. Looks like Adobe doesn't think somebody would like to fine tune compression? Yeah, fck that, our machine is best, it knows when to select lossy and when to provide you bits you know and love.
Peace.
hi,
I've done something like this as well.. back in the days.. :)
http://durej.com/?p=15
But will check yours as well! Thanks for the post..
I've done something like this as well.. back in the days.. :)
http://durej.com/?p=15
But will check yours as well! Thanks for the post..
Thanks!!. I've modified your script to create swf movies with an image secuence.
http://illobre.com/image_secuence.jsfl
http://illobre.com/image_secuence.jsfl
Any reason you don't just publish assets into a .swf and load them at runtime intro your MXMLC compiled .swf? It may not be worth it for one img, but if you have several....
*... publish assets into a Flash Authoring compiled .swf
Because I don't use Flash IDE :S No Linux version...
I've put together an image cropper in photoshop which trims redundant alpha data of a png then puts the coords back into the file name then combined this with a jpeg swfer in jsfl to create the ultimate alpha'd jpeg maker - but it's Oh SO complicated. A little bird tells me that flash does it internall with JPEG2000 files - now if only we could wrap them or import them - or hell maybe even parse them!
My 2p
looks like we're all trying to combat this problem
Mike
My 2p
looks like we're all trying to combat this problem
Mike
Looks like Gumbo builds have extended Embed to allow a compression flag. Can't figure out how to get it to work though...
http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf60546-7ffb.html#WS2db454920e96a9e51e63e3d11c0bf69084-7f90
http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf60546-7ffb.html#WS2db454920e96a9e51e63e3d11c0bf69084-7f90
Have your say!
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
more: github, twitter, twitpic, soundcloud and flattr
*post nav
Detect if the swf is being executed localy or online
Sys-Con now attacks Mr.doob!
Chrome Experiments!
Face tracking + 3D Scene, Laughing Man, DOF Tunel and more...
navigateToURLAndUpdateStageSize()
png2swf.jsfl & folder_png2swf.jsfl v1.2
Peter Saville's Unknown Pleasures AV
Minilogue_Old_New.mp3
Synecdoche, New York & The Cinema Village
About the FWA Award Graphic Banner
ActionScript Tween Libraries
*latest comments
Merry Xmas
Multiuser Sketchpad
Multiuser Sketchpad
Or so they say... (javascript demo)
Multiuser Sketchpad
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Or so they say... (javascript demo)
Harmony