Master Pages + Flash Header

I have a master page....shell.master...and many child pages.  I would like to place a swf file within the header of the page....and have a separate text file that allows me to control the text being rendered.  My program works fine..doing all of the above until I try and use it in a master page.  Here are some snippits...

Here is my javascript file.  I am including this right after the form tag of the master page.
<!-- Begin

// NOTE: If you use a ' add a slash before it like this \'


var flashcolor            = "000000"            // FLASH BACKGROUND COLOR
var color            = "000000"            // HEADER BACKGROUND COLOR
var flashheight            = "75"                  // HEIGHT OF THE FLASH (IN PIXELS)
var flashwidth            = "600"                  // WIDTH OF THE FLASH (IN PIXELS)



// COPYRIGHT 2008 © Convergent Media Systems
// Unauthorized use or sale of this script is strictly prohibited by law

// YOU DO NOT NEED TO EDIT BELOW THIS LINE

// START FLASH HEADER

document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="100%" BGCOLOR="#'+color+'"><tr><td ALIGN="LEFT">');
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'" id="logo" ALIGN="">');
document.write('<PARAM NAME=movie VALUE="logo.swf">');
document.write('<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#'+flashcolor+'>');
document.write('<EMBED src="logo.swf" quality=high bgcolor=#'+flashcolor+'  WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'" NAME="logo" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write('</EMBED>');
document.write('</OBJECT><br>');
document.write('</td></tr></table>');
//  End -->


Then I have an swf file and a .txt file in the same directory.  The txt file just has some variables that store text.  The swf file knows to go look in the text file for this informatino.  But it will not work..Please help.
LVL 11
Robb HillSenior .Net DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
When you take a working page and put it within the contents of a master page, the control reference changes to include the new naming container.

Example
TextBox1 is generated as:
<input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_TextBox1" />

I am not sure if this is your problem, but it is the usual problem with master pages.

Bob
0
Robb HillSenior .Net DeveloperAuthor Commented:
i dont think there are any controls here..for a container to be the issue..the flashfile itself is nothing more than a background with text changing over time.
0
Bob LearnedCommented:
When the page is not part of a master control, how does it get rendered in the browser?

Bob
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Robb HillSenior .Net DeveloperAuthor Commented:
the page has an html page called index.html...this page calles the JS file which calls the flash file...and from what I understand..the text file that contains the text that the flash file uses only need be in the same directory as the flash file.
0
Bob LearnedCommented:
Is the content page in a different directory from the master page?

Bob
0
Robb HillSenior .Net DeveloperAuthor Commented:
no...all pages are in the same directory except the js files and the flash files
0
Bob LearnedCommented:
Did you look for any subtle differences between the way the page is rendered when stand-alone versus when it references a master page?

Are you able to debug/step through the code?  Are you getting any Javascript errors?

Bob
0
Robb HillSenior .Net DeveloperAuthor Commented:
The page will render when everything is in the root of the masterpage
0
Bob LearnedCommented:
I don't understand what you mean by "root".

Bob
0
Robb HillSenior .Net DeveloperAuthor Commented:
the same directory from which all my aspx pages and master pages are located
0
Bob LearnedCommented:
There are some crucial details missing here.  How are you referencing Javascript?  I can only see what you show me, and I haven't seen a viable reason for your problem yet.

Bob
0
Robb HillSenior .Net DeveloperAuthor Commented:
Essentially to get this to work I am having to copy my flash file and my text file that goes with it in every directory that I want to see this flash file.  It will not work when there are subdirectorys in my  web heirarchy unless I do this.  This seems like an inefficient way to have to build my website.
0
Robb HillSenior .Net DeveloperAuthor Commented:
Well i did come up with the solution.  When flash/image and other files are located in subfolders a
url=!~/   must be used  instead of a src=/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
robastaCommented:
FYI:

There is a server control that adds your SWF OBJECT:

Download it Here: http://www.junasoftware.com/servercontrols/swfobject.net/download.aspx

You can use the '~' tilde to use relative paths to the site root and it will work on a master page, even if content pages are in different directories, you can use it like this:

Steps:
1. download the dll
2. add a reference to the dll in your project
3. use the following code:
<%@ Register Assembly="SWFObject.Net" Namespace="Juna.Web.UI" TagPrefix="SWF" %>
.
.
.
<SWF:SWFObject ID="myMovie" runat="server" Height="55px" Width="900px" WMode="Transparent" RequiredFlashVersion="9.0" FlashUrl="~/images/menu.swf" >
                        </SWF:SWFObject>

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.