A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Resizing stuff HELP

  1. #1
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870

    Resizing stuff HELP

    Hello,

    I was wondering what could I put into as the Actionscript IF i want a piece of MC to resize itself to 20% of its original size if I drag the MC into it? say I got 3 MCs called MC1, MC2, MC3 and the hittested MC "Shade", How could I put the AS?

    Regards,
    Tongxn
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  2. #2
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    Hey tongxn,

    Using those movieclips, this is how you would do it. Place the main movieclip onto the stage, the one you will be dragging the other movieclips into. Then place the hitTest movieclip shade onto it making sure its invisible

    Next place the following code on the other movieclips:

    code:

    on (press) {
    this.startDrag();
    }
    on (release) {
    this.stopDrag();
    if (this.hitTest(_root.shade)) {
    _root.mainMovieClip._xscale -= 20;
    _root.mainMovieClip._yscale -= 20;
    }
    }



    And that should do it

  3. #3
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    um, what is -= 20 here? Is it to make the MC to 20*20 size or 20%*20% of it's original size?
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center