i tried to modify this code, so when i click the circle, it moves to x position which the there is a transparent circle named cir
the sp moves but do not stop at the cir x
any help
ActionScript Code:
[LEFT][COLOR=#000000]**var**[/COLOR] sp:Sprite = [COLOR=#000000]**new**[/COLOR] Sprite[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
sp.[COLOR=#000080]graphics[/COLOR].[COLOR=#0000FF]beginFill[/COLOR]COLOR=#000000[/COLOR];
sp.[COLOR=#000080]graphics[/COLOR].[COLOR=#000080]drawCircle[/COLOR]COLOR=#000000[/COLOR];
sp.[COLOR=#000080]graphics[/COLOR].[COLOR=#0000FF]endFill[/COLOR]COLOR=#000000[/COLOR];
addChildCOLOR=#000000[/COLOR];
sp.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], fade[COLOR=#000000])[/COLOR];
[COLOR=#000000]function[/COLOR] fadeCOLOR=#000000[/COLOR]:[COLOR=#0000FF]void[/COLOR] [COLOR=#000000]{[/COLOR]
sp.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR]Event.[COLOR=#000080]ENTER_FRAME[/COLOR], enterF[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]function[/COLOR] enterFCOLOR=#000000[/COLOR]:[COLOR=#0000FF]void[/COLOR] [COLOR=#000000]{[/COLOR]
sp.[COLOR=#000080]x[/COLOR] += [COLOR=#000080]4[/COLOR][COLOR=#000080][/COLOR];
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]sp.[COLOR=#000080]x[/COLOR] == cir.[COLOR=#000080]x[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
sp.[COLOR=#000080]removeEventListener[/COLOR][COLOR=#000000]([/COLOR]Event.[COLOR=#000080]ENTER_FRAME[/COLOR], enterF[COLOR=#000000])[/COLOR];
[COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]