Hello, you are talking about The Adventures of the Magic Flute, which has been played on TV before.
When Justin discovered this flute that was lost 3,000 years ago, he had no idea that it would change his young life forever. Involved in his and his friends' lives are a race of magical beings who, at the call of Justin's flute, fly across the sky and across the ocean to carry out the commands of their young flute master. Many pterodactyls, sea snakes, phoenixes, and seahorses appeared on the beach and skateboard tracks. The magician, the emperor and the princess also woke up from their three thousand years of slumber and continued their fight for the magic flute that they had started since ancient times. The flute now belongs to Justin, but the magician will stop at nothing to steal it. In the battle between Justin and the magician, the whole world becomes an arena for good magic and evil witchcraft.