Resize the swf in an elastic div

Hi, i want to explain my problem:
I've an elastic css layout, and there is a div hat countains
my swf, this div has height and width variables, that is, the
dimension of the div is not fixed, height and width are not in px
but in %.
Now, I want to know how can I do to have the swf resizabe
100% height and 100% width in the div? If I give 100% to height and
width in the embed tag the result it's that the swf don't resize it
self, but there are white spaces in the div (if I click with the dx
buttom of the mouse on th white spaces I see the traditioal flash
menù).
Someone says to me that the solution is to use an
actionscript with a stage object.
I'm not an expert of flash, someone can help me with this
problem?
Thanks!

You cannot have static content above interactive content.

Similar Messages

  • Safari is resizing the swf file

    i go to File => Open => swf
    it opens just fine, but then when i resize the window
    everything grows or shrinks with the window.
    what's that about?

    Seth Prince;
    That is what happens when you open a "bare" swf--embed the
    swf in an
    html page and set the size in pixels. See flash's publish
    feature... -Tom
    Unger

  • Resizing the swf inside a container

    Hi Guys,
    I am using a dashboard inside a vbox. I have integrated my
    dashboard into my main application (i.e. I have two different swfs,
    one of my main application and other of dashboard). Now when I
    login into my application by reducing the size of the browser, the
    pods inside the dashboard appears very small. Now when I increase
    the size of the browser the size of the pods remains small. Now my
    requirement is that the size of the pods should also get increased
    along with the size of the browser. Please help me in this regard.
    Thanks,
    Nirmal Kumar Bhogadi

    Hi mersec,
    That's Ok, I fixed the code like below, you could refer to.
    Private Sub picturebox1_mouseup(sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseUp
    'Allows picture box to be dragged inside container
    'Top and Left sides of picturebox1 will not exceed point 0,0
    'This will stop any "grey space" from appearing outside these edges.
    pbLoc.X = (PictureBox1.Location.X + (e.X - a))
    pbLoc.Y = (PictureBox1.Location.Y + (e.Y - b))
    If pbLoc.X + screenshot.Width > 0 And pbLoc.Y + screenshot.Height > 0 Then
    If pbLoc.X > 0 Then pbLoc.X = 0
    If pbLoc.Y > 0 Then pbLoc.Y = 0
    If pbLoc.X + screenshot.Width - ClientSize.Width < 0 Then pbLoc.X = ClientSize.Width - screenshot.Width
    If pbLoc.Y + screenshot.Height - ClientSize.Height < 0 Then pbLoc.Y = ClientSize.Height - screenshot.Height
    PictureBox1.Location = New Point(pbLoc.X, pbLoc.Y)
    Else
    'else recovery the location
    pbLoc.X = PictureBox1.Location.X
    pbLoc.Y = PictureBox1.Location.Y
    End If
    End Sub
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Resize the .swf file

    I've finished my flash site using a resolution of 1024x768: my professor wasn't so happy of a resolution so "high" (even if today is something like standard) since somebody might still have an old monitor with low res.
    Since I really don't want to get a bad vote I wanted to change the resolution to 1000x550 because with that res a 1024x768 monitor still can see everything: then I've exported my .swf file and then into the .HTML file I've changed the width and height fields.
    Is this a "correct" operation? There could be any problem??
    All tips are welcome!

    Select everything on every layer and with the "edit multiple frames" option turned on, scale your content proportionately to 800x600. Don't forget to select everything on the scene before scaling, just checking "edit multiple frames" wouldn't be enough
    Emil Georgiev - Flash & Web Design

  • Load and resize a SWF inside a MC

    Hi,
    I'm using AS2 to load an SWF inside an MC. The MC measures
    800x600, while the SWF (which can vary in size) measures in this
    case 14x60, even though, looking at it, it seems to be about half
    the size of the hosting MC. This makes me think that the dimension
    scales are different. I'm loading the SWF using MovieClipLoader and
    I'd like to resize it so that it fits as proportionally snug as
    possible within the MC. How can I do this? If I try to resize the
    SWF to the MC's dimensions, it become way too large and goes off
    screen. If instead I try to rescale the hosting MC to fit around
    the SWF, the SWF itself rescales as well. I'm going nuts! How can
    accomplish this?
    Thank you,
    Tatiana

    To make things simple, I'd like to take an existing SWF (the
    picture) and load it into a FIXED SIZED MC (the frame) and I'd like
    to rescale the SWF so that it fits perfectly into the frame.
    By all means, I know that what you said should work and I
    admit my inexperience with AS2, but somehow the SWF's I'm loading
    in, have scales that are totally different with respect to my
    Stage. I even tried loading the SWF directly onto the stage and
    then I loaded the frame separately onto the stage and tried to
    resize it to the SWF's _width and _height. The frame became a tiny
    dot on the screen, while the SWF filled half of my Stage.
    Thanks again for your help.

  • Resizing the viewable screen in realation to content

    I'm making a flash document that will take in a photo and
    then allow the user to resize it. I dont want to force users to put
    in a specific sized image so i'd like to be able to resize the swf
    in relation to the size of the image that has been loaded. This
    will allow any user to put in any sized image.
    Is this possible?
    thanks in advance
    Greg Conn

    Is this the same posting as this one from earlier? If you've contacted NI and they said it's a problem, I supposed they'll submit it to R&D.
    J.R. Allen

  • Resizing Imported SWF?

    I have imported an SWF into a FLA project library and have
    dragged it onto a frame in my project. I am trying to resize the
    SWF to about 1/4 of its original size to make it fit correctly in
    the new project. I cannot figure out how to resize the SWF. I have
    tried the properties sheet, but it won't take different width and
    height parameters. No object boundaries appear (all I have is a dot
    to select the object) so I cannot use the transform tool to scale
    it. Any ideas?

    I did this recently where I had a backdrop clip that I wanted
    to serve as a 'screen' for jpgs I loaded in. I wanted them to
    resize to the full extent of the background clip and maintain their
    aspect ratio. The backdrop clip could have different dimensions at
    different points in time as well... anyhow this should work with
    swfs same as jpegs.
    So I'll explain it in my context as I don't know exactly
    yours (sorry this might sound a bit complicated because of that).
    #1 If your holderclip is called
    imageHolder and it contains a single clip inside at location
    0,0 called
    imageBackdrop
    #2 You create an emptyMovieClip inside imageHolder and use it
    to load your swf into using a Loader with a listener
    #3 you have some code similar to this in your onLoadInit
    event for the Loader (onLoadInit lets you initialise things like
    size location etc before it displays)
    If you can do something like that then I think you should be
    on the right track for what I think you want to do.

  • BitmapData draw method doesn't work when the project is published as the .swf file of the web applic

    Hi,
            I am totally confused by this strange error. When I tried using the draw method of BitmapData to draw a movieclip symbol of my project, it seems to work fine locally. However, as I uploaded the published .swf file to my web server and launched it as the plugin of my web application, it failed. The source codes as follows,
    function printscreenClicked():void
         //ExternalInterface.call calls a javascript function to print message1
        var bd:BitmapData = new BitmapData(stage.width,stage.height);
        //ExternalInterface.call calls a javascript function to print message2
      bd.draw(stage);
        //ExternalInterface.call calls a javascript function to print message3
    message3 didn't show at all. Instead, the browser console shows "Uncaught Error: Error calling method on NPObject.". My understanding of this error message is that the .swf is calling something crashing, and I believe that bd.draw(stage)is the crashng method call.
    Also, here is my html embed tag:
        <embed src="/tests/videoplayer.swf" id="flash" quality="high" height="510" width="990" scale="exactfit" name="squambido" align="middle" allowscriptaccess="always" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="margin: 0px auto;clear:both;position:relative;"/>
    Can someone help me?

    Thank you for your reply.
    I tried stageWidth and stageHeight, but it still doesn't work.
    The draw() methid is triggered when I clicked a screenshot button in my application as follows,
    ExternalInterface.addCallback("printscreenClicked", printscreenClicked);
    function printscreenClicked():void
         //ExternalInterface.call calls a javascript function to print message1
        var bd:BitmapData = new BitmapData(stage.width,stage.height);
        //ExternalInterface.call calls a javascript function to print message2
      bd.draw(stage);
        //ExternalInterface.call calls a javascript function to print message3
    Would you please give me an example of "waiting for Event.RESIZE is good, or just at least Event.ENTER_FRAME"?
    My real purpose in this application is to capture a snapshot of a streaming video. The video is contained in a movieclip object. I tried stage first since BirmapData.draw() doesn't work when drawing the movieclip on the web site. Do you have any suggestion for this situation? Also, is there any good method to find out what happened if the browser have "Uncaught Error: Error calling method on NPObject."?

  • How to resize a SWF file to fit on stage

    Hi everyone,
    I'm fairly new to Flash so please bear with me. I'm trying to resize a SWF file made in InDesign. My Flash application is set at 1920x1080 and the SWF file was made at the same size. I need it to be resized to 1700x956. This is the section of script that relates to the SWF file.
    break;
    case 'fact_btn':
    eventAction = ".../FactSheet.aspx";
    eventLog(eventAction);
    factLoader.load(new URLRequest("FactSheet/HABFactSheet.swf")); //fact.swf
    factLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
    break;
    factLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loaderCompleteHandler);
    spotlightStageRect.addChild(factLoader);
    spotlightStageRect.visible = true;
    spotlightStageRect.addChild(close_btn);
    close_btn.addEventListener(MouseEvent.CLICK, removeSpotlight);
    I've tried adding in the code below but the stage comes up blank when I run it in Flash. Anyone have suggestions? Also let me know if you need to see more of the script.
    factLoader.width = 1700
    factLoader.height = 956

    you need to execute that resize factLoader code in loaderCompleteHandler

  • Why does Captivate 6 create mp4 files that the swf does not playback clearly?

    Captivate 5 created a .swf which suited my training purposes very nicely.  There were swf files in the library, embedded in the (rather large) .swf that I asked the students to run.  Now it seems that Captivate 6.0.1.240 won't do that.  Captivate 6 creates external mp4 files for the video portion (audio is separately recorded mp3 that is imported to the finished demo video slide) and they look terrible when the .swf runs them.  Those mp4 look fine on their own but the .swf must resize them to properly fit with the TOC on the screen.
    The HTML created when I make the .swf looks fine but it does not all fit on the screen as does the .swf so I don't like it and don't want to use it.  Thanks, in advance, for any replies and suggestions.

    Hi llstewart,
    I assume you are launching your program from C drive. Are any
    components of Captivate stored on the remote drive? (I am thing
    your user profile, are you the only person who accesses Captivate
    from that machine?)
    Does this happen all the time?
    What I have noticed in my own network is that there are
    periodic "dropped" connections on the network. I have never figured
    out what it causing this, but Captivate does not like it. (Every
    once in awhile if Word or Excel are writing to a file on a share,
    they will become thoroughly corrupted too.)
    The problem with Captivate is that it needs a lot of a
    computer's resources and takes what it can get. It also seems to
    write to a temp file a lot (while a capture is taking place) an
    only "binds" it up when the user stops and ends the session. The
    only thing I can think of is that during this process there is a
    inturruption in your network.
    Sorry I couldn't fully answer your question.
    I would try (if you can) loading the software on a machine
    that is not on the network and try to do a series of long captures
    and see if the problem persists.
    I work in a large network and I do not have the problem, but
    I have also installed the software myself and made sure of the
    installation. I also make sure the program I am recording is local
    (whenever possible). Additionally, do you have problems with any
    other programs and corrupted files?
    Again, sorry I don't have a quick answer.
    TPK

  • Need to resize a SWF file

    i need to resize a swf file thats 800 x 300 down to 600 x 226
    how can i do this without having to set the new parameters in
    the embed tag like this <embed src="banner.swf" height="226"
    width="600"> ..??
    is there a way to resize the whole project when i export the
    swf file or something.
    i made my project a lil to bigger than i needed and have
    already imported a few other swf files into this main banner swf
    project so i need to resize everything down now..
    How can i do this..??

    What format is the file in before you export to SWF?
    What program are you using to convert your file from its
    current form to SWF?

  • How to resize a swf created in Catalyst?

    Hello,
    I have created a beautiful site in Catalyst. My problem is: I don't know a code to edit the size of the swf created in Catalyst.
    The swf is now 800 x 600, but I want it to automatically fit the browser.
    I already made an swf in Flash Professional CS5, and then import it in Dreamweaver, and edit 800 x 600 to 100% x 100%.
    This works really well, but when I do the same with my swf created in Catalyst, it doesn't.
    Does anyone know how I can solve this problem?
    Thanks,
    Matiege

    Hi Matiege,
    What version of Fc are you using? The latest version of FC, called "Panini", supports constraints, so you can run the project, resize the browser and all objects that are using constraints will be aligned properly. The object layout constraints are specified with so called "suction cup" displayed when the object is selected. There is also a few options if you right click on the suction cup. The "Panini" is available for download at http://labs.adobe.com/technologies/flashcatalyst_panini/.
    The older version of FC supports absolute coordinates only.
    Does it answer your question?
    Thanks,
    - Mykola
    FC QE

  • How to load images from client side when the swf is hosted on a server without uplaoding it to server?

    I'm trying to build a online image resize tool.
    problem i face are:
    1. I build a button that allow user to browse the file. Once
    file is selected, it doesnt show full path.
    2. lets say if it shows fullpath, but i try to load it into a
    movieclip, and it doesnt work because the swf file is located at
    the server and not the client's place.
    3. as far as i know, flash can only load images which is
    located in the same server or internet.
    4. if i use php, asp, cgi.. it can only allow me to 1st
    upload the image then resize later, but this is not wat i want.
    5. I need to 1st resize then upload later, because if i have
    100 and more photos taken from digicam, it's going to be very slow
    and heavy.
    What i have tested:
    1. upload "image3.jpg" into the same directory as the
    "viewer.swf", and it works.
    2. do not upload the swf to the server, but run locally from
    the user's computer and open "image3.jpg" and it works.
    3. upload the swf to the server and open "image3.jpg" from
    the user's computer and IT DOESN"T WORK!
    please help me out.
    Thanks~!

    use this php code.
    for flash php image prosses.
    flash file
    import flash.display.BitmapData;
    shaF.onPress = function() {
    output();
    function output() {
    snap = new BitmapData(mc._width, mc._height);
    snap.draw(mc);
    var pixels:Array = new Array();
    var w:Number = snap.width;
    var h:Number = snap.height;
    for (var a = 0; a<=w; a++) {
    for (var b = 0; b<=h; b++) {
    var tmp = snap.getPixel(a, b).toString(16);
    pixels.push(tmp);
    var output:LoadVars = new LoadVars();
    output.img = pixels.toString();
    output.height = h;
    output.width = w;
    output.send("show.php", "output", "POST");
    stop();
    PHP file (show.php)
    <?php
    $data = explode(",", $_POST['img']);
    $width = $_POST['width'];
    $height = $_POST['height'];
    $image=imagecreatetruecolor( $width ,$height );
    $background = imagecolorallocate( $image ,0 , 0 , 0 );
    //Copy pixels
    $i = 0;
    for($x=0; $x<=$width; $x++){
    for($y=0; $y<=$height; $y++){
    $int = hexdec($data[$i++]);
    $color = imagecolorallocate ($image, 0xFF & ($int
    >> 0x10), 0xFF & ($int >> 0x8), 0xFF & $int);
    imagesetpixel ( $image , $x , $y , $color );
    //$font = imageloadfont('arial.ttf');
    $font = 'arial.ttf';
    // $text_color = imagecolorallocate($image, 233, 14, 91);
    $black = imagecolorallocate($image, 0, 0, 0);
    //imagestring($image, $font, 5, 5, "A Simple Text String",
    $text_color);
    imagettftext($image, 12, 0, 10, 20, $black, $font, "A Simple
    Text String");
    //Output image and clean
    //header("Content-Type: image/png");
    imagepng($image,"finoy.png");
    imagedestroy( $image );
    ?>
    <html>
    <body>
    <img src="finoy.png" width="159" height="159" />
    </body>
    </html>

  • Dweaver:.jpg rollover activates .swf in seperate AP-Div

    Thursday, May 15th, 2008: 7:22pm PDT
    Hi,
    I'm using Dreamweaver CS3 and I have built separate Flash CS3
    .swf movie clip files that are contained (one at a time) in the
    center of the page by an AP-Div Tag on my web page. Around the
    center AP-Div tag are eight (8) small .jpeg thumbnails of the Flash
    .swf movie clips they represent. I am trying to create eight (8)
    disjointed rollovers that swap out the .jpg for the .swf in the
    center.
    I want to hover over the small .jpeg (still image) and have
    Dreamweaver javascript swap out one .swf file for the one being
    hovered over. I cannot get this to happen. Dreamweaver CS3 will not
    swap out the .swf using the Behavior Attributes palette
    "Swap-Out/Restore" feature.
    How can I accomplish this task?
    P.S.: On the other hand, a simple disjointed static
    .jpeg-to-.jpeg works fine.
    LightningF22

    Div tags 98-101 are positioned in the right place when I'm looking at my page in Dreamweaver. But when I preview the page, those 4 div tags are not where they're supposed to be
    I thought I was reading it wrong, but you really do have 101 AP divs on the page. I don't have the time to go through your code, but using absolutely positioned divs as the sole basis for page layout is likely to lead to massive problems. AP divs (or layers, as they used to be called) were all the rage several years ago, because people wrongly thought they would make web pages work like desktop publishing. I used them, too, until I realized they caused massive problems.
    It won't solve your current problem, I'm afraid, but I recommend that you take a look at the following page, which describes some of the problems with AP div/layers: http://apptools.com/examples/pagelayout101.php.

  • How can I resize the size of the Excel web part?

    I have a spreadsheet that i want to use to populate a page in my SharePoint site.  i copied the workbook to the site, created the page and added the excel web part. then i linked the workbook to the web part and submitted.  it displays but only
    about 25% of the sheet shows. i dont want to use the thumbs to scroll inside the web part. i want the web part sized to show the entire spreadsheet.  cant seem to find how to size the web part. Can some kind soul help me out here.
    thanks

    Hi,
    According to your post, my understanding is that you wanted to resize the size of the Excel web part.
    Per my knowleadge, most of the time excel web parts turn out ugly, due to the fact that they’re rendered in an iframe and therefore the browser doesn’t resize the container to fit the content.
    As a workaround, we can edit the page where you want the resizing to happen, add in a content editor web part, and paste the following code into the source editor.
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () { // resizes excel webparts
    $("td[id^='MSOZoneCell_WebPart']").each (function (i, e) {
    var findIframe = $(e).find ("iframe:first");
    if (findIframe &amp;&amp; findIframe.attr ("scriptforiframecontent"))
    bindEwaLoaded ("#"+e.id);
    function bindEwaLoaded(obj) { // bind event to the web part
    $(obj).bind ("ewaLoaded", function (e) {
    var b = $(e.target).find ("iframe:first").attr ("postedbackalready");
    if (b == undefined) // loop until iframe is ready
    setTimeout (function() { $(e.target).trigger ("ewaLoaded"); }, 1000);
    else // try to resize now
    ewaSetSize (e.target);
    }).trigger ("ewaLoaded"); // first trigger now
    function ewaSetSize(obj) { // resize elements
    // configure paddings
    var excelObjectWidthPadding = 50;
    var excelObjectHeightPadding = 50.
    var w, h, div1, div2;
    var e = $(obj).find ("iframe:first").contents().find ("table.ewrnav-invisibletable-nopadding:last");
    if (e.length != 0) { // excel table
    w = e.width ();
    h = e.height ();
    div1 = $(obj).find ("table:first> tbody:first> tr:eq(1)> td> div> div");
    div2 = $(div1).find ("table:first> tbody:first> tr:eq(1)> td> div");
    } else {
    e = $(obj).find ("iframe:first").contents().find ("div.ewrchart-img-div");
    if (e.length != 0) { // excel chart
    w = e.width ();
    h = e.height ();
    div1 = $(obj).find ("table:first> tbody:first> tr:eq(0)> td> div> div");
    div2 = $(div1).find ("table:first> tbody:first> tr:eq(1)> td> div");
    if (w == 0 || w == undefined) { // loop until content is ready
    setTimeout (function() { ewaSetSize (obj); }, 1000);
    } else { // do resize
    w += excelObjectWidthPadding;
    h += excelObjectHeightPadding;
    div1.width (w);
    div2.height (h);
    </script>
    For more information:
    Automatically resizing Sharepoint Excel Web Parts
    JQuery for Everyone: Dynamically Sizing Excel Web Parts
    Dynamically re-sizing excel services webparts
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for