Notes on compiling SWF with ant in FDT

This afternoon I ran into an issue where Chinese output from Ant in the console was fine, but the Chinese output from mxmlc was garbled. The cause was that flexTasks was using ${FLEX\_HOME ...

Flash

AS3: Notes on Non-Alchemy Fast Memory Access

To be honest, my recent project has been getting more and more boring. The core stuff is basically done, and almost everything left is grunt work — nothing new or fun. Yesterday I finished The Settlers 7, was just about to drift off to sleep, and then suddenly came across two pages that perked me right up: [http://www.buraks.com/azoth/](http://www.buraks.com/azoth/) and [http://philippe.elsass.me/2010/05/as3-fast-memory-access-without-alchemy/](http://philippe.elsass.me/2010/05/as3-fast-memory-access-without-alchemy/) . Suddenly I was wide awake. When it comes to handling certain crazy requirements, the speed of reading from and writing to a ByteArray in FlashPlayer just can't keep up. These past couple of days [Xu Can](http://www.asblog.org/) got pushed into having to hunt for some heretical, unofficial hack — and he actually found one. I'd heard before that haXe is so efficient because its author found the low-level interface FlashPlayer 10 provides for Alchemy, but for various reasons I never went and used haXe. Seeing these two pages showed me yet another trick — turns out they're all wares from the same circle. All three of them found the “back door” FlashPlayer 10 opened for Alchemy in order to boost performance at a low level.

Flash

Notes on Hollowing Out the Black Shadows Over Unexplored Areas in Strategy Games

Carving a cutout (a circle or ellipse) out of a large dark shadow: once a sub-shape cache has been built, bitmap channel subtraction is cheaper than drawing a Shape with blend mode ERASE — but buil...

Flash

Recommend a Rich Internet game development team

Team Introduction This team is a group of game development professionals who came together after working on three products across two companies. l Team strengths: 12–36 months and more than three products of working together; solid rapport, workflows, and development habits. (The longest-serving member has over 35 months of joint development behind them; the shortest, no less than 12 months)

Flash

getBounds just isn't cutting it

Just discovered that Flash’s DisplayObject/getBounds can’t work out the correct size in a tween that contains only vector graphics — it always returns the shape region from the previous keyfra...

Flash

New Opportunities for Flash Mini-Game Developers — Mochi

I first crossed paths with Flash years ago, and it was love at first sight. I remember that several years back, small Flash games were hugely popular, and I was blown away by the Xiao Xiao series of Flash animations. Back then I played Xiao Xiao No. 4 over and over, and quietly made up my mind: one day I’d throw myself into the Flash world, build Flash pieces with real visual impact, and create games that are actually fun to play. After I started working, I did Flash website development and Flash virtual community development, and in my spare time I never stopped playing games. Through the day-in, day-out accumulation of work and play, I picked up a lot of inspiration and kept writing it down; some of those ideas gradually grew into a system, and I looked forward to turning them into a series of games and realizing the dream I once had. The reality, though, is no sponsorship and no return. Even though the games I design are ones I’d enjoy playing myself, I can only treat developing these mini-games as a hobby. I always hoped I’d find the spare time to finish them slowly, and hoped that one day my friends could play them and have fun with them. The result? The first few weeks I was full of energy, but then the daily job got busy, my own game inched forward, then stalled. I often felt I had no motivation — the moment I finished my day job, all I wanted was a couple of rounds of StarCraft II and then bed. Time always moves too fast. I watch helplessly as my long-delayed hobby game stays a dream.

Flash

Wrote up a bitmap cache rendering optimization

Since the project needs to render a large number of characters on the same screen, I needed to improve Flash Player’s rendering performance. This afternoon I ran a rendering performance test and polished up the bitmap optimization library I wrote last year. Screen size 2880*2880500 vector character animation MCs (nested 2 levels deep), looping playbackNone of them removeChild off-screen regionsAll tests run with the Flash Player SA 10.0 debug build No optimization, straight addChild fps=4, CPU maxed out, memory 18M~29M Added cacheAsBitmap FPS=1, CPU maxed out, memory 156~196M, memory keeps fluctuating

Flash

Example of detecting whether a target is reachable by moving in a straight line

In my recent project, since the team has quite a few junior ActionScript devs, what was supposed to be pathfinding got cut down to straight-line collision. And the tragic part is, they still tell me the straight-line collision is broken. Yesterday a guy was having the character do a per-pixel collision check after every step to decide whether it could walk. Let me repeat myself one more time: that’s both inaccurate and inefficient. Today I’m posting this example to show the recommended way to do straight-line collision: first draw a line and hit-test it against the walkable/blocked model, and only once you’ve confirmed the destination is reachable do you move the character straight there (speed control can come later, it’s unrelated to this example).

Flash

How do you drag objects in the list into the canvas?

Question: How do you drag an object from a list onto the canvas? Approach The ability to drag an object from a list straight onto the canvas is something you often need in a scene editor. You put a List on screen, each item corresponds to a building, and the user can drag the building into the scene. It works the same way as dragging things from the Flash library onto the stage. We can store the ClassName corresponding to each item in that item; when dragging starts, we create an instance of it and let it follow the mouse. Only when the mouse is released over a valid area of the canvas do we add it to the new DisplayObjectContainer.

Flash

Can't set the size of the Loader?

Problem: var loader:Loader = new Loader(); loader.loadBytes(byteArr); return loader; After that, trace(loader.width,loader.height) gives (0,0), and as soon as you change the width and height via lo...

Flash
12347