2 Replies Latest reply on Dec 15, 2009 4:12 AM by huray

    assign icon from liabrary

    huray

      I have a button, my_btn on stage. I want to assign a movie in the liabrary to this button. In the liabrary I assign the movie linkage identifier as "good" and have this script in first frame : my_btn.icon="good";. I have no result, any idea ?

        • 1. Re: assign icon from liabrary
          kglad Adobe Community Professional & MVP

          if you want to add your icon to my_btn, use:

           

          my_btn.attachMovie("good","icon",my_btn.getNextHighestDepth());

           

          if you want to replace my_btn by your icon, use:

           

          var mc:MovieClip=my_btn._parent.attachMovie("good","icon",my_btn._parent.getNextHighestDepth( ));

          mc._x=my_btn._x;

          mc._y=my_btn._y;

          // etc if there are other properties/methods you want to "transfer" to your icon

          my_btn.swapDepths(my_btn._parent.getNextHighestDepth());

          my_btn.removeMovieClip();

          • 2. Re: assign icon from liabrary
            huray Level 1

            Thanks.