H.264 can’t kill flash

This is another interesting reading about the current discussion about HTML5, video and Flash: http://blog.streamingmedia.com/the_…-cant-kill-off-the-other.html.

Sincerely this last crusade against flash is just annoying me ( the same way the first svg crusade against flash ). In my humble opinion I think that next year HTML5 will be already an old technology and everyone will forget this war.

ZaaIL adds support for 40+ image format to Flash

Zaalabs yesterday announced the release of an opensource ( under MIT license ) library, written using Alchemy, which will allow swf to load at runtime more than 40 different image formats ( you will have access to the bitmapdata of the loaded file ).

This is indeed a great news ( I’m thinking in particular to the benefits it can have for us at Aviary )!
This actionscript library is a porting of the DevIL library. And in fact reading at the features list of the DevIL library you can see that a lot of image formats are currently supported:
  • Windows Bitmap – .bmp
  • Dr. Halo – .cut
  • Multi-PCX – .dcx
  • Dicom – .dicom, .dcm
  • DirectDraw Surface – .dds
  • OpenEXR – .exr
  • Flexible Image Transport System – .fits, .fit
  • Heavy Metal: FAKK 2 – .ftx
  • Radiance High Dynamic – .hdr
  • Macintosh icon – .icns
  • Windows icon/cursor – .ico, .cur
  • Interchange File Format – .iff
  • Infinity Ward Image – .iwi
  • Graphics Interchange Format – .gif
  • Jpeg – .jpg, .jpe, .jpeg
  • Jpeg 2000 – .jp2
  • Interlaced Bitmap – .lbm
  • Homeworld texture – .lif
  • Half-Life Model – .mdl
  • MPEG-1 Audio Layer 3 – .mp3
  • Palette – .pal
  • Kodak PhotoCD – .pcd
  • ZSoft PCX – .pcx
  • Softimage PIC – .pic
  • Portable Network Graphics – .png
  • Portable Anymap – .pbm, .pgm, .pnm, .pnm
  • Alias | Wavefront – .pix
  • Adobe PhotoShop – .psd
  • PaintShop Pro – .psp
  • Pixar – .pxr
  • Raw data – .raw
  • Homeworld 2 Texture – .rot
  • Silicon Graphics – .sgi, .bw, .rgb, .rgba
  • Creative Assembly Texture – .texture
  • Truevision Targa – .tga
  • Tagged Image File Format – .tif
  • Gamecube Texture – .tpl
  • Unreal Texture – .utx
  • Quake 2 Texture – .wal
  • Valve Texture Format – .vtf
  • HD Photo – .wdp, .hdp
  • X Pixel Map – .xpm
  • Doom graphics

FlashTracer for Firebug

FBTracer in action

Recently I decided to write my old flash tracer firefox extension from scratch because I found it not really useful (at least for me) and too “expensive”, moreover when using firebug at the same time.

So I made a quick test to see how much was hard to create a new panel inside firebug to display flash tracer.
This is the result of what I did right now. It does not have all the features of the old extension, it just display the flash traces. Anyway it is actually in early stage development, updates will come during next days.
Here the instructions and the download link (remrmber to install the flashplayer debugger and firebug first!):
P.S. It has been tested on osx snow leopard and windows 7 right now.

Flex sdk 3.5.0 problem with ternary operators

I’ve got problems to isolate the problem into a very big project with many linked sources. After hours inspecting and commenting lines of code trying to figure out the reason why flex gave me an “internal error” I found the problem.
This very simple script was crashing the flex compiler if using the 3.5.0 sdk ( revision 3.5.0.12683 ).
Fortunately the 4.0.0 compiler works fine. At the end it seems to be the combination of “+” and “-” and the ternary operator.
package
{
   import flash.display.Sprite;
   public class ternary_test extends Sprite
   {
      public function ternary_test()
      {
         var n: Number = 0;
         var d: int = 3;
         var k: int = 5;
         var j: int = 10;
         n = 1 + ( -( d == 0 ? k : j ) );
         trace( "n=" + n );
      }
   }
}

will cause the compiler to crash with the following stack trace:

compile:

    [mxmlc] Loading configuration file /Applications/Adobe Flash Builder 4 Plug-in/sdks/3.5.0/frameworks/flex-config.xml

    [mxmlc] Error: null

    [mxmlc] java.lang.NullPointerException

    [mxmlc] 	at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:1290)

    [mxmlc] 	at macromedia.asc.parser.UnaryExpressionNode.evaluate(UnaryExpressionNode.java:51)

    [mxmlc] 	at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2153)

    [mxmlc] 	at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44)

    [mxmlc] 	at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:1497)

    [mxmlc] 	at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:56)

    [mxmlc] 	at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2124)

    [mxmlc] 	at macromedia.asc.parser.ArgumentListNode.evaluate(ArgumentListNode.java:45)...

PdfReader for purePDF

Recently I’ve update purepdf adding PdReader.

Using PdfReader an existing pdf document can be opened and parsed. Later I will also port the PdfStamper which will allow to modify existing pdf documents.
Currently I’ve posted 3 simple examples about the PdfReader:
  1. Extract bookmarks
  2. Extract text
  3. Extract images
  4. ExtractTextPDF.air (air application): browse for local pdf documents and display pages contents
Currently the reader has some limitations (such as it cannot open crypted documents) and it’s not fast enough, but I hope to optimize it in the future.

mm.cfg revealed!

I’ve just discovered an unbelievable post by Jean-Philippe Auclair with ALL the undocumented options of the mm.cfg file!

Really interesting in particular AS3Trace and AS3Verbose (and what is AS3Turbo anyway?). Also TraceOutputBuffered could be useful for all swf with uncommented trace calls 🙂

By the way, this is the list of features he discovered (follow the link above for detailed information on each command):
  • AllowUserLocalTrust
  • AS3AllocationTracking
  • AS3AutoStartSampling
  • AS3CSE
  • AS3DCE
  • AS3DynamicProfile
  • AS3MIR
  • AS3Sampling
  • AS3SSE
  • AS3StaticProfile
  • AS3Trace
  • AS3Turbo
  • AS3Verbose
  • AssetCacheSize=X
  • AutoUpdateDisable
  • AutoUpdateInterval
  • AutoUpdateVersionUrl
  • AVHardwareDisable
  • CodeSignLogFile
  • CodeSignRootCert
  • Convert8kAnd16kAudio
  • CrashLogEnable
  • DisableAVM1Loading
  • DisableDeviceFontEnumeration
  • DisableIncrementalGC
  • DisableMulticoreRenderer
  • DisableNetworkAndFilesystemInHostApp
  • DisableProductDownload
  • DisableSockets
  • DisplayGPUBlend
  • EnableIncrementalValidation
  • EnableLeakFile
  • EnableSocketsTo
  • EnableSocketsTo
  • EnableSocketsTo
  • EnforceLocalSecurityInActiveXHostApp
  • ErrorReportingEnable
  • FileDownloadDisable
  • FileUploadDisable
  • ForceGPUBlend
  • FrameProfilingEnable
  • FullScreenDisable
  • GCStats
  • GPULogOutputFileName
  • HeapProfilingAS3Enable
  • LegacyDomainMatching
  • LocalFileLegacyAction
  • LocalFileReadDisable
  • LocalStorageLimit
  • LogGPU
  • MaxWarnings
  • OverrideGPUValidation
  • OverrideUserInvokedActions
  • PolicyFileLog
  • PolicyFileLogAppend
  • PreloadSwf
  • PreloadSwf
  • ProductDisabled
  • ProductDownloadBaseUrl
  • ProfileFunctionEnable
  • ProfilingOutputDirectory
  • ProfilingOutputFileEnable
  • RendererProfilingEnable
  • RTMFPP2PDisable
  • RTMFPTURNProxy
  • ScriptStuckTimeout
  • SecurityDialogReportingEnable
  • SuppressDebuggerExceptionDialogs
  • ThirdPartyStorage
  • TraceOutputBuffered
  • TraceOutputFileEnable
  • TraceOutputFileName
  • UseBrokerProcess
  • WindowlessDisable

Flash alpha GradientMatrix to PDF using purePDF

One of the most hard thing to traslate when creating pdf documents from existing flash movies is indeed the gradient matrix.

Not only because pdf and flash have 2 different coordinates system and because the gradient matrix is applied in 2 different ways, but also if you want to convert gradient with transparent colors inside.
Let me say that I’ve encountered the same issue Mario posted here, even if I made a little modification to his solution: GradientMatrix.as
This is the swf example. Click on the sprite to start the animation. It will rotate and translate both the sprite and its gradient matrix, then click again to stop the animation and create the pdf file at that frame.
SWF HERE
In order to create the correct gradient matrix with the right position and rotation in purePDF I’ve used the PdfShading.complexAxial static method in this way:
var cb_shading: PdfShading = PdfShading.complexAxial( writer, top_left.x, top_left.y, top_right.x, top_right.y, cb_colors, cb_ratios, true, true );

then for the alpha masking I’ve created a PdfTransparencyGroup applied to the alpha mask.

You can see my solution (which probably is not the best one, but it’s the one I discovered for now) in the code below.
[kml_flashembed movie=”/wp-content/uploads/2010/02/ExampleColorGradient2.swf” height=”300″ width=”400″ /]

Continue reading