Goodbye, _targetInstanceName?
Monday 27 October 2003 – Filed under: Flash – No Comments
It looks like there’s no way to use the very powerful _targetInstanceName property with Flash MX 2004 components. This variable used to be filled out automatically by the Flash IDE when a user drag-dropped a component from the Library onto a movieclip or button at the Stage, but this behaviour seems to be discontinued in Flash MX 2004.
Back in the days of Flash MX, it was only a matter of time before component builders discovered this very powerful feature of the Flash IDE and I have created a number of components myself as well (the Simple Effects library, for example) that rely on this capability.
For people unfamiliair with this little, but very handy trick, have a look at the following:

- download source file.
The DropMe component is being dragged from the Library onto the red circle with instancename ‘MyCircle’. After releasing the component, the user doesn’t need to set the target of the component manually (via the Component Inspector Panel). Instead, it is set automatically after dropping the component onto the clip. Another nifty thing is that the component will automatically snap to the upper-left corner of the movieclip.
After Flash MX 2004 was released, I received numerous requests from people asking me to update my components to make them Flash MX 2004 compatible and in the process I discovered this quirk.
Unfortunately, I haven’t yet found a way to get this to work with Flash MX 2004. Asking around in various newsgroups, mailinglists and even the Godfather of Components himself has proven unsuccessfull. I also found some unanswered threads about this problem, for example on Macromedia’s own forum and the Flashcoders list (which mentions my presentation on F04 components at Flashtival 2003 where I discussed this problem).
This is part of the code I’ve used to try to get _targetInstanceName to work with Flash MX 2004:
[as]class DropMe extends MovieClip {
// ….
[Inspectable(name="target")]
public var _targetInstanceName:String;
// …
}[/as]
- download source files.
I recently stumbled upon another interesting thing regarding F04 components, namely the clipParameters (scroll to section 3), which are used for backwards compatibility, but specifying these in a F04 Component also doesn’t bring back _targetInstanceName functionality.
The most frustrating thing is the fact that AS1 components imported into Flash MX 2004 still snap to clips etc, but AS2 version components don’t. So somehow the mechanism works, but only for AS1 components, not their AS2 counterparts.
Anyone from Macromedia who cares to explain? Even if _targetInstanceName indeed doesn’t work for AS2 components in F04, I’d love to know! Needless to say, a work around would be even better…
« previously: MobyDock : Mac OS X Dock for Windows next: Hello, _targetInstanceName! »
Leave a Reply
Recent Articles
- New bike
- FLV Player 2.0.25 released
- No custom headers for Flash file upload. Why?
- Building AIR with FDT
- Adobe MAX 2007
- FLV Player 2.0 released
- The new Photoshop logo
- mProjector WindowResizer class
Advertisement
Categories
- Art & Design (4)
- Flash (37)
- FLV Player (9)
- Software (16)
- User Experience Design (3)
- Various (8)
- Work (6)