I've updated the Flash Library arduino.as and now it is compatible with the Arduino Mega 2560 writeDigitalPin above 13.
I've tested and it works (pin 22 .. 53)
may be useful.
sorry for my bad english
this is link for download
http://www.box.net/shared/8640ythgs66uvdxlu4h9