Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    4
    Member #
    4640
    Ok, I'm basically going crazy, I've spent forever trying to get my flash properly embedded in some html. I want to do a simple index.html page with all my content in index.swf.

    The problem I'm having is that some of my content in my flash disappears or isn't adjusted right. I have the resolution at 800x600. If I change it to 640x480 everything works great but it's too small.

    My ultimate question is: Is there any possible way to make a .swf like "snap" to auto fit. Like no matter what size you have the opened page it will enlarge or minimize while still remaining the same content and formatting wise.

    If not is there at least a way i can have everything work and look right at 800x600.

    Any input would be great...the website is up right now and feel free to look at it, you can just view the source to maybe find my problem.

    www.meaganfrancis.com

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You can do that via javascript. Here I made an example for you. This sample script will snap to the predefined sizes in order of preference (larger to smaller).
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
        <head>
            <title></title>
            <script>
            // Sizes listed in decreasing preference
            var sizes = [[1500, 1000], [1200, 800], [900, 600], [750, 500], [600, 400]];  
            function scaleFlash() {
                if (document.getElementById) {
                    var width = document.all ? document.body.clientWidth : window.innerWidth;
                    var height = document.all ? document.body.clientHeight : window.innerHeight;
                    for (var i = 0; i < sizes.length; i++) {
                        if (width > sizes[i][0] + 20 && height > sizes[i][1] + 20) {
                            document.getElementById('swfIndex').width = sizes[i][0];
                            document.getElementById('swfIndex').height = sizes[i][1];
                            break;
                        }
                    }
                }
            }
            </script>
        </head>
        <body onload="scaleFlash()" onresize="scaleFlash()">
            <center>
                <embed id="swfIndex" width="750" height="500"></embed>
            </center>
        </body>
    </html>

  4. #3
    Junior Member
    Join Date
    Jan 2004
    Posts
    4
    Member #
    4640
    Is there by any chance a tutorial on this. I've been messing with the code you gave me and what I have for index.html and combining the two but sadly I can't get it to work. I'm going to look for some more books today lol.

    Thanks for your help and anymore if you have the time to give it.

  5. #4
    Junior Member
    Join Date
    Jan 2004
    Posts
    5
    Member #
    4680
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="750" height="400">
    <param name="movie" value="index.swf">
    <param name="quality" value="high">
    <embed src="home.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="400"></embed></object>

    That's the code I use. Works perfectly for me, but if you have trouble, let me know. That's for basic embedding. (By the way, you'll need to modify the "width" and "height" parameters, to match your file's dimensions.)

    However, if you want it to resize with the window, just have your index.htm forward them to index.swf, so instead of opening an HTML file, it opens a FLASH file, right in the browser. That will lose some quality when you expand it too far though.

  6. #5
    Junior Member
    Join Date
    Mar 2004
    Posts
    1
    Member #
    5145
    how can i know my file's width and height?

    thanks

  7. #6
    Senior Member gabe89's Avatar
    Join Date
    Oct 2003
    Posts
    137
    Member #
    3412
    In flash:

    Modify > Document

    This will give you your files widhth and height.

    An easy way to get the embed code is to go to:

    File > Publish

    Flash will make an html document for you with your flash .swf file already embedded.

  8. #7
    Junior Member
    Join Date
    Apr 2004
    Posts
    1
    Member #
    5557
    Im gettin kinda crazy... How do I insertflash in HTML (code?!?) ?

  9. #8
    Senior Member gabe89's Avatar
    Join Date
    Oct 2003
    Posts
    137
    Member #
    3412
    Originally posted by gabe89

    An easy way to get the embed code is to go to:

    File > Publish

    Flash will make an html document for you with your flash .swf file already embedded.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com