Hello everyone…
I did tried, but things are getting a little weird right now.
I created an imaginary madrix 7x7 where this matrix starts from the center, square 25.
The idea is to move the frame around and show in which xy is located, lets say, square 34 if the user moves x times to the right and y times down.
The problem is that at the beginning it DOES work, but when i do start moving around, it kind of swaps the values of the imaginary matrix.
Quite hard to explain, pls download the code and try urself.
How can i solve this mistery?
Any clues, suggestions, hints?
Here is part of the code:
function right()
{
mc_all_areas._x = mc_all_areas._x -10;
_global.m_click_x--;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function left()
{
mc_all_areas._x = mc_all_areas._x +10;
_global.m_click_x++;
m_v_x=mc_all_areas._x / 240 ;
if(_global.m_click_x % 24 == 0)
{
trace("POSITION: "+ ((25- m_v_x)- (7 * m_v_y)));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._x/240)*1)))));
trace("dist x from center: "+_global.m_sq_x_dist_center);
}
}
function up()
{
mc_all_areas._y = mc_all_areas._y +10;
_global.m_click_y++;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25+m_v_x- (7*m_v_y))));
_global.m_sq_x_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}
function down()
{
mc_all_areas._y = mc_all_areas._y -10;
_global.m_click_y--;
m_v_y=mc_all_areas._y / 320 ;
if(_global.m_click_y % 32 == 0)
{
trace("POSITION: "+ ((25-m_v_x- (7*m_v_y))));
_global.m_sq_y_dist_center = Math.abs((_global.m_start_square - ((_global.m_name_cur_square -((mc_all_areas._y/320)*1)))));
trace("dist y from center: "+_global.m_sq_y_dist_center);
}
}