Archive for the 'to think' Category

Want an onReleaseOutside event?

Vote for it now!

VOTE FOR THIS ONE!!!!!1

Now as jailbreaking is legal, couldn’t Adobe publish a Flashplayer for the iOS (iPhone, iPod, iPad) over Cydia(App Store for Jailbreaked Apps)?
I guess this would be a huge market!

https://bugs.adobe.com/jira/browse/FP-5228
I’d like Flash Player on my iPad please!

Continuing on the XML bug

Looks like my XML Flash Player 10.1 issue already has a bug filled at bugs.adobe.com. Too bad, that could be the first ever bug report submitted by me )8

Huge Flash Player 10.1 XML bug.

Check this XML.

<data xmlns:Bla="bla"><Bla:bla></bla:bla></data>

It’s obviously malformed. Flash Player 10.0 fails to parse it but Flash Player 10.1 doesn’t care. This caused major headache yesterday.

How do I submit a bug to Adobe?

Did you know about AS3 “down to” operator?

I am talking about –> operator. Did you know about it? It’s called “down to” operator. Here’s an example.

var a:uint = 20;
while ( a --> 0 ) trace(a);

Isn’t it cool?!

How to fix Flash Builder broken workspace.

From time to time I get weird Flash Builder/OS X crashes which lead to Flash Builder (Eclipse) freeze or hang up during startup. You think you have to recreate your workspace every time after a crash, but no, if that happens there’s a solution.

So, if Flash Builder freezes trying to load your workspace what you need to do to fix it is to navigate to .metadata/.plugins/org.eclipse.core.resources and delete the file named .snap. That’s it. No more rearranging views and reimporting projects!

Where’s my byte, dude??!

While working on his famous library blooddy stuck upon what appeared to be a flash bug. Sometimes an empty ByteArray is not THAT empty at all.

Basically if you write something to it first you can get non-zero bytes in your new ByteArray other than you just wrote yourself.

bytes.writeUnsignedInt( 10 );
 bytes.length = LENGTH;

But if you set the length first everything runs smoothly. Be careful!

Tired of people using stage in constructor?

Recently someone in ruFlash user group asked if it’s possible to get rid of errors when loading a SWF which thinks it is the only SWF in the world and there totally must be stage available in its constructor. As you already understood such SWFs fail with Null Access errors.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

This task looks like a great exercise for my epic Scala skills I got trying to understand famous Joa‘s code.

Thanks to apparat and Scala I managed to code a small app which rewrites SWF files and moves all constructor code to a private method which is later subscribed to ADDED_TO_STAGE event.

usage: java -jar initInjector.jar [-c] <from.swf> [to.swf]“)
-c — check for references to stage in constructor
If [to.swf] is not specified resulting SWF is saved to <from.swf>

The 0.1 version fails to move exceptions though. Trying to grasp that bytecode exceptions magic atm.

Here’s the application: initInjector.zip

AVM2Overview lies

It says:

One of the entries in the ABC file is an array of script_info entries (see the next chapter). Each of these entries contains a reference to an initialization method for the script and a set of traits to be defined in the script’s environment. The last entry in that array is the entry point for the ABC file; that is, the last entry’s initialization method contains the first bytecode that’s run when the ABC file is executed.

That’s apparently is not true. I keep getting different classes in the last entry except the main document class which I need. Thanks to @joa for pointing me to SymbolClass tag which contains an array to map Classes to Library Symbols in SWF files. And the very first class there seems to be the Document class I need.

Flash on Microsoft’s site

Well, the site for Russian launch of Visual Studio 2010 is a piece of crap. A piece of silverlight crap. Just check the sources. IT IS AN ABOMINATION!!!

What’s more, the actual game is not in Silverlight, it is in Flash. And it fails with errors on some timer event which don’t go away.

Microsoft “can” make Flash. OLOLOLOLOLOL!!!!

ms-lol