Question
Drag attachMovie clips
I have buttons that use attachMovie to dynamically load clips
onto the stage. I would like the user to be able to click and drag
the loaded clips within a limited area.
How do I make the attached Movies 'draggable'? Here is the code I am using to attach the movies
function areaButton(locatorClip):Void {
attachMovie(locatorClip,"MyClip",10,{_x:300, _y:300});
}
button1.onRelease = function() {
areaButton("movieClip01");
};
button2.onRelease = function() {
areaButton("movieClip02");
};
button3.onRelease = function() {
areaButton("movieClip03");
};
----
this is my code for start and stopDrag, but it doesn't work
MyClip.onPress = function():Void {
this.startDrag(false,200,100,400,200);
};
MyClip.onRelease = function():Void {
this.stopDrag();
};
Any help would be much appreciated!
Kristen
How do I make the attached Movies 'draggable'? Here is the code I am using to attach the movies
function areaButton(locatorClip):Void {
attachMovie(locatorClip,"MyClip",10,{_x:300, _y:300});
}
button1.onRelease = function() {
areaButton("movieClip01");
};
button2.onRelease = function() {
areaButton("movieClip02");
};
button3.onRelease = function() {
areaButton("movieClip03");
};
----
this is my code for start and stopDrag, but it doesn't work
MyClip.onPress = function():Void {
this.startDrag(false,200,100,400,200);
};
MyClip.onRelease = function():Void {
this.stopDrag();
};
Any help would be much appreciated!
Kristen