Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorakire
    • CommentTimeMar 21st 2007
     
    hello!

    when i test my movie using the regular object embed, i am able to scale my movie by changing the width and height parameters in the embed tags. but when i test my movie using swfobject, when i change the width and height variables i send it, it does not affect the size of my movie, it remains the size that it was exported out at. does anyone have any ideas why? i'd like to be able to change the width and height of the movie when i write out the swfobject.

    thanks in advance!
    • CommentAuthorpet-theory
    • CommentTimeMar 26th 2007
     
    Akire,

    Same problem. In my swf, I listen for the stage resize event and adjust the size of my movie:

    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    stage.addEventListener("resize", sizeStage);

    When the swf is embedded regularly, the swf hears the event and adjusts. When I embed using SWFObject, no go. The event only fires once, when the stage come up (it did this before).

    I thought maybe the NO_SCALE param needed to be set like this:

    so.addParam("scaleMode", "noScale");

    but no joy. Any luck on this? The stage no longer seems to fire the resize event when the browser is resized...
  1.  
    An update.

    I use a little javascript to tell the flash movie ("Shell") when and how to resize:

    window.onresize=function()
    {
    document.getElementById("Shell").onResize(window.innerWidth, window.innerHeight);
    }

    This works for Safari and Firefox, but not IE. Anyone know why?
  2.  
    this fixes it. apparently IE does not do innerWidth .

    var movie=document.getElementById("Shell");
    if (window.innerWidth)
    {
    movie.onResize(window.innerWidth, window.innerHeight);
    } else {
    movie.onResize(document.documentElement.clientWidth, document.documentElement.clientWidth);
    }
    • CommentAuthorblackkite
    • CommentTimeApr 7th 2007
     
    Internet Explorer
    document.swf_id.height= height_value;
    document.swf_id.width= width_value;

    Fire Fox, Safari, Netscape,Opera
    document.getElementById('div_name').style.height= height_value+"px";
    document.getElementById('div_name').style.width= width_value+"px";

    see the working example
    http://www.aliceinphysics.com
  3.  
    blackkite, nice to know about getting to the movie via the div name

    one thing, though, referring to the movie via the div name does not work for external interface;

    //in Shell
    ExternalInterface.addCallback("onResize", onResize);

    //in the html, produces an error
    document.getElementById('flashcontent').onResize(window.innerWidth, window.innerHeight)

    is something else required?

    document.getElementById('flashcontent')[somethingElse].onResize...

    anyway, I'll shut up now, since this isn't a noobie Javascript forum.