I have come across a perl script that appears to be building a shockwave flash object, probably via the SWF-File-0.42 library. However, I cannot get the script to execute correctly; with some modifications I can get the PNG files loaded into zlibdata and displayed/animated, but the pictures overlap when png should be see-through. Anyone understand how to get a swf graphic object built ? (Long) code listing follows:
PngFileTable = { png => shinki_menu_0_?.png, png => shinki_menu_1_?.png, ) Header: SIGNATURE = CWS VERSION = 7 File length = 1510 Rect size = (0, 0)-(20480, 15360) Frame rate = 30 Frame count = 1 SWF::Element::Tag::DefineBitsLossless->new( CharacterID => 1, FileName => 0, BitmapFormat => 5, BitmapWidth => 256, BitmapHeight => 64, ) SWF::Element::Tag::DefineShape->new( ShapeID => 2, ShapeBounds => SWF::Element::RECT->new( Xmin => 0, Ymin => 0, Xmax => 5120, Ymax => 1280, ), Shapes => SWF::Element::SHAPEWITHSTYLE1->new( FillStyles => SWF::Element::Array::FILLSTYLEARRAY1->new([ SWF::Element::FILLSTYLE1->new( FillStyleType => 65, BitmapID => 1, BitmapMatrix => SWF::Element::MATRIX->new( ScaleX => 20, ScaleY => 20, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ), # 0 ]), ShapeRecords => SWF::Element::Array::SHAPERECORDARRAY1->new([ SWF::Element::SHAPERECORD1::STYLECHANGERECORD->new( MoveDeltaX => 5120, MoveDeltaY => 1280, FillStyle1 => 1, ), # 0 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => -5120, DeltaY => 0, ), # 1 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 0, DeltaY => -1280, ), # 2 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 5120, DeltaY => 0, ), # 3 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 0, DeltaY => 1280, ), # 4 ]), ), ) SWF::Element::Tag::DefineSprite->new( SpriteID => 3, FrameCount => 1, ControlTags => SWF::Element::Array::TAGARRAY->new([ SWF::Element::Tag::PlaceObject2->new( Flags => 6, Depth => 1, CharacterID => 2, Matrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ), # 0 SWF::Element::Tag::ShowFrame->new( ), # 1 SWF::Element::Tag::End->new( ), # 2 ]), ) SWF::Element::Tag::DefineButton2->new( ButtonID => 4, Flags => 0, Characters => SWF::Element::Array::BUTTONRECORDARRAY2->new([ SWF::Element::BUTTONRECORD2->new( ButtonStates => 1, CharacterID => 3, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 2, RedMultTerm => 205, GreenMultTerm => 205, BlueMultTerm => 205, AlphaMultTerm => 205, ), ), # 0 SWF::Element::BUTTONRECORD2->new( ButtonStates => 2, CharacterID => 3, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 1 SWF::Element::BUTTONRECORD2->new( ButtonStates => 4, CharacterID => 3, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 40, TranslateY => 40, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 2 SWF::Element::BUTTONRECORD2->new( ButtonStates => 8, CharacterID => 2, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 40, TranslateY => 40, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 3 ]), ) SWF::Element::Tag::PlaceObject2->new( Flags => 38, Depth => 1, CharacterID => 4, Matrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 7925, TranslateY => 7026, ), Name => "swf_test_btn", ) SWF::Element::Tag::DefineBitsLossless->new( CharacterID => 5, FileName => 1, BitmapFormat => 5, BitmapWidth => 256, BitmapHeight => 64, ) SWF::Element::Tag::DefineShape->new( ShapeID => 6, ShapeBounds => SWF::Element::RECT->new( Xmin => 0, Ymin => 0, Xmax => 5120, Ymax => 1280, ), Shapes => SWF::Element::SHAPEWITHSTYLE1->new( FillStyles => SWF::Element::Array::FILLSTYLEARRAY1->new([ SWF::Element::FILLSTYLE1->new( FillStyleType => 65, BitmapID => 5, BitmapMatrix => SWF::Element::MATRIX->new( ScaleX => 20, ScaleY => 20, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ), # 0 ]), ShapeRecords => SWF::Element::Array::SHAPERECORDARRAY1->new([ SWF::Element::SHAPERECORD1::STYLECHANGERECORD->new( MoveDeltaX => 5120, MoveDeltaY => 1280, FillStyle1 => 1, ), # 0 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => -5120, DeltaY => 0, ), # 1 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 0, DeltaY => -1280, ), # 2 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 5120, DeltaY => 0, ), # 3 SWF::Element::SHAPERECORDn::STRAIGHTEDGERECORD->new( DeltaX => 0, DeltaY => 1280, ), # 4 ]), ), ) SWF::Element::Tag::DefineSprite->new( SpriteID => 7, FrameCount => 1, ControlTags => SWF::Element::Array::TAGARRAY->new([ SWF::Element::Tag::PlaceObject2->new( Flags => 6, Depth => 1, CharacterID => 6, Matrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ), # 0 SWF::Element::Tag::ShowFrame->new( ), # 1 SWF::Element::Tag::End->new( ), # 2 ]), ) SWF::Element::Tag::DefineButton2->new( ButtonID => 8, Flags => 0, Characters => SWF::Element::Array::BUTTONRECORDARRAY2->new([ SWF::Element::BUTTONRECORD2->new( ButtonStates => 1, CharacterID => 7, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 2, RedMultTerm => 205, GreenMultTerm => 205, BlueMultTerm => 205, AlphaMultTerm => 205, ), ), # 0 SWF::Element::BUTTONRECORD2->new( ButtonStates => 2, CharacterID => 7, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 0, TranslateY => 0, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 1 SWF::Element::BUTTONRECORD2->new( ButtonStates => 4, CharacterID => 7, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 40, TranslateY => 40, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 2 SWF::Element::BUTTONRECORD2->new( ButtonStates => 8, CharacterID => 6, PlaceDepth => 1, PlaceMatrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 40, TranslateY => 40, ), ColorTransform => SWF::Element::CXFORMWITHALPHA->new( Flags => 0, ), ), # 3 ]), ) SWF::Element::Tag::PlaceObject2->new( Flags => 38, Depth => 3, CharacterID => 8, Matrix => SWF::Element::MATRIX->new( ScaleX => 1, ScaleY => 1, RotateSkew0 => 0, RotateSkew1 => 0, TranslateX => 7925, TranslateY => 5586, ), Name => "task_test_btn", ) SWF::Element::Tag::ShowFrame->new( ) SWF::Element::Tag::End->new( )

Edit: g0n - code tags


In reply to SWF-File-0.42 : Building a SWF from PNG via a text file by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.