Recover a broken .fla - that infamous "Unknown file format"

I came to develop a flash app again recently and suddenly faced a nightmarish  situation:While saving my fla Flash stated the file couldn't be saved at its current location and terminated. Although the file looked good from its size and icon in the explorer I wasn't able to open it in Flash-"Unknown file format", grrr.
After some googling around and half way to forking out some bucks for a swf decompiler I found some hints to this rather manual and hackish approach to the problem:

I made a copy off the corrupt .fla and renamed it to .zip. on opening the .zip I found some xml files along a folder structure containing my library items as bitmaps and xml files. A hint found on stackoverflow.com stated that you could recover the library whith editing/replacing the DOMDocument.xml. Heres the recipe I worked along:

I made a new blank fla the size and properties of the broken one. Along the lines I restored all library folders in the structure I had them but leaving them empty for the symbols I was about to recover later on.

Then I unzipped the images from the renamed broken fla and imported them to my new one to save on editing time in the DOMDocument.xml.

After the library was restored to all but the symbols of buttons and movieclips, I saved the fla, quit Flash and went for the fun part of hacking the library.

I renamed the new fla to zip, opened the DOMDocument.xml and added my symbols in the <symbols node> along with their relative folder path like so:

<Include href="FoldernameInLibrary/Symbolname.xml" loadImmediate="false"/>

By printing the directory contents of all the folders in the library, this is a simple two-step search-and-replace job.
Soon as my DOMDocument.xml contained all nodes for my library symbols I saved it, closed the zip and renamed it back to fla.

Since all my scripts where done in FlashDevelop as external as files, my fla was 100% restored. phew.


Kepher made it into the Showcase at CitrusEngine.com

My just released platform puzzler "Kepher" made it as the latest entry in the showcase page of the Citrus Engine, the great flash framework that was used to develop the game.

Kepher

I just finished my recent game project with the CitrusEngine for Flash. Hurry over to the download page and grab yourself a copy for Windows.




Resistance is futile

Join my meetup group and lets get together on the 19.10.2012 in Cologne to found the

Cologne Independent Game Developers Network.

Yay!

Can't touch this. Thoughts on independent artists.

I went to see "No means No" tonight, a band that the "Stadtrevue" locates back in 1979. And there it was: the true spirit of independent art, performed on stage by three aged guys dressed in comfortable sport clothing, no particular hairdo playing a lefthanded Gibson SG and a Fender Bassguitar that where from about the founding time of the band. While the younger visitors happily pogued away on precise riffs and a banging drumset, I got carried away in thoughts a little and found out that what I saw happening was what being an independent artist of whatever profession is all about:
You find yourself sweating the hard parts, sometimes mumbling WTF half-loud but with a grace earned by working on your pieces for a lifetime without  being backupped a lot by others than your friends and family.
These guys I guess wouldn't give up - they seemed to be doing it from the bottom of their hearts, and also seemed to be sure that theres nothing they'd rather do. I had a great time seing them.And I guess this is what acts like the late Pink Floyd or even the late Liam Gallagher can't touch.


Making a platformer with the Citrus Engine Part 1

climbing and jumping enabled, but
the art department is still on holiday...
A little while ago I stumbled upon the Citrus Engine,
a Flash framework for making platform games. Included in the framework are lots of classes for platform objects, collision control via Box2d physics and camera and input controls giving you a headstart  with your next platformer. My game is still in the early development stage but the engines classes are well documented and easily tweakable to all my needs. I soon modded some build-in objects with custom functionality. On top of all the engine comes with a nice editor (an Air app called "Level Architect") that makes the level design a painless and fun time. Above you see a screenshot of a level done in the Level Architect, still with my development textures I will swap out for the final game art later.
Stay tuned for the next entry in that category to learn more about the development of a multilevel platformer done in Flash!

Bonzai

While recovering from my not-so-funny time in hospital I made this little running game. You must guide your tiny samurai throgh the parcour with up and down swipes of the mouse while collecting health and shield potions. Every now and then a  wooden "soldier" blocks your way which must be destroyed with sword attacks- i.e. your left mouse button. That way, while attcking you cant swipe and fall behind and have to run harder.
The engine for this game was written from scratch in Actionscript3 and is still in a somewhat early stage. The game is playable but might be a bit rough around the edges.


Play here:
http://www.daarboven.net/bonzai/

or on kongregate:
http://www.kongregate.com/games/daarboven/bonzai?acomplete=bonzai

Global Game Jam 2012

Since not everybody is able to follow me on the eponymous FB, heres a repost of my GlobalGameJam 2012 aftermath:
Together with the great Julien Lalleve from France we made this imho totally spitpolished game for up to 4 players IN JUST 48 HOURS (sorry for the amount of caps here. I'm veeery proud of the game )





GiantRobotSnakes GLobalGameJam2012 site is to be found here:

http://globalgamejam.org/2012/giant-robot-snake

 for a downloadable version either Mac or PC.

The 36th chamber of Pong


Right after the global game Jam I started this fun little experiment with currently 17 of planned 36 variations of the Stick-And-Ball classic.
just head over to http://www.daarboven.net/36th_chamber/ and grab a racket.

Back to the drawingboard

After a loooooong latency caused by
a) a slight shift of my attention towards more design-centric matters and
b) a not-so-funny time in hospital

I decided to revive my techblog a little, but with a twist. Since I'm heavily walking towards game design I will post less general things Flash and more about finished and upcoming games. But rest assured, most of the stuff will be done in Flash anyway...

FLash Standalone Player deploys IE Cache!

I just found out that the Flash Standalone Player on Windows caches images in the Internet Explorer cache to store images, which is especially annoying when using a self coded flash based editor for graphics and text where you frequently update contents and wonder why you don't see your changes. So ifyou happen to have an exe thats pulling in updated image data from outside you'd better STRG+SHIFT+ENTF (CTRL+SHIFT+DEL) your IE cache from time to time... Ugly enough this goes hand in hand with Flash 10.22 standalone crashing a lot when forced to rebuild a large number of images at load time :-(.

Thoughts on "Occupy Flash"

My local car mechanic just recently advised me to get rid of my crummy old old but working headlights and replace them with those shiny new halogene ones every modern car carries nowadays. Sure, he couldn't tell if there are some that would fit in the bracings of my aged car but, hey, there is always duct tape or some other third party solution to make them fit. The plugs to wire them would need some adapter, and he frankly didn't know how my cars battery would behave with them...
You get the picture? All polemics aside, the recent Flash-Bashing from sites like "Occupy Flash" is downright stupid. Why would anyone willingly narrow the experiences possible with an already existing and frequently serviced plugin just for the heck of it? Go on then, disable JavaScript, use your own Stylesheet or none at all (You can do that in Firefox in the View menu! ) or even stop Browsing alltogether. Web is boring according to the Tech police. My experience as a long time Web user and Designer/Developer is this: The best approach to any Design/Application/Work of Art is content-centered. Use the tools that do the job best and the ones you can handle best. Everybody coins oil color but you're a bad ass with Acrylics? Show off! Carry on and be proud of your skills. If theres an audience for your story, tell it by all means available. And don't get bothered by critics telling you or the audience how your work should be perceived. Stand tall and tell them to














"DO IT BETTER OR SHUT UP!"
And if the audience moves on, decide for yourself. Was it the techniques and tools you used or was it your story? No technology has to be killed. Thats just Mmediy hype. Technologies cease due to better ones- which is proven by time, not the ordinary Fanboy's Blog traffic.

Great Expectations

Some days ago Adobe announced to stop developing Flash Player for mobile devices, and at the usual sources it stirred quite a lot of dirt. Accusations flew, comments went up to hundreds and so the sh*t hit the fan again. But what exactly is this about? A software vendor decides on one of his products that in his opinion doesn't have enough market share and focusses in another part of the market- no big deal, imho. The media hype hollering "Flash is dead" again is something completely different and makes me wish Adobe was a little less verbose on it's business strategy sometimes, but for the heck of it, I'll get myself a nice cup of Javascript ;-) on the side and see where we all are this time next year. It's all about experiences, not the platform they are developed with. HTML5 still has some ground to cover...And I still ♥ Flash.

E4X: No L♥ve for siblings

Since AS 3's XML access lacks completely on the sibling axis, i decided to roll my own wire for that:

public class XMLUtils
{
public function XMLUtils():void
{

}
//Alle Geschwister eines Knotens
public static function siblings(node:XML):XMLList
{
return node.parent().children();
}
//nächstes Geschwister
public static function nextSibling(node:XML):XML
{
return node.parent().*[node.childIndex() + 1];
}
//voriges Geschwister
public static function previousSibling(node:XML):XML
{
return node.parent().*[node.childIndex() -1];
}
}


Spreadsheet from Excel to Flash

My recent pet project for the summerhole is a spreadsheet rendering component that eats an Excel spreadsheet in Excels own XML format (Save as...> XML instead of XLS). The benefit of it will be that my employer often has data assembled in spreadsheet that need to be presented in Flash Desktop applications as tables.
So instead of all the past hacking data into variable-value txt-files or rolling my own XML structure I decided to look at Excels own XML Format since the spreadsheet is still editable in Excel leaving our text department with a well known frontend.

Getting the row/column/cell placement right was a bit of an adventure because Excel only generates nodes and attributes for them if they
a)have a defined width other than the standard or
b)are placed at a position (index)in the table that is different from their position in the node or
c)are repeated in the next/following coulumns respective their (other than standard) width as expressed with an attribute named "Span"...

Cells in a row can have a "MergeAcross" and a "MergeDown" attribute that needs to be handled so the next cell is placed at the proper column / the next row doesn't screw up with the cell placement/indexing.

Once I got a grip on that It was merely a matter of attribute checking to make the table appear like in Excel.
Some Style parsing later I had the basic formatting of the Excel cells showing up in Flash:
I read out the Font, Fontsize and Fontstyle (b,i,u) as well as the cell color and if it has borders.
As to the borders I only look up if the cell has a border tag since Flash TextFields do not specify on top,right,bottom and left borders and for the time being I didn't put in my own border drawing (KISS).

Anyway, ...drummroll... heres 2 pictures off a spreadsheet in Firefox(Flash) and Excel.












ps:the Flash Version implements BrowserCanvas. That is no Flash Scrollbar hazzle-make use of the browser window to adapt to your dynamic Flash content.
Yeah! Mr. White! SCIENCE! I ♥ that!

pps: I added cell align after Screenshots. excuse the laziness.

ppps: Since the code for this class was written at work, I cannot provide you with the source atm. sorry!

Namespace weirdness with AS3

For my recent pet project (Displaying an Excel Sheet in Flash) i ran into a strange behaviour along with namespace usage. The Class responsible for loading and displaying the XML had a namespace variable initialised and set later on once the XML loaded and the namespace therein was read. But now the main Timeline threw an error with every function telling me the namespace variable was not defined- WHAT THE **?

Soon as I declared the variable with a dummy value on the Main Timeline, my FLA compiled succesfully with no errors. Someone please explain that to me...

More control over the dataGrid component

When using the dataGrid component being lazy as me, you would just get the column names from your dataProvider

//name and rating are the field names in the dataProvider
myGrid.columns=["name","rating"]

and call it a day...
But that leaves you with evenly spaced columns and without any dynamic height of your grid, so you better resort to something like:

var nameCol:DataGridColumn=new DataGridColumn("name");
nameCol.headerText="Game";
nameCol.width=150;

var ratingCol:DataGridColumn=new DataGridColumn("rating");
ratingCol.headerText="Rating";
ratingCol.width=60;

myGrid.columns = [nameCol, ratingCol];
myGrid.width=210;

myGrid.dataProvider=new DataProvider(dp);
//auto-height
myGrid.rowCount=myGrid.length;

which will let you size the columns at your will and have the component grow as you plug in more entries.

Dude, where's my DragOver?

Having it not used for a long time I found out today that AS3 has no DragOver in its MouseEvents. So after a bit of research dugged out several solutions with a custom Event Class but finally resorted to this little if.. statement in my Event Handler for MOUSE_OVER:

//pcont serves as a container for about 100 clips 
//inside that will react to dragOver 
 
//activate on Mousedown immediately
pcont_mc.addEventListener(MouseEvent.MOUSE_DOWN,onDragOver);
pcont_mc.addEventListener(MouseEvent.MOUSE_OVER,onDragOver);

function onDragOver(e:MouseEvent):void
{
  if(e.buttonDown)
   {
     //the Mouse is pressed, 
     //Do something here
   }
}


the buttonDown Property of the MouseEvent makes sure that the Mouse is pressed while you hover your mc.
A more advanced solution can be found at Andre Michelle, he wrote some class files and stuff to adress this shortcoming of Events.

attachMovie in AS3

Today I wrote a little replacement snippet for the deprecated attachMovie. The snippet has 3 parameters for the linkage name in the library, the name of the displayObject you wish to attach the MC to and an optional name param to identify it by name on the display list later on:


function attachMovieClip(mcName:String,target:MovieClip,newName:String="")
{
var mc=new (getDefinitionByName(mcName) as Class);
mc.name = newName;
target.addChild(mc);
}

along with Lee Brimelows very useful snippet panel for Flash CS4 attaching MovieClips from the Library at runtime is a bit less complicated especially for AS2 veterans ;-).

the xml snippet for the snippet panel is here for convenient copy/paste:

<snippet>
<title>attachMovie AS3</title>
<code><![CDATA[function attachMovieClip(mcName:String,target:MovieClip,newName:String="")
{
    var mc=new (getDefinitionByName(mcName) as Class);
    mc.name=newName;
    target.addChild(mc);
}]]></code>
</snippet>

Have fun!

shortcut != shortcut

As I found out the hard way as usual, the Flash CS4 Authoring Environment has an ugly little glitch:
depending on the focussed window the shortcut STRG+G groups selected items on the canvas (if the canvas has focus) or fires the dialog to go to a certain line in the script window (if that, you guessed it, has focus). So watch out when you're in some shortcut routine while editing as you might mess things up...

Hello iheartflash

das ist ein Test. Hi there, and welcome to I ♥ Flash!