Results 1 to 6 of 6

Thread: Percentage Problem with swf file

  1. #1
    Join Date
    Jul 2010

    Percentage Problem with swf file

    If I use the width and height pixel (i.e. width = 300 px, height =200px), the image shows up on the page. However, when I subtitute the image width and height with 100% as the code below, the image doesn't show up. Please tell me how to fix the percentage to make the image displays. (I need to display a lot of images, so I want to use the % instead of the actual image pixel). Thank you very much.

     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
                                        id="graphic" width="100%" height="100%" />
                                        <param name="movie" value="myImage.swf" />
                                        <param name="allowScriptAccess" value="sameDomain" />
                                        <param name="quality" value="autohigh" />
                                        <param name="wmode" value="transparent" />              
    Last edited by TinaLe; 09-13-2010 at 10:51 PM.

  2. #2
    Join Date
    Feb 2008
    NW Washington State
    First, you need to be sure that your "container" <div> for the Flash does not have a set width and height in your CSS. Then use the "scale" param for the Flash. There are 4 scale params explained in this previous post. View the examples and look at the source code to choose which param is best for you.

    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.


    "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.


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


    "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.


    "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

  3. #3
    Join Date
    Sep 2010
    I have a problem as well with %

    I have a div container for my flash movie as follow:

    #flash {
    width: 70%;
    height: 36%;
    padding: 0px;
    border: thin solid #000000;
    <div id="flash">
    		<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="first-entry"> 
    		<param name="allowScriptAccess" value="sameDomain" /> 
    		<param name="movie" value="first-entry.swf" />
    		<param name="quality" value="high" />
    		<param name="bgcolor" value="#ffffff" />
    		<embed src="first-entry.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="first-entry" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> 

    I am using % in order to prevent the flash from overlapping beyond its div container when the user zooms in using ctrl+. If I use pixels, the flash would overlap its div when the user zooms in the page.

    The code above works fine with Chrome but not with IE and Firefox. In IE and in Firefox, the flash is centered in the middle of the div (white space on its left and on its right) and it is smaller than it should be in width with no white space. This is not the case in Chrome.

    How can I fix this?


  4. #4
    Join Date
    Feb 2008
    NW Washington State
    I'm not sure I undserstand what you mean by
    prevent the flash from overlapping beyond its div container
    I just tested a number of Flash elements on several sites and in several browsers, none of which overlap their containing <div> when using ctrl+.
    so I would have to disagree that
    use pixels, the flash would overlap its div when the user zooms in the page.
    I normally use a fixed pixel w/h and just don't see that happening.
    If you are getting a white space on the sides of <div id="flash'> which changes shape as you ctrl+, it's most likely because the Flash element is maintaining it's aspect ratio, and depending on the amount of zoom, may display more or less of that extra white space.
    Post a link if possible.
    Best wishes,
    Eye for Video

  5. #5
    Join Date
    Sep 2010
    If you notice the <div> has a border which I set on purpose for debugging. The flash is inside the div and when I ctrl+ (with pixels) the flash starts increasing in size from the right side and it becomes bigger than its div, and therefore it goes above any other html element placed at its right side. This does not happen when I use &#37;. But % is causing problems in Firefox and IE.

    I will try to post a link as soon as possible, but I hope you can help me in the meanwhile.

  6. #6
    Join Date
    Feb 2008
    NW Washington State
    OK, now I can see the problem... when using a percent in the #flash and pixels in the params, it does overflow. But testing in FF3.5, IE8, Chrome, and Safari, there is no overlap using 100% in the <object> params. On my browsers the Flash stays contained in the border...... hmmmm..??
    Setting your #flash width as a percent and then expecting the Flash to stop expanding when zoomed is a problem.
    One solution is to add a flash holder div to contain the flash div:
    #flash_holder {
    width: 70%;
    height: 36%;
    padding: 0px;
    overflow auto will contain the Flash and add scroll bar if needed.
    Oh, I also removed the w/h from #flash and just used pixels in the param.
    padding: 0px;
    border: thin solid #000000;
    None of the solutions I could come up with perfectly scaled the Flash in relation to the Web page, you either get scroll bars or extra white space. That's because with each zoom step, the Flash is expanding at a slightly different rate than the Web page in order to maintain it's aspect ratio. You could also try adding in the scale param scale="noborder" or exactfit but you may get distortion as you zoom in/out.
    Of course simply removing
    width: 70%;
    would solve all the problems.
    Best wishes,
    Eye for Video

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09996 seconds
  • Memory Usage 2,908KB
  • Queries Executed 15 (?)
More Information
Template Usage (34):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates