PDA

View Full Version : Center Object to 0,0


jma6517
01-21-2009, 05:18 PM
I have a scroller with buttons that allow the user to click on them and have the larger version of that image come up. As it stands now, everything works until I use the scroller to move right. When I do that and click on the button, the larger image is no longer set at the 0,0 coordinates. Below is the code. If anyone has any ideas, I would greatly appreciate it. I am not too familiar with the points variable and that may be the problem.


btn1.onPress = function() {
showBig(this, "1.jpg");
}
btn2.onPress = function() {
showBig(this,"2.jpg");
}
btn3.onPress = function() {
showBig(this, "3.jpg");
}
btn4.onPress = function() {
showBig(this, "4.jpg");
}
btn5.onPress = function() {
showBig(this,"5.jpg");
}

btn6.onPress = function() {
showBig(this, "6.jpg");
}
btn7.onPress = function() {
showBig(this, "7.jpg");
}
btn8.onPress = function() {
showBig(this, "8.jpg");
}
btn9.onPress = function() {
showBig(this, "9.jpg");
}
btn10.onPress = function() {
showBig(this, "10.jpg");
}
function showBig(obj, path)
{
point = new Object();
point.x = 0;
point.y = 0;
localToGlobal(point);

_root.attachMovie("big_image","bigImg",33,{_x:point.x, _y:point.y});
_root.bigImg.path = path;
}

guidoguido
01-21-2009, 10:50 PM
if should be

point._x = 0;
point._y = 0;

I think..