Here today, gone tomorrow

Tag: Flash Page 3 of 8

Vizzy Flash Tracer: get trace statements from compiled SWFs

When you are trying to track down a bug in a SWF, it’s a common practice to add trace statements to the FLA. By tracking various values in the program, you can usually find the bug. Unfortunately, it only works reliably when you publish the SWF from the IDE. There are cases where this isn’t feasible. For example, if you need to see whether or not flashvars are being received correctly by your SWF.

This is where Vizzy Flash Tracer comes in. It is a standalone program that runs beside your browser and displays the trace output of your SWF. It can pick up the trace statements from a SWF running on a remote web server, which is perfect for testing things like flashvars or communication between a SWF and javascript. Simply fire it up, navigate to your web page, and watch the trace output. It has been indispensable for tracking down bugs in my Flash applications.

vizzy flash tracer

Debugging with Vizzy is more reliable and faster than Flash’s own remote debugging (which often crashes the browser). It’s already become an indispensable part of my debugging toolkit. In case you missed the link above, you can download it here.

If you are having trouble getting it to work correctly, check out this page of the wiki. I have also noticed that Vizzy locks up sometimes when I have Photoshop open. So, you may have to close photoshop to do your debugging.

Flash AS3: How to hide public properties, methods, and classes in your ASDocs

ASDocs are a great way to create an API for your AS3 classes. If you work on large projects with multiple developers, good documentation can be a big time saver – the other developers can access the public methods and properties of your classes without having to wade through your code.

I recently had an assignment building some animated components in Flash for a large Flex development project. Each component contained a dozen or so classes with a number of public methods and properties. Realistically, though, the Flex developer only needed to access the public methods and properties of a single container class for each component. The other classes just cluttered up the API with useless information. I also wanted to hide the references to stage instances in my component interface. While they are technically public properties, I didn’t want the Flex developer to reference them directly, so they shouldn’t appear in the API. Luckily, there is an easy way to hide things in ASDocs. Simply add the following comment above anything you want to exclude from your ASDocs:

/** @private */

This will exclude the element that follows from your ASDocs output. This can be used to hide a single property like this:

/** @private */
public var timeDisplay_mc:MovieClip; //this is a stage instance

Or it can be placed before the class definition to exclude an entire class from the ASDoc output:

package com.wastedpotential {
    import flash.display.MovieClip;

    /** @private */
    public class InvisibleClip extends MovieClip {

        ...stuff goes here...

    } //end class
} //end package

It’s a really simple way to clean up your API reference and hide all of the public elements that you don’t want other developers to have access to. I don’t bother creating ASDocs for many projects, but having a clean, useable API reference for large multi-developer projects is essential.

Flash mystery error 1046: InstanceInfo

I was working on a Flash component today and it started throwing this exact error at me after I cut-and-pasted some of the designer’s assets into the FLA:

1046:Type was not found or was not a compile-time constant: InstanceInfo

I couldn’t figure it out. I didn’t have any symbols, actionscript, or instance names of “InstanceInfo.” I wasted nearly an hour tracking down this issue only to find out that it was another damn TLF Textfield BUG! Does anyone actually use the TLF Textfield? It’s nothing but trouble for me.

Enough ranting. The problem was that the designer had accidentally created a few TLF Textfields in a separate FLA, which I pasted into my FLA. Unfortunately, my document was set to publish to Flash 9, which doesn’t support TLF Textfields. The really annoying thing was that I didn’t get a warning from Flash when I pasted in the assets and the IDE gave me a cryptic and useless compiler error.

Luckily, the fix is simple. Open up the publish settings and click on the Flash tab. The IDE will then finally flag the TLF Textfields as a problem and show you a warning popup. If you want to change your publish settings to Flash 10, click “cancel” when the popup appears. If you want to keep your settings where they are, click “ok” and flash will convert your TLF Textfields to Classic Text. Save your FLA and you’re done!

I’ve been to busy to post much here lately, but I thought that this might actually save someone else a small headache.

Flash CS5: How do I get my timeline frames to zoom out?

This is a strange one… I was working in Flash CS5 the other day and I somehow zoomed in to my timeline frames and couldn’t get them to zoom out. I did some Googling and found lots of people with the same problem, but no solution.

scroll mouseWell, if you’re like me, you use a scroll mouse, where the scroll wheel is actually a clickable middle button. Most 3D modelling programs actually use this middle mouse button, but a lot of programs do not, so it’s easy to forget about it.  It turns out that I had accidentally clicked the mouse wheel while I was using it to scroll through the timeline. So, to get it to zoom back out, I had to click and hold the mouse wheel down while scrolling in the timeline.

This seems like one of those weird “features” that Adobe added to Flash even though nobody asked for it. You’re much more likely to do this accidentally while quickly clicking around than you are to ever use this feature.  This would be a useful feature on the stage, but it doesn’t work on the stage – just the timeline. Huh?

Overall, though, Flash CS5 is a MASSIVE improvement over CS4. If you haven’t upgraded yet, you should. It’s still a little less stable and a bit slower than CS3, but the workflow improvements are great.

Page 3 of 8

Powered by WordPress & Theme by Anders Norén