Results 1 to 2 of 2

Thread: increase size of movie clip

  1. #1
    Join Date
    Feb 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question increase size of movie clip

    hi friends please help me qiuick ,
    i am creating a presentation for tat i need one script.its aout to increase the size of the script when a buton is pressed in the presentation plzzz help.me.............

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hey Harsath24330...

    To increase the size is pretty simple. We could do it a few ways.

    1) Immediate Resize

    Code:
    btn_mc.onRelease = function() {
       resize_mc._width = new width
       resize_mc._height = new height
    }
    This will immediately resize the target mc (resize_mc) when the button (button_mc) is clicked. There will be no tweening or easing, etc...


    2) Ease/Tween Animation

    There are a lot of tweening engines out there -- Fuse, mcTween, Tweener, Zigo, MX Tween/Ease Class, etc...

    Use whichever you are familiar with. My personal favorite is mcTween. With mcTween, you wold do this.

    Code:
    btn_mc.onRelease = function() {
       resize_mc.xScaleTo(200, 1, "easeOutQuad")
       resize_mc.yScaleTo(200, 1, "easeOutQuad")
    }
    Note: Make sure you've included the mc_tween2.as file -- #include "mc_tween2.as"

    Sytax: [movieclip].xScaleTo(scalePercentage, time(seconds), tweeningAnimation)

    You can find more on mcTween here: hosted.zeh.com.br/mctween/



    If you would rather use actual values for the size, use the Tween/Ease class that ships with Flash MX 2004 and above...

    Code:
    btn_mc.onRelease = function() {
       new Tween(resize_mc, "_width", Regular.easeOut, resize_mc._width, new width, 3, true); 
       new Tween(resize_mc, "_height", Regular.easeOut, resize_mc._height, new height, 3, true);
    }
    Note: Make sure to import the Tweening and easing classes-- import mx.transitions.Tween; import mx.transitions.easing.*;

    Syntax: new Teen([tagetMC], "_property", "tweenAnimation", "startValue", "endValue", "time (frames/seconds), "useSeconds (true/false)")

    There is a nice tutorial on the Tweening/Easing classes here: http://www.kirupa.com/developer/actionscript/tween.htm

    For your benefit, I've color coded the AS. Everything in red needs new values (i.e. those of your MC and of your preferences). Everything in blue needs to be renamed to your movieclips. If you have any other questions, feel free to post back.

Bookmarks

Posting Permissions

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