Groups | Blog | Home
all groups > flash actionscript > january 2007 >

flash actionscript : "selecting" a movieclip at runtime


rodolfo1216
1/10/2007 6:54:02 PM
I've got a number of movieclips on the stage and I have a slider which I want
users to use to change the height and width of these movieclips. But how do
users "select" a movieclip and then how does the slider know which has been
selected so it can adjust the size of the selected movieclip. Finally, how do
users select another movieclip if they wish to resize that one?

Thanks!

Michael
LuigiL
1/10/2007 7:04:25 PM
Several solutions but try using this one:
set a timeline var like 'current_mc'.
In an onRelease event for the mc's the user select, set that timeline var to
'this' which creates a reference to the clicked mc.
Your function that scales the mc should then use current_mc to do the scaling
on.

var current_mc:MovieClip;

mc1.onRelease=function():Void{
current_mc=this;
}
AddThis Social Bookmark Button