Like HowStuffWorks on Facebook!

How ActiveX for Animation Works

        Entertainment | Animation

Using ActiveX with Animation
ActiveX is often used for embedded information such as banner ads like this one.
ActiveX is often used for embedded information such as banner ads like this one.
© Bruno Vincent/Getty Images

ActiveX can be used to embed and play Flash movies or animated GIFs directly on a Web page. This is particularly useful for embedding animated advertisements like banner ads.

Let's start by explaining how to use ActiveX to display a Flash animation on a Web page. The first step is to create the complete animation in Flash and export it as a .swf file. Then you need to insert the correct HTML code into the Web page to activate the Flash Player ActiveX Control and play back the .swf file.

The first thing you do is give the embedded Flash animation a name or OBJECT ID. This is usually the name of the .swf file without the .swf extension. For example, if the file is called "dog.swf," the OBJECT ID would just be "dog."

Then you need to insert HTML code that tells Internet Explorer exactly which ActiveX control you want to use. This is done by entering the unique CLASSID of the Flash Player ActiveX Control, which is "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000."

Now that Internet Explorer knows which ActiveX control you want to use, you can set several parameters that control the playback of the Flash movie [source: Adobe]. The first parameter is the name of the .swf file itself and its location on the server. Then you set parameters that control whether the animation plays automatically upon loading, whether the animation should loop continuously and whether to adjust the animated image's quality.

For even more control, there are parameters that allow you to go back a frame in the Flash movie, or jump forward. You can zoom in on a particular area of the movie and pan across the screen. You can also enter HTML instructions that tell Internet Explorer how to respond if someone clicks on the Flash movie or on a particular link in the movie

For an example of what the HTML code would look like for embedding a Flash file-"dog.swf," in this case go to Adobe.

The process is similar for embedding and playing an animated GIF on a Web page. A GIF, short for Graphics Interchange Format, is a lightweight image format that's useful for creating simple frame-by-frame animations. To design and animate the actual GIF, you'd use a program like Adobe ImageReady.

Once you've created your animated GIF, you'll need to choose an animated GIF ActiveX control. Unlike the Flash Player ActiveX Control, there's no universally recognized ActiveX control for playing animated GIFs on a Web page. Do a Web search for "animated GIF ActiveX control," and you'll find dozens of free ActiveX controls that you can download.

From here, the process is much the same as with the Flash animation. You'll need to enter HTML code between twotags that tells Internet Explorer what file you want to play and which ActiveX control you want to use (for this, you'll need the control's unique CLASSID number).

Animated GIF ActiveX controls offer many of the same parameters as Flash controls for handling the playback of the animation. You can set the animation to a continuous loop, autosize the animation to fit a window, rewind to the beginning of the animation, respond to mouse and keyboard events, et cetera.

Unfortunately, ActiveX has come under fire as a vulnerable security risk for hackers. Read more about it in the next section.