1. An method for focusing by using a pre-flash, the method comprising the steps of: an image sensor capturing a first image of an object when the pre-flash does not emit light to the object, wherein the average brightness of the first image is calculated to be Y 0 ; when Y 0 is smaller than a predetermined minimum Y 1 , the image sensor capturing a second image of the object with the aid of a first pre-flash having a first energy, wherein the average brightness of the second image is calculated to be Y 1 ; the image sensor capturing a third image of the object with the aid of a second pre-flash having a second energy, wherein the average brightness of the third image is calculated to be Y 2 ; calculating the distance D to the object according to the brightness Y 0 and the difference ΔY between Y 1 and Y 2 ; and the image sensor adjusting the focus according to the distance D.