If your layer X references a featureclass then it is featureLayer class. Featurelayer classes implement the IIdentify interface. You can use it to call the identify method with the point you clicked. This returns an array of IIdentifyObjs, the IIdentifyObj has a flash method. In the case of a featurelayer, the IdentifyObjs should be FeatureIdentifyObjects, IFeatureIdentifyObj has a reference to the feature, which has the objectid.