I have a flash movie as below.
I would like to开发者_如何学编程 make an action when i click to mc_8 (or any other mc_?) with tween as below.
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.
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});
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.
精彩评论