Saturday, December 31, 2005

Flash Player above 7: Tutor of Window Actionscript in flash using Swapdepth



Create a Box Button. Again Convert this button to MovieClip.
Now create multi instance of this MovieClip in the stage and name the instance of the each MovieClip like source_mc,source1_mc,source2_mc.
Select the button to write the actionscript by, RightClicking the MovieClip > 'Edit in place', select the button press F9.

Add the code:

  1. on (press, dragOver) {
  2. this.startDrag();
  3. this.swapDepths(this.getNextHighestDepth());
  4. }
  5. on (release, dragOut) {
  6. this.stopDrag();
  7. }

    Here we are changing the swapDepths by getting the HighestDepth in the Stage.
    Due the multi instance every movieclip has the same function.

No comments:

Adobe News