Kerberos
Kerberos

Reputation: 1266

How to develop tween action in flash?

I have a flash movie as below.

enter image description here

I would like to make an action when i click to mc_8 (or any other mc_?) with tween as below.

enter image description here

Could you suggest a tutorial or method for developing this with AS3 and AS2, please?

Thank you in advance.

EDIT

if click to other mc from mc_8 all movie just must move, not scale.

Upvotes: 0

Views: 243

Answers (2)

Last Chance
Last Chance

Reputation: 73

pre> you can use greensock framework to implement tween effect. suppose there is a MovieClip that named mcsBox contains all your mc_*: `

import flash.events.MouseEvent;
import greensock......;

mcsBox.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void
{
  var yourMc:MovieClip = e.target as MovieClip;
  if (yourMc && -1 != yourMc.name.indexOf('mc_'))
  {
     for (var i:int = 1; i < 19; i++)
     {
        var mc_n:MovieClip = mcsBox.getChildByName('mc_'+i) as MovieClip;
        if (mc_n == yourMc) continue;       
          var anyWhereX:number = Math.random() * 600; //  I don't know where you wish to go
          var anyWhereY:number = Math.random() * 600;  // same as above
        TweenLite.to(mc, 1, {transformAroundPoint:{point:new Point(anyWhereX,anyWhereY)}, ease:Bounce.easeOut});          

      }
  }
});

` //------------------ above code may not run correctly you wish. you can optimize it.

Upvotes: 0

Huang F. Lei
Huang F. Lei

Reputation: 1865

Have a look at greensock http://www.greensock.com/tweenlite. You can add a mouse click handler to your mc_* container, and tween it as:

TweenLite.to(mc, 1, {transformAroundPoint:{point:new Point(250,218), scaleX:0.5, scaleY:0.5}, ease:Bounce.easeOut});

Upvotes: 1

Related Questions