Hey guys!!!
need your help here…
Ive been using this tutorial code and its awesome. but Im having trouble trying to improve it, hope you can help me out… Im trying to add some lines of code so each movie clip can contain another movie clip (blue ball) via loadMovie but 2 things are happening: 1) it does load the movie in the movie clip specified, but it stops being dragable. and 2) i have no control over depths it should swapDepths between 2, 3 each time is being drag…
here is the code, i hope you can help me here…
[INDENT] [LEFT] function init() {
for (var i:Number = 0; i<5; i++) {
this.attachMovie(“blueCircle”, “blue”+i, this.getNextHighestDepth());
var mc:MovieClip = this[“blue”+i];
mc._x = Math.round(Math.random()*300);
mc._y = Math.round(Math.random()*200);
mc.onPress = function() {
this.startDrag();this.swapDepths(2);
_root.cursor.swapDepths(3);
};
mc.onRelease = function() {
this.stopDrag();
};
}
this.createEmptyMovieClip("line", -1);
drawLine();
this.onMouseMove = function() {
drawLine();
}
}
init();
//
function drawLine() {
line.clear();
line.lineStyle(10, 0xBFD7EE);
//4->3
line.moveTo(blue4._x, blue4._y);
line.lineTo(blue3._x, blue3._y);
//3->2
line.moveTo(blue3._x, blue3._y);
line.lineTo(blue2._x, blue2._y);
//2->1
line.moveTo(blue2._x, blue2._y);
line.lineTo(blue1._x, blue1._y);
//1->0
line.moveTo(blue1._x, blue1._y);
line.lineTo(blue0._x, blue0._y);
//0->4
line.moveTo(blue0._x, blue0._y);
line.lineTo(blue4._x, blue4._y);
//
updateAfterEvent();
} [/LEFT]
blue0.loadMovie(“whatever.swf”);
[/INDENT]