Posted Sunday, June 03, 2007 11:14:47 PM by David Stiller
Not long ago, I answered a forum question at Community MX where the solution arrived entirely because I used the Debugger panel to find what I needed. The developer’s issue took all of ten seconds to pinpoint, but it solved a real need. It couldn’t have been easier, either, so I’ll share what I did, hoping it helps someone else just as quickly.
The need was this: the developer was using the MediaPlayback Component (a precursor to the FLVPlayback Component) and wanted to disable a tiny, built-in triangle button that toggles a zooming/fullscreen-view of the FLV. The Component Inspector panel shows no parameter to configure this button, and it doesn’t appear anywhere in the Components Language Reference. What to do? Debugger panel to the rescue.
After having dragged an instance of MediaPlayback to the Stage and pointing it at an FLV, I used Debug > Debug Movie to run the SWF in the Debugger panel (the menu location in Flash 8 was Control > Debug Movie). When a SWF opens in cahoots with the Debugger panel, you have to click the big green arrow button to get everything started — don’t worry, you can’t miss it — and then all sorts of behind-the-scenes things come to light.
In this case, I set my gaze on the left side, which showed me the dozen or so nested movie clips that comprise an instance of MediaPlayback. One, in particular, caught my attention (yup, the highlighted one). I clicked the triangle arrow and saw that path reference change from what it was to
I knew from experience that “instance1” is the first in a pattern of automatic instance names Flash will give objects without instance names. I knew I could change that to any old arbitrary instance name — and that would have been visible in the Debugger panel too, by the way — so I suggested to the developer that he type the following into the Actions panel:
instanceName._chrome._toggleNE._maximize.enabled = false;
instanceName should be replaced by the actual instance name of the MediaPlayback Component. And that did it. :D So what’s that
enabled part? That’s a property of the
MovieClip class, and it disables event handling for that clip. In fact, if desired, two lines would both disable and hade the button:
instanceName._chrome._toggleNE._maximize.enabled = false; instanceName._chrome._toggleNE._maximize._visible = false;
Now … truth be hold, not many folks use the Media Components anymore. This isn’t a blog entry that will help countless readers with that particular Component, but that isn’t my aim. My aim is to show that the Debugger panel can be used to discover the inner workings of Macromedia/Adobe objects in addition to troubleshooting your own work. Hope that comes in handy for you! :)
Category tags: Flash
See Community MX content by David Stiller