If you need to have media relocated and are not keeping everything in one iTunes folder then you have to let iTunes do the moving. You do not do that simply by changing preferences. You have to do it by changing preferences then consolidating/organizing your media to the desired location so iTunes does the moving and it then knows to where things have been moved.
I have no idea why it works when you don't have the external connected -- it shouldn't. Even if it does, it should continue to work when the external is connected. This isn't making sense and I think this somewhat haphazard copying amd changing preferences settings is somehow working but in an upside down manner.
I asked:
You say you had the library on the external drive. The whole library? A library isn't just media files, it's the media files plus a series of other files and folders that iTunes uses.
You replied:
yes, as I said, I changed the itunes media folder location in prefs from the external drive to my internal one as well as copied the media files.
That did not answer my question asking if you have all your library on the external drive. If you do, follow my first set of instructions on how to move the whole library iintact to another drive. If you don't you need to let iTunes do the copying, not you.
What are the iTunes library files? - http://support.apple.com/kb/HT1660
More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
Where are my iTunes files located? - http://support.apple.com/kb/ht1391