A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to make one MC react to another's change in size??

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    71

    How to make one MC react to another's change in size??

    So I have two movieclips. They are both rectangles, with one in front (smaller) and the larger in back (basically it's 6 pixels larger on all sides). I'm using some easing functions to resize the smaller rectangle MC when a button is pressed.

    What I want to happen is I want the larger rectangle MC to always be 6 pixels larger on all sides (so 12px greater in height and in width) no matter what the size of the smaller rectangle MC.

    How can I make this larger rectangle automatically react to changes in size of the smaller rectangle so that it always stays exactly proportional??

    I thought about setting up some kind of onEnterFrame function where the larger rectangle MC is constantly monitoring the smaller rectangle's size but there has to be a better way.

    Help!

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    we'll have to see some of your code before being able to help any further..
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Banned
    Join Date
    Mar 2007
    Location
    Albania , prishtina
    Posts
    274
    Can somethin like this work :

    onEnterFrame = function(){
    LargeRec._xscale = SmallRec + 12;
    LargeRec._yscale = SmallRec + 12;
    }


    ??

  4. #4
    Member
    Join Date
    Nov 2000
    Posts
    71
    yeah that's pretty much how i have it working... i was just wondering if there was something more along the lines of an eventlistener... but listeners can only respond to certain events that are broadcast --- not when doing something like clicking a button to tell an MC to resize.

  5. #5
    Banned
    Join Date
    Mar 2007
    Location
    Albania , prishtina
    Posts
    274
    can you post the code , that you have till now ...

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