A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Two dumb questions I really need to ask (uploading flash website)

  1. #1
    Member
    Join Date
    Jul 2009
    Posts
    69

    Two dumb questions I really need to ask (uploading flash website)

    Question 1: I have a swf that is 1024px wide by 738px height. And I'm wondering what would happen if, on the html page, I used the following code to embed this swf, using 977px by 575 as the dimensions, using the code below: Would it cut-off parts of the swf or just embed it at a smaller size (p.s. I tested, but the answer wasn't immediately evident to me, plus am wondering if there's any harm to it that I'm not aware of).

    <OBJECT CLASSID="clsid27CDB6E-AE6D-11cf- -6B8-444553540000" WIDTH="977" HEIGHT="575" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0">
    <PARAM NAME="MOVIE" VALUE="myswf.swf">
    <PARAM NAME="PLAY" VALUE="true">
    <PARAM NAME="QUALITY" VALUE="high">
    <PARAM NAME="SCALE" value="noborder">
    <EMBED SRC="myswf.swf" WIDTH="977" HEIGHT="575" PLAY="true" QUALITY="high" scale="noborder"
    PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
    </EMBED>
    </OBJECT>


    Question 2. For a few flash games, I have the .swf (to be embedded in html/php), a preloader swf, multiple .as 3.0 files, xml file, various mp3 files that are called in by the xml file (in one I have various .swf files called in by an xml file). I'm learning the process of using flash inside html/php pages ... I know I have to upload to the server the main .swf and the preloader .swf .... do I also have to upload the xml, the .as and all the audio files for things to work well? I know the .fla file doesn't go up there, but does everything else?

    Thank you kindly!

    p.s. everything in my .swf files is vector.
    Last edited by Leftyplayer; 04-01-2011 at 10:35 AM.

  2. #2
    Senior Member
    Join Date
    Sep 2010
    Posts
    324
    Let me guess, you realized that a 1024 monitor does NOT display 1024 px wide???
    Well yes you can change the size of the displayed .swf but the dimensions you ave are not the same aspect ratio as the 1024 x 738 so a couple of things will happen.
    Depending on if you have any scaling set, the .swf will shrink but maintain the same aspect ratio... so it will not be 977 x 575 but rather 977 x 732
    OR it will distort to 977 x 575, skewing the contents, squishing them down to fit.
    Here is an old post regarding scaling:
    Here are examples of different scaling parameters available in the Publish settings. You can also add these parameters directly in the html (<param name="scale" value="noscale"). All the examples replace the actual Flash dimensions with 100% for both width and height (width="100%" height="100%"). These examples use the old <object> and <embed> to illustrate the different ways to scale Flash. Once you understand how it works I’d recommend that you use swfobject to place the Flash in your final project.
    View the source code for each page to see the full code.

    http://www.cidigitalmedia.com/tutori...exact_fit.html

    "exactFit" scales the file to fit exactly within the confines of the screen, irregardless if the movie becomes consequently distorted. The original aspect ratio is not maintained. So round things are not round and squares are not square.

    http://www.cidigitalmedia.com/tutori...e/noScale.html

    "noScale" is the default setting, and causes the movie to be displayed at the originally designed dimensions.

    http://www.cidigitalmedia.com/tutori...no_border.html

    "noBorder" causes the movie to be scaled to what ever dimensions are needed to have no border surrounding the movie within the player, which consequently could result in some of the movie being cut off from view. In other words, the movie will maintain the original aspect ratio and will fill the screen completely. But if the movie has to be streched wider to fill both sides of the screen, it will also stretch taller, but then some of the top and the bottom of the movie may be cut off from view.

    http://www.cidigitalmedia.com/tutori.../show_all.html

    "showAll" scales the movie to the size of the screen (which could cause pixelation if the file contains raster information), the difference between showAll and exactFit is that showAll mantains initial movie size proportions. Because it maintains the original aspect ratio, there can be space to the sides or the top and bottom. But everything always shows and they are not distorted. But notice the photo in the center, it becomes pixilated at larger screen resolutions.

    The trickiest part of trying to go full screen is that it’s difficult to make the Flash wider without making it taller also, that is, to maintain the correct proportions or aspect ratio of everything on the stage. These methods are just simple scaling accomplished with html. There are also methods to dynamically scale the stage and it’s elements using Actionscript… but that’s a much more complex undertaking.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    Question two....
    All the Flash asset files need to be uploaded to the server (except the .fla). The folder/file structure must be maintained, with those assets pathed relative to the Web page that the .swf is located on.
    Pathing issues

    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
    Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT it’s physical location. So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in it’s folder should NOT work! That’s because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
    So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    Best wishes,
    Video Man

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center