Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to use index.html to position flash content

Posted on 2008-06-22
5
Medium Priority
?
1,021 Views
Last Modified: 2010-04-21
Hi,
I am trying to figure out what code i need to insert, and where, into my index.html file that is loading my Flash movie - so that the Flash movie will align lower than the top edge by about 20 pixels or so instead of sitting right at the top.

Is this possible?

I've attached the current index.html code in the case that helps.

Thanks in advance for any help!



<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BPOpen</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#282b2b">
<center>
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', '950',
			'height', '650',
			'src', 'BPOpen',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'exactfit',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'BPOpen',
			'bgcolor', '#282b2b',
			'name', 'BPOpen',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'BPOpen',
			'salign', 'lt'
			); //end AC code
	}
</script>
<noscript>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="950" height="650" id="BPOpen" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="BPOpen.swf" /><param name="quality" value="high" /><param name="scale" value="exactfit" /><param name="salign" value="lt" /><param name="bgcolor" value="#282b2b" />	<embed src="BPOpen.swf" quality="high" scale="exactfit" salign="lt" bgcolor="#282b2b" width="950" height="650" name="BPOpen" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
</noscript><center>
</body>
</html>

Open in new window

0
Comment
Question by:HoolaDesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Sh4d1
ID: 21844690
You must set style preference for body. For example:

<body bgcolor="#282b2b" style="margin:0;padding:0;">
0
 
LVL 35

Expert Comment

by:torimar
ID: 21844710
If you want it quick and dirty, just insert a couple of linebreaks <BR /> into the code before calling your flash object.

If you want it nice and tidy, use the "margin-top" CSS command like in the code I appended.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BPOpen</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<style type="text/css">
.mt20 {margin-top: 20px;}
</style>
</head>
<body bgcolor="#282b2b">
<center>
<div class="mt20">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
        if (AC_FL_RunContent == 0) {
                alert("This page requires AC_RunActiveContent.js.");
        } else {
                AC_FL_RunContent(
                        'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                        'width', '950',
                        'height', '650',
                        'src', 'BPOpen',
                        'quality', 'high',
                        'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                        'align', 'middle',
                        'play', 'true',
                        'loop', 'true',
                        'scale', 'exactfit',
                        'wmode', 'window',
                        'devicefont', 'false',
                        'id', 'BPOpen',
                        'bgcolor', '#282b2b',
                        'name', 'BPOpen',
                        'menu', 'true',
                        'allowFullScreen', 'false',
                        'allowScriptAccess','sameDomain',
                        'movie', 'BPOpen',
                        'salign', 'lt'
                        ); //end AC code
        }
</script>
<noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="950" height="650" id="BPOpen" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="BPOpen.swf" /><param name="quality" value="high" /><param name="scale" value="exactfit" /><param name="salign" value="lt" /><param name="bgcolor" value="#282b2b" /> <embed src="BPOpen.swf" quality="high" scale="exactfit" salign="lt" bgcolor="#282b2b" width="950" height="650" name="BPOpen" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
</noscript>
</div>
</center>
</body>
</html>

Open in new window

0
 

Author Comment

by:HoolaDesign
ID: 21848075
Hi,
Thanks to both of you for answering.  i however had issues with all but just adding the line breaks.

First Sh4d1 -
when i enter that code, just as you have it - the site no longer loads, but this appears instead (i tried removing your code a couple of times to make sure that was the issue):

if (AC_FL_RunContent == 0) { alert("This page requires AC_RunActiveContent.js."); } else { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0', 'width', '950', 'height', '650', 'src', 'BPOpen', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'exactfit', 'wmode', 'window', 'devicefont', 'false', 'id', 'BPOpen', 'bgcolor', '#282b2b', 'name', 'BPOpen', 'menu', 'true', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', 'BPOpen', 'salign', 'lt' ); //end AC code }

If there's a reason for this i'd love to know!

---

And torimar,
I tried your second solution, but nothing changes.  seems super simple enough but alas, it still aligns at right at the top.

Used the line breaks and all seems to be fine.



0
 
LVL 35

Accepted Solution

by:
torimar earned 1000 total points
ID: 21850491
Strange indeed. My second solution works fine for me in both Opera and Firefox.
Have you copy/pasted my code completely? Or only taken bits? Then you might have overlooked some parts. Maybe emptying your browser cache might help, too.

Anyway, here is another, very easy CSS solution:

<style type="text/css">
embed {
margin-top: 20px;}
</style>

Just copy this into the HEAD tag of your file. No further editing is required.
NOTE: This will change the positioning of *all* embedded elements on the page, so it is not recommended for pages with more than one flash movie.
0
 

Author Closing Comment

by:HoolaDesign
ID: 31469644
thanks so much!  that last bit of code works perfectly.
0

Featured Post

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question