I also have this problem before but i can't remember clear what is was reason. Did you sure that all your files is in the one folder? Check also in map properties did the main script is attached.