I'm pretty sure no-one can tell me the name of this cartoon film but i'll try anyway.
It starts off with a child who gets separated from his family at an early age and while growing up, he ends up imprisoned by the Egyptian king (forgot the reason). In the prison, it is revealed that he can interpret dreams and tells his jail mate that the nightmares his been having means he will be executed in a few days. The man's jail mate doesn't believe this. In a few days later, the jail mate is executed.
While this is happening, the jester of the Egyptian King is trying to find entertainment for the king. He finds many comedians and performers but they were all executed since they did not entertain the king. Eventually the king is fed up with the jester and throws him into the same cell as the man (mentioned earlier). The jester begins to talk to the man and finds out that he can read dreams. The jester is then let out with one more chance to entertain the king. The jester then brings the man to the king. The king tells the man about his dream (it was something about 3 cows drinking water from the great nile river and then 3 black cows eats the cows). The man then tells the king that the dream means that Egypt will go into a harsh drought and no rain will come this year and that the Great Nile River will dry up. The king believes him through fear and prepares for the drought. To his surprise, the Great Nile River did dry out and the king gave the man a piece of land and told the Egypt that he was a great dream teller. Many people around Egypt began to see this 'dream teller' with a small payment. Eventually the man's family (from the beginning of the movie) shows up but the man refuses to see them since he has shamed them by not seeing them for many years.
This was all i saw from the film. For some reason, i didn't finish watching the film on television and now im always thinking what happened at the end. Good luck and thanks in advance