Cookie Confusion HTML or AS

I have a Flash banner on my webpage. The banner is on every page of my site but I only want it to play when the visitor first arrives. After that I want it to be a static banner. I’m assuming I’d use a cookie but I don’t know if the cookie needs to be inside the Flash or if it needs to be in the HTML code on the page. Any advice?