There are a number of potential issues with the code as you show it.
cup0.DisplayObject.x, ??? what are these
shuffle = function... change that to be written just like your pressBtn function
Math.random(nothing goes in here)... should be Math.random()*targetArray.length, although you want to get an integer value out of it, not a decimal value
As far as the 1010 error goes, go into your Flash Publish Settings and select the option to Permit Debugging. That can help by adding the line number of the offending code to the error message.