The button code for A is #B_RRIGHT
You don't want to put the beep code outside the main loop. Say your main loop is movement code. If your beep code is directly below it (outside the loop), and the program never exits the movement loop above, then the beep code would never run, and thus no sound occurs.
CLS DX=185,DY=115 SPSET 0,0:SPOFS 0,DX,DY LOOP'main loop 'movement IF BUTTON(1,#B_LLEFT)==1 THEN DX=DX-1 IF BUTTON(1,#B_LRIGHT)==1 THEN DX=DX+1 IF BUTTON(1,#B_LUP)==1 THEN DY=DY-1 IF BUTTON(1,#B_LDOWN)==1 THEN DY=DY+1 IF DX>360 THEN DX=360 IF DX<0 THEN DX=0 IF DY<0 THEN DY=0 IF DY>220 THEN DY=220 SPOFS 0,DX,DY 'beep IF BUTTON(1,#B_RRIGHT) THEN BEEP 6 VSYNC ENDLOOPI've only used SB4 for a bit, but isn't the first parameter of BUTTON the Controller ID? You want to make sure you're checking for input from the right controller as well, but I might be wrong about that. (I don't know what sort of XCTRLSTYLE you've got going on.)