Flash Command: Convert to Symbol and Distribute to Layers

Josh was bitching on Twitter the other day about how if you select multiple objects in Flash and choose Convert to Symbol, it puts them all on the same layer, regardless of where they were before. Others agreed that it is frustrating. I know where he’s coming from doing production art, so I built this quick Command to do just that. If you save in your Commands folder, and re-boot Flash, you can re-map your F8 key to use this Command instead of the regular Convert to Symbol Command.

fl.getDocumentDOM().convertToSymbol('movie clip', '', 'top left');

Also, you can create simple Commands like this on your own. Just do what I did, and open up your History Panel via Window > Other Panels. The top right of the Panel has a menu that allows you to see the JavaScript of your actions. You can then copy-pasta from there!

9 Replies to “Flash Command: Convert to Symbol and Distribute to Layers”

  1. You should combine this technique with my auto-MovieClip namer script:


    if (fl.getDocumentDOM().selection.length > 0)
    mcName = prompt("MovieClip Name", "");
    if (mcName != null)
    newMc = fl.getDocumentDOM().convertToSymbol("movie clip", mcName, "top left");
    fl.getDocumentDOM().selection[0].name = mcName;

  2. One thing I just discovered is that if you have overlapping shapes on separate layers and you make them into a MovieClip using this technique, it “merges” the shapes into a single shape and thus they don’t get split into multiple layers. Suck, huh? There’s a solution but it involves writing a JSFL equivalent of distribute to layers. Fun. :(

  3. another problem I’ve always found annoying with distribute to layers, is that it tends to shift things to a half-pixel position, like 0.5 – especially annoying for the anal designer

  4. Yeah, the merging of shapes that Steven mentions sucks. That’s actually the main reason why I was complaining. I can handle a few MovieClips on the same layer, but when the shapes merge, I can no longer edit them.

  5. Using this, if you have multiple layers with several objects on each layer, using this would land up creating too many layers in your symbol, which is sometimes just as bad as everything on one layer.

    What would be better is if there was a command that could move the whole layer structure into the new MC. Which would be the JSFL equivalent of:
    1. create new layer
    2. create empty MC on new layer
    3. cut frames
    4. paste in new MC
    5. remove old parent layers

Comments are closed.