What OS are you using?
What computer are you using?
What graphics card are you using?
It will be helpful if you search for, download, and run AIDA or EVEREST to check your hardware setup and give this information.
Did this problem perhaps start after installing a new combination package of CODEC's? If so, try uninstalling that combo package. Let us know which one seems to have caused the problem.
Does this happen with only some files of the .avi type, or all of them?
Does this happen with any files of other type, such as mpeg, .mov, .wmv, etc?
Try downloading and running the GSpot Codec analysis tool on the files it does not work on, and see if they are all using the same, or same family of Codecs. If some AVI files are working use the tool to see if those are using different, or are using the same Codecs as the ones which are not working. Let us know what you find.
GSpot is at
http://www.headbands.com/gspot/