Flash/XML

Out of context: Reply #7

  • Started
  • Last post
  • 9 Responses
  • fugged0

    Rather than using duplicateMc, why not create movieclips on the fly with createEmptyMovieClip ?

    You can then create the textfields, set their text and then get the width of the rendered text to create a background MC.

    var menuItem:MovieClip = someMovieClip.createEmptyMovieCl... depth);
    menuItemLabel = menuItem.createTextField("menuIt...
    menuItem.menuItemLabel.autoSize = "left";
    menuItem.menuItemLabel.text = "This is a menu item";

    Obviously you'll need to enter the correct arguments to the creation methods, but I think you'll understand.

    You can then create another movieclip whose depth is less than the textfield and use the drawing API to create a box around the type, or you could even just set the background color of the textfield via it's backgroundColor property.

View thread