PDA

View Full Version : flash mx changing vars to select another clip to drag


chris_angell
02-17-2006, 10:37 AM
Hi Guys...

I am having a problem with flash MX, changing varibles so another startDrag movieclip can be activated, I have two dragable movieclips, and when you OnRollover the movie clip the movieclip is activated, I need it so when you roll over the movie clip it chages the vars so it knows it can be dragged, i can drag one of the clips but have tried to chage the varible so the otherone will be seklected but nothing !!

here is my code


// declare Movieclip, clip is called mc1, i am trying to change 1 to 2 so movieclip 2 will work then back to 1

IdMc = mc1
xPos = 30
yPos = 30
TgPic = "1sm.jpg";
BoxId = "Box1"

IdMc.onPress = function() {
startDrag(IdMc);
}
IdMc.onRelease = function() {
stopDrag();
if (_root.IdMc._droptarget == "/"+BoxId) {
loadMovie("FlashImages/"+TgPic,BoxId);
}
IdMc._x = xPos;
IdMc._y = yPos;
IdMc.gotoAndPlay(1);
}

here is the code when you roll over the dragable movie clip...

on (Rollover) {
RefId = 2
IdMc = mc2
xPos = 80
yPos = 30
TgPic = "2sm.jpg";
}

any ideas why it isn't working...

here is a link to see my code in action, but you can only drag one box... any help will be good help..

http://www.connectonlinepreview.co....ctionOne_2.html