Flash Frustrations

So in a recent project, I came across 4 Flash frustrations, or “Flashtrations” as I am starting to call them. These are basically bugs in Flash that are so annoying to a developer like me that it drives me mad. Here they are:

1. getURL and POST. Yes, I know that posting via getURL doesn’t work while testing. That’s at least a documented frustration. But it also doesn’t seem to work when in the browser. Well, it doesn’t work often enough, at least. I charted about a 10% failure rate. 90% of the time, the POST variables reached the server OK. 10% of the time they didn’t reach the server at all. It wasn’t about browsers, versions of Flash or firewalls, either. The same user would post fine several times, and then all of a sudden their post would be missing the variables. The solution was to go to a sendAndLoad LoadVars command, then get the result back, then do a getURL without any variables at all to complete the process. Three times as much work for me and the server.

2. Reseting movie clips. In Flash there is no good way to bring a movie clip back to it’s original state. Say, for instance, you have a movie clip that generates a bunch of internal movie clips to simulate a pull-down menu. That works great. Then, when the user makes his or her choice from the menu, it should remove all of those temporary movie clips to return the main clip to it’s original state. This often works OK, but not all the time. In my case, it worked the first time, but never again. Specifically, removeMovieClip failed to work, as well as the alternative unloadMovie. Levels set OK, debugging confirmed everything being executed OK, tried  hundred ways to do it. Flash just plain fails to remove the movie clips for some reason.

3. LoadMovie creates crippled movie clips. When you fill a movie clip with an external .swf, you can’t use duplicateMovieClip to make copies of it. The reason you would want to do this is so you can load external game pieces. For instance, say you made a chess game, but you wanted the chess pieces stored externally. So you had a chesspieces.swf that an artist could mess with. Each frame was a different piece. You would need to load the .swf 32 times to fill the chess board. You couldn’t just load it once and then duplicateMovieClip. The work-around is to create a board.swf externally that had a blank timeline and a chesspieces movie clip in it’s library. Then you could load the entire board.swf movie clip into a movie clip on the stage, and attachMovie inside that movie clip all you want. But you would never be able to place main timeline elements between the clips in board.swf. Plus, the external .swf is that much messier and hard to explain to artists.

4. Components are huge. Well, this isn’t a bug, but it is a frustration. I’ve spent my whole Flash/Shockwave career finding ways to save an extra K here and there on file size. I know some developers don’t care, but I do. You save on server bandwidth, and you save the user download time. So, my recent project was 20K. It just didn’t have that much in the way of graphics, it was mostly script. But I wanted to add a simple drop-down menu to it. The component would have been nice, but it clocked in at 50K! So I would have to go from 20K to 70K just to offer the user a drop-down menu choice. No thanks. I wrote my own drop-down in less than 1K. Of course, I had to deal with number 2 above.

Posted on December 20, 2006 at 7:16 am by site admin · Permalink
In: General

7 Responses

Subscribe to comments via RSS

  1. Written by Rob
    on 12/20/2006 at 5:49 pm

    Hey guys just want to comment on “Flash Frustrations” #2.
    To alleviate a failed removeMovieClip, I would use:
    setTimeout(this, “removeMovieClip”, 1);
    Why it works rather than “this.removeMovieClip”, I am not to sure about.
    It could be because the Flash VM has an instance of the said movieClip somewhere. Saying setTimeout as the last command of a cleanup method gives control back to the Flash VM so the garbage collection can happen.

    I could be wrong, any thoughts?

Subscribe to comments via RSS