Guys... (and girls) ..
I'm trying to add a punaise on a board each time I click on a ADD PUNAISE button.. I'm duplicating the movieclip of a punaise.. Seems quite simple. However.. it get's tricky when I try to detect the x- and y-cos of the different mc's.. For instance, when the user places a punaise on top of another punaise, I need to know the exact x- and y -cos of BOTH mc's to determine which on has to get on TOP in depth... Getting that info from the one I placed urlier is pretty hard... Here's the AC I have so far for the duplicated MC (the punaise)... :
ActionScript:
on(press){
this.startDrag();
this.gotoAndStop(2);
_global.current_active_punaise = this._name;
_global.last_active_punaise = this._name;
}
on(release){
this.stopDrag();
this.gotoAndPlay(3);
_global.current_active_punaise = "none";
last_placed = "punaise_mc"+start_mc_number;
//trace("x_coordinates of punaise ("+last_placed+"): " + this._x);
if(_global.start_mc_number > 0){
var c:Number = 0;
while (c++<_global.start_mc_number) {
qeued_punaise = "punaise_mc"+c;
with(qeued_punaise){
trace("x_coordinates of punaise ("+qeued_punaise+"): " + _x + " " + _y);
}
}
}
}
THIS IT MY OUTPUT:
Code:
1 punaise_mc1 x_coordinates of punaise (punaise_mc1): 174.4 90.2 2 punaise_mc2 x_coordinates of punaise (punaise_mc1): 354.4 -10.8 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 3 punaise_mc3 x_coordinates of punaise (punaise_mc1): 358.4 101.2 x_coordinates of punaise (punaise_mc2): 358.4 101.2 x_coordinates of punaise (punaise_mc3): 358.4 101.2
THIS SHOULD BE my output:
Code:
1 punaise_mc1 x_coordinates of punaise (punaise_mc1): 174.4 90.2 2 punaise_mc2 x_coordinates of punaise (punaise_mc1): 174.4 90.2 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 3 punaise_mc3 x_coordinates of punaise (punaise_mc1): 174.4 90.2 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 x_coordinates of punaise (punaise_mc3): 295.2 101.2
Plz help I have been searching for a solution all day long !!!!
Thnx
I'm trying to add a punaise on a board each time I click on a ADD PUNAISE button.. I'm duplicating the movieclip of a punaise.. Seems quite simple. However.. it get's tricky when I try to detect the x- and y-cos of the different mc's.. For instance, when the user places a punaise on top of another punaise, I need to know the exact x- and y -cos of BOTH mc's to determine which on has to get on TOP in depth... Getting that info from the one I placed urlier is pretty hard... Here's the AC I have so far for the duplicated MC (the punaise)... :
ActionScript:
on(press){
this.startDrag();
this.gotoAndStop(2);
_global.current_active_punaise = this._name;
_global.last_active_punaise = this._name;
}
on(release){
this.stopDrag();
this.gotoAndPlay(3);
_global.current_active_punaise = "none";
last_placed = "punaise_mc"+start_mc_number;
//trace("x_coordinates of punaise ("+last_placed+"): " + this._x);
if(_global.start_mc_number > 0){
var c:Number = 0;
while (c++<_global.start_mc_number) {
qeued_punaise = "punaise_mc"+c;
with(qeued_punaise){
trace("x_coordinates of punaise ("+qeued_punaise+"): " + _x + " " + _y);
}
}
}
}
THIS IT MY OUTPUT:
Code:
1 punaise_mc1 x_coordinates of punaise (punaise_mc1): 174.4 90.2 2 punaise_mc2 x_coordinates of punaise (punaise_mc1): 354.4 -10.8 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 3 punaise_mc3 x_coordinates of punaise (punaise_mc1): 358.4 101.2 x_coordinates of punaise (punaise_mc2): 358.4 101.2 x_coordinates of punaise (punaise_mc3): 358.4 101.2
THIS SHOULD BE my output:
Code:
1 punaise_mc1 x_coordinates of punaise (punaise_mc1): 174.4 90.2 2 punaise_mc2 x_coordinates of punaise (punaise_mc1): 174.4 90.2 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 3 punaise_mc3 x_coordinates of punaise (punaise_mc1): 174.4 90.2 x_coordinates of punaise (punaise_mc2): 354.4 -10.8 x_coordinates of punaise (punaise_mc3): 295.2 101.2
Plz help I have been searching for a solution all day long !!!!
Thnx