SIDEBAR : Flash as an inline element

The Strict xhtml Document Type Definition states without ambiguity that the <object> element is an inline element, not a block element.

Block-level elements versus inline elements

A block-level element is laid down on the page as if there was a linebreak before and after it. The <p> element is an example of a block element. Block-level elements pile up one on top of the other. Headlines, blockquotes, <div> tags, tables and lists are other examples of block-level elements. Inline elements don’t create a linebreak before or after them. They appear on the same line as content and elements beside them, they are inline with the text. They are laid next to one another horizontally, from left to right, until they fill the width of the container element, then they continue on, on the next line. That means that if you put two Flash objects side by side in the markup, they will end up side by side on the page if the width of the container (parent) element is large enough to accomodate their width.

While we’re at it, let’s list the five subsets of inline elements, as specified by the Strict xhtml DDT :

Can a Flash object be used as label for an anchor element ?

A question that we may ask ourselves is : can we put a Flash <object> inside an anchor element, to make it clickable, just like we can with text or an image ? The answer is yes, we can put an <object> element between <a> tags.

According to the Strict xhtml DDT :

If we do put a Flash object element inside an anchor element, will it be clickable, and will the browser load the page with the URL specified in the href attribute... in the window ? The answer is yes in Firefox, and no in Internet Explorer. A quick and dirty way to circumvent the limitation (bug?) in Internet Explorer is to add a behavior to the Flash movie clip in the Flash Development Interface (do not bother writing ActionScript for this if the url is a constant) : the action would be Go to Web Page... and the event would be On Press. If you want to code it yourself, use the ActionScript function getURL(url:string, target:string). Use "_self" as target if you want the browser to open the page in the current window.

Flash 8 screenshot of how to add a behavior