Adding Scripts in HTML (i.e. JavaScript, Action script and others) requires the use of opening and closing tags. The script is entered between theses tags.
Read this post on faqwebdevelopment.blogspot.com