How to set <object> tag in HTML to accomodate a resizable application

Posted on 2009-12-19
Last Modified: 2012-05-08
A typical <object> tag in an html page looks like:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                    width="400" height="400">

I need to get around having to specify a fixed width and height because my Flex/Flash application is resizable. When I remove the width and height attributes, my application doesn't even show.

Can anyone tell me how to use the <object> tag with a resizable object like my Flex/Flash application? Thanks.
Question by:elepil
    LVL 3

    Accepted Solution

    It's because the <object> tag doesn't have standard wrapping markup like div's and span's that you don't see the movie. The object is still like "imploded" into a mere marker on the HTML page but has no visual properties. When adding width and height you make it div-like and then it can show it's inner content.

    What mostly worked for me is giving the <object> 100% dimensions and then control it with a wrapped <div>. I'm not sure if the movie will be stretched. I think it depends on your export settings.

    I tried this code once with JavaScript to resize the <div> box, but unhappily the rendering of the Flash movie wouldn't stretch with the DOM. Maybe jQuery can achieve something like that. You can keep your Flash's navigation/location in a session and refresh the <div>'s content with an AJAX request.

    <style type="text/css">
        .objectContainer {
            width: 950px;
            height: 680px;
        .flashObject {
            width: 100%;
            height: 100%; /* In Safari 4 on Mac OSX it keeps it's proportion */
    <div class="objectContainer">
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" class="flashObject">

    Open in new window


    Author Closing Comment

    Sorry I didn't get back to this sooner. I did not describe my issue properly. So I will close this and award you the points anyway. My new post which describes the problem better is at:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now