A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Reset movieclip scale

  1. #1
    Join Date
    Dec 2002

    Reset movieclip scale

    I am wondering if there is a way to reset the scale of a movieclip once it has been scaled up.

    Here's what I have:
    I have a movieclip (clipA) on the main timeline that I scale up 1000% using actionscript.
    I want to attach another movieclip (clipB) to clipA using attachMovie.
    I can do this okay, but clipB takes the same scale as clipA, so clipB is also scaled up 1000%. Also, if I try to position clipB, just an increment of 1.0 on the X or Y scale moves a huge amount.

    Is there a way of scaling clipA, then resetting the scale so when I attach clipB, it comes in at normal size rather than 1000% and reset the X and Y scales so that when I position clipB, it moves pixel at a time?

    Thanks for any help you can offer.

  2. #2
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    San Francisco, CA (USA)
    because clipB is a part of clipA (just like all of the other shapes etc in clipA) it fets deformed along with clipA, though it itself is not deformed in anyway within the scope of clipA. If you want to try to make it proportional to clipB's parent or whatever you consider 'normal' scale etc, you'll have to counter-scale clipB opposite of clipA. Of course you would have to do something similar with movement.

    for clipB:

    sFactor = 100/_parent._xscale
    _xscale = 100 * sFactor; // 100% scale
    _x += 10 * sFactor; // moves by 10

  3. #3
    Senior Member
    Join Date
    Aug 2001
    you'll have to set the scale of clipB according to the scale of clipA..
    so if clipA's scale is 200, clipB's scale should be 50..
    if clipA's scale is 1000, clipB's scale should be 10..

    hope this helps.

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