stoimen.com/blog

web developing

Archive for February, 2009

object and embed tags revealed

This is the second part of my post:

html object and embed tags

where you can find why there are two tags instead of one … and when and how to use them. 

Now I’m gonna explain what’s more interesting about their well documented attributes.

classid shows the type of the ActiveX controls and it should be strict defined. In that sense the flash movie should be with the classid specified above:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ...

of course other classid is used when using other ActiveX controls, like Java applets, i.e.:

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" ...

More interesting are the codebase for <object> and pluginspage for <ebmed> tags. The show where the plugin for the flash player can be found and respectively downloaded, in case the visitor does not have one.

Less known attribute is ‘quality’. In almost every example the quality is set to high. Like

<param name="quality" value="high" />

but most of the web developers does not know that there is a autolow or autohigh property value.

<param name="quality" value="autolow" />

The last thing I’d like to write is the wmode attribute. Often the flash movie is with transparent background and does not displays correctly without the:

<param name="wmode" value="transparent" />

parameter. In IE 6 there is another problem. If wmode is not set to transparent, elements with z-index more than the flash movie does not appear over it.

There are a lot of resources online about these tags, and someone can be interested in how using <object> to display a PNG transparency or something else.

see more on: http://www.stoimen.com/blog/2009/02/22/html-object-and-embed-tags/

Html object & embed tags

Maybe almost 90 % of the web developers world wide are using widely the <embed> and <object> HTML tags, but in the most cases do not understand the semantics and syntax of them.

Very well known is that these tags help to put a flash movie into the HTML, but why they are two, and can they be used in other cases remains unanswered.

These tags, in general, are really most used to put flash movie into the web site, and as anyone can guess they are two cause of the differences in the web, specially between the web browsers. The <object> tag helps for the browser who use ActiveX controls to display properly the flash movie. In fact the newest Internet Explorer browsers like 7 version and 8 beta, display the movie correctly even without the <object> tag, but not always those flash movies work in the expected manner. Somethimes there are problems with autoplay or something like that. Especially this can be problematic when using some kind of .flv player. In that case (depending from the player) the movie initialize but the required .flv does not load and play. This was the problem I wrote for in my previous post about Opera and JW FLV Player.

As you may guess the <object> tag can handle much more the flash movie, but as many other entities as there are ActiveX controls.

To be more exact the <object> tag is for Internet Explorer, while the <embed> tag is for Netscape and related to it browsers using Netscape plugin to display a flash movie. More detailed information can be found on Adobe site:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_4150

All the specification can be found online but more important is to mention the semantics of some of the attributes.

For both of the tags valid attributes are width and height. They can be either pixels or percentage, which are relative from the element containing the object/embed pair, i.e. if the flash is in a div with fixed width of 800px and the object/embed pair is 100% width the movie will became 800px wide.

Notice: some browsers do not calculate the height correctly when the height is set in percentage.

For the <object> tag only there should be classid, codebase, movie attributes, while for the <embed> tag only is src and pluginspage.

see which attributes are mandatory and which one are not at: object and embed tags revealed


JW FLV media player issue under Opera

As it appears, the famous flv player JW FLV Media Player does not plays correctly on Opera, and who knows maybe under other browsers too, but the problem is not in the Opera not even in the JW Player. Just don’t forget to add both object and embed tags as specified. That should help you.

Choosing a PHP IDE

Recently I saw very nice post in the famous site www.smashingmagazine.com about how to choose good IDE for PHP. There is a contest between four of the most used PHP development environments : Eclipse, which is my favorite, Zend Studio 6, Aptana PHP and Aptana Studio Pro.

Interesting link about JavaScript plugin for Eclipse can be found on http://spket.com/, and is my recommendation.

The author of the article gives you good reason why using an IDE, and that’s why you can have:

  1. Syntax highlighting.
  2. Code completion.
  3. Navigation into the code.
  4. Errors and warnings highlighting.
  5. Refactoring and code generation.
  6. Debugging.
  7. Versioning system.
  8. Client-side features.

Great thanks for the smashingmagazine.com about this very good article, and don’t waste time to read it and start using an IDE.

IE 6 problem with flash z-index

Z-indexes on IE 6 works almost like on any other browser, but if something does not work for you, please do not forget to check (or even double check) the paramter for transparent background of the flash. Not only the z-index, and absolute positioning is needed, just add this line of code in your object tag:

<param name="wmode" value="transparent" />

Why flash does not work correctly with Flash ExternalInterface see here:

How to write object tag to make your IE browser work I’ve written here: