View Full Version : moving multiple movie clips with button
mobzilla
07-22-2004, 06:14 PM
I am using the startDrag command in a button to move movie clips. The problem is that it is only moves one movie clip, the last movie clip in the list.
on(press) {
startDrag(_root.Tile1, true,400,100,400,100);
stop();
startDrag(_root.Tile2, true,400,170,400,170);
stop();
}
on(releaseOutside) {
stopDrag();
}
It only moves Tile2 (not Tile1). Is there a way to move both tiles when the button is clicked?
:confused:
Ricod
07-23-2004, 04:16 AM
You can drag only one mc. What you need to do is move the other one around by altering it`s _x and _y properties. You could bind them to the _x and _y of the mouse for instance.
mobzilla
07-23-2004, 06:59 PM
sounds like a good way to do it. but I'm having a probem getting your idea to work. do you see any problems with this code?
on(press) {
TileType = Math.floor(Math.random() * (10 - 1)) + 1;
_root.temp1.text = TileType;
if (TileType < 5) {
trace ("in brick loop");
_root.brick1._x = 500;
_root.brick1._y = 500;
}
}
I get the correct numbers in the temp1 text box, and the trace pops up in the loop. but I get no movement of the brick1 mc. fmx2004. Yes, the instance names are correct.
mobzilla
07-23-2004, 07:08 PM
oops. I don't think I'll ever get used to how touchy flash is on upper / lower case letters. in the instance name the first character was capitalized, and when I was calling it in the loop I was using no capitalization. what a stupid mistake.
:rolleyes:
thanks very much for the help
Ricod
07-24-2004, 06:56 AM
Np, I only made a suggestion ! The rest is all you ! ;)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.