Jump to content
xisto Community
Sign in to follow this  
szupie

Html: Alt Text For Objects Is it possible?

Recommended Posts

My site is going to use a lot of Flash files pluged into the page. I embed it into the page like this:

<object width="550" height="400"><param name="movie" value="flashfile.swf"><embed src="flashfile.swf" width="550" height="400"></embed></object>

What I want to know is: Is it possible to give the object an alt text? Something like the alt="The Flash File" that is used in IMG tags is what I want. I've tried putting it inside the object tag, param tag and embed tag. That didn't work.

Share this post


Link to post
Share on other sites

The alt text is displayed when the file is not displayable, or when you mouse over the image and the tooltip comes up. And I don't think a tooltip comes up on flash docs. So, I don't see the point :D However, I have heard of editting the Flash menu before, or at least removing some of the items, so that it's down to like 2 options. Maybe you should post the plan for the big picture... maybe someone could help better that way. I'll be experimenting until you post back.

Share this post


Link to post
Share on other sites

The alt text is displayed when the file is not displayable, or when you mouse over the image and the tooltip comes up.  And I don't think a tooltip comes up on flash docs.  So, I don't see the point :D 

<{POST_SNAPBACK}>

No, alt text is not the thing that comes up on hover.

 

However, I have heard of editting the Flash menu before, or at least removing some of the items, so that it's down to like 2 options.  Maybe you should post the plan for the big picture... maybe someone could help better that way.  I'll be experimenting until you post back.

<{POST_SNAPBACK}>


What do you mean by Flash menu? I don't think I've heard of it before.

Maybe there's a tag that displays text when the object is not found. Maybe not.

Share this post


Link to post
Share on other sites

What I want to know is: Is it possible to give the object an alt text? Something like the alt="The Flash File" that is used in IMG tags is what I want. I've tried putting it inside the object tag, param tag and embed tag. That didn't work.

The alt attribute is only usable with the HTML <img> tag.

 

Maybe there's a tag that displays text when the object is not found. Maybe not.

You could, alternatively, use the <noembed> tag so that text is displayed if the user does not have the flash plugin.

 

Example:

<object width="550" height="400"><param name="movie" value="flashfile.swf"><embed src="http://fun.tmc.dyn.ee/groovin_granny.swf" width="550" height="400"></embed><noembed>You do not have the Flash plugin installed to view the file correctly. You may download the plugin from here: https://get.adobe.com/flashplayer/otherversions/;

Notice the insertion of the following code:

<noembed>You do not have the Flash plugin installed to view the file correctly. You may download the plugin from here: https://get.adobe.com/flashplayer/otherversions/;
I hope this helps...

 

Regards,

Becky

Share this post


Link to post
Share on other sites

I think what you're looking for is the title attribute. The alt attribute in IMG tags is actually often misused to create tooltips when your mouse is hovered over the image, alt attributes are for when the image is switched off or otherwise inaccessible, and then displayed as an "alternative". The title attribute is actually the correct attribute for tooltips and the like, and can be used in most tags, although apparently not all browsers would show the title string as a tooltip, especially the older ones.Although in your case the noembed tag recommended by Becky is a better choice...

Share this post


Link to post
Share on other sites

No, I'm looking for an attribute that comes up when the object is unavailable... Well, I guess maybe there is no way to do that with html... I might try doing it with php.

Share this post


Link to post
Share on other sites

No, I'm looking for an attribute that comes up when the object is unavailable... Well, I guess maybe there is no way to do that with html... I might try doing it with php.

<{POST_SNAPBACK}>

There is no way in which to use the alt attribute with plug-in content and this goes for the title attribute as well. This is because browsers do not offer support for such attributes for the <EMBED> and <OBJECT> tags.

 

I suggest you try the method I have described above :D

 

Regards,

Becky

Share this post


Link to post
Share on other sites

Yay, I've finally found the solution to the problem... I stumbled upon it yesterday on A List Apart.

<object type="application/x-shockwave-flashdata="yourflashhere.swf" width="550" height="400"><param name="movie" value="yourflashhere.swf" /><img src="noflash.gif" width="200" height="100" alt="Xisto" /></object>

This code follows w3c standards, and should be supported by all browsers. The reason why this works is because when the browser can't work with the <object> element, it goes through the next elements in the list until it finds one that works, which is the img tag. I have only tested this with Firefox and Lynx. In Firefox, the image does not come up when the swf is not found, but only when the plugin is not found. In Lynx, the plugin is obviously not found, so the img tag would be used. Because Lynx is non-graphical, it uses the alt tag of the img element.

In my opinion, this combined with some php/dom script, detecting whether the file is there or not, seems to be the best solution I know of. I'm kinda stubborn with what I think is the most logical.

Share this post


Link to post
Share on other sites

My site is going to use a lot of Flash files pluged into the page. I embed it into the page like this:

 

<object width="550" height="400"><param name="movie" value="flashfile.swf"><embed src="flashfile.swf" width="550" height="400"></embed></object>

What I want to know is: Is it possible to give the object an alt text? Something like the alt="The Flash File" that is used in IMG tags is what I want. I've  tried putting it inside the object tag, param tag and embed tag. That didn't work.

<{POST_SNAPBACK}>

just put your object in a table and give title to table

<table width="100%">

<tr>

<td title="your title here">

<object width="550" height="400">

<param name="movie" value="flashfile.swf">

<embed src="flashfile.swf" width="550" height="400">

</embed>

</object>

</td>

</tr>

</table>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.