dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: mc loads on resize?

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Posts
    286

    mc loads on resize?

    Below I have included the fla. The file is a zoom nav, basically what I want to know is can I have a movieClip play after a square has been clicked on and have resized? If so, how? (The idea is trying to preserve the clean menu look, but still having cool content when each section is loaded)

    Can anyone give me a clue how to do this, or show me?

    Any help wold be greatly appreciated.
    Last edited by Heirattic; 09-13-2007 at 05:01 AM.

  2. #2
    Senior Member RangrJay's Avatar
    Join Date
    Sep 2005
    Location
    Las Vegas
    Posts
    163
    that is definitely possible, but looking at your code, I would do it a bit differently (resizing the box that is).

    put the following code in your action layer, not on the object.

    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    originalX = box1._xscale;
    originalY = box1._yscale;
    //new size values for the _xscale and _yscale
    newX = box1._xscale * 1.25;
    newY = box1._yscale * 1.25;
    
    box1.onPress = function():Void 
    {
    	//the 20 is the amount of time to complete the tween.  If you set false (as I have) 
    	//its 20 frames, if you set true, then it will be 20 seconds.
    	//Strong.easeOut is the type of tween (others include Regular, None, Bounce, Elastic, Back),
    	//Then there are easeIn, easeOut, and easeInOut methods for the tweens
    	var resizeX:Tween = new Tween(box1, "_xscale", Strong.easeOut, originalX, newX, 20, false);
    	var resizeY:Tween = new Tween(box1, "_yscale", Strong.easeOut, originalY, newY, 20, false);
    
    	resizeX.onMotionFinished = function():Void 
    	{
    		trace("motion finished");
    		//In here you can set a movie to play
    		//myMovie.play();
    	};
    };
    Xero Patience Studios
    Web Design
    Software Development
    Graphic/Logo Design

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