LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




ReplyREPLY THREAD
 
Thread Tools Display Modes
  #1  
Old 10-03-2002, 09:53 PM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
How do I vertically center my flash animation?

Hello!
Okay, post number 1 - and yes, a total beginner!

Hears my probably very easy question :)

How do vertically center my flash animation?

I'm using some javascript to display a welcome message dependant on the users local clock. Below is some of the script.

today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";

document.write ;if((today.getHours() >=0) && (today.getHours() <=11)){
document.write(('<center><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=750 HEIGHT=390><PARAM NAME=movie VALUE="morning.swf"><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="morningnosound2b.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=750 HEIGHT=390 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></center>'))
}

You can see that I have horizonatally centered the flash by center tags but how do I make it vertically center too?

Please help

Thanks
sanc :)
Reply With Quote
  #2  
Old 10-04-2002, 08:34 AM
swoop's Avatar
swoop swoop is offline

swoopy HyperModerator
 
Join Date: Jun 2001
Location: England
Posts: 1,562
Rep Power: 14
swoop is on a distinguished road
You need to place the <OBJECT> Tag within a small HTML table:
PHP Code:

<TABLE WIDTH='100%' HEIGHT='100%' BORDER="0" CELLSPACING="0" CELLPADDING="0">

    <
TR>
        <
TD ALIGN='CENTER' VALIGN='MIDDLE'>
                <
object>
                </
object>
        </
TD>
    </
TR>
</
TABLE
that should do it.

swoop
Reply With Quote
  #3  
Old 10-07-2002, 11:28 AM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
I've been playing around with my object within the table but for some reason it throws up an error

When the table is added into the code it now looks like this:
(sorry for the large amount of code)

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#C4C4C5">
<script language="JavaScript">

today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";

document.write ;if((today.getHours() >=0) && (today.getHours() <=11)){
document.write(('<TABLE WIDTH=100% HEIGHT=100% BORDER="0" CELLSPACING="0" CELLPADDING="0">'
<TR><TD ALIGN='CENTER' VALIGN='MIDDLE'>
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=750 HEIGHT=390><PARAM NAME=movie VALUE="morning.swf"><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="morningnosound2b.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=750 HEIGHT=390 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></TD></TR>'))
}
if((today.getHours() >=12) && (today.getHours() <=16)){
document.write(('<TABLE WIDTH=100% HEIGHT=100% BORDER="0" CELLSPACING="0" CELLPADDING="0">'
<TR><TD ALIGN='CENTER' VALIGN='MIDDLE'>
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=750 HEIGHT=390><PARAM NAME=movie VALUE="afternoon.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="afternoonnosound2b.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=750 HEIGHT=390 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></TD></TR>'))
}
if((today.getHours() >=17) && (today.getHours() <=23)){
document.write(('<TABLE WIDTH=100% HEIGHT=100% BORDER="0" CELLSPACING="0" CELLPADDING="0">'
<TR><TD ALIGN='CENTER' VALIGN='MIDDLE'>
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=750 HEIGHT=390><PARAM NAME=movie VALUE="evening.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="eveningnosound2b.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=750 HEIGHT=390 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></TD></TR>'))
}
</script>

</body>
</html>

Can anyone help me further please

Thanks again
sanc
Reply With Quote
  #4  
Old 10-07-2002, 12:31 PM
flyingbuddha flyingbuddha is offline
Registered User
 
Join Date: Nov 2000
Location: Redditch, UK
Posts: 33
Rep Power: 0
flyingbuddha is on a distinguished road
Rolleyes Bad Javascript

Hi,

Your problem probably lies with the Javascript you're using.
You are using a document.write() call and you have new-lines in there.

i.e.

1,2,3

is different to...

1,
2,
3

Javascript throws up an error when there is no semi-colon at the end. A way to get around this is the following...

document.write( "<TABLE>"
+ "</TABLE>" );

The '+' symbol allows you to continue your tags and strings over to a new line.

Let me know if I need to explain it clearer.
__________________
http://www.mikeholloway.co.uk
Reply With Quote
  #5  
Old 10-07-2002, 12:32 PM
h88 h88 is offline
Registered User
 
Join Date: Sep 2002
Posts: 127
Rep Power: 0
h88 is on a distinguished road
How to center the movie
To center a movie on your page, you will need to edit the HTML code as follows:

1 Open your HTML page in an HTML editor such as Dreamweaver.
2 Locate your opening object tag for the Flash movie <Object>.
3 Before the <Object> tag insert a center tag as shown below:



4 Locate the closing object tag for the same Flash movie </Object>
5 After the </Object> tag insert a close center tag as shown below:

6 Save your HTML file and preview the results in a web browser.

Note: You can accomplish the same effect by placing the Flash movie in a Layer by using the "<div align="center">" and "</div>" tags or by using a table using the "<table align="center"><tr><td>" and "</td></tr></table>".
Reply With Quote
  #6  
Old 10-07-2002, 01:10 PM
theUKdude's Avatar
theUKdude theUKdude is offline

Hyper Dudey Moderator
 
Join Date: Mar 2001
Location: Bath, UK
Posts: 1,421
Rep Power: 14
theUKdude is on a distinguished road
@h88: Please read the question before posting replies. sanc wanted to know how to centre vertically, not horizontally.

@sanc: What is the error? Also, you seem to have forgotten the closing table tag.
__________________
theUKdude


.................................................. ..........................
Education: That which discloses to the wise and disguises from the foolish
their lack of understanding. -Ambrose Bierce, writer (1842-1914)
Reply With Quote
  #7  
Old 10-07-2002, 02:43 PM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 17
Gargoyle is on a distinguished road
what about defining the table, give the (TD) cell an ID and then using innerHTML for accessing it?
would b much less code than writing 3 diffrent tables with just diffrent content.
but much more cool would b a reading the clock and changing the documents location according to it or let flash decide which part of it 3 in 1 movie to play.
just my 2 cents

another nice thingy perhaps could b setting the src of the swf by accessing the object and embed objects.
__________________
---
if TCPA is the answer,
how stupid then was the question?

There is a diffrence in knowing the path and walking the path.

if u found this thread usefull, then rate it.
this way we all save a lot of time, searching for the good ones.

Reply With Quote
  #8  
Old 10-07-2002, 03:01 PM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
Quote:
Originally posted by theUKdude 
@sanc: What is the error? Also, you seem to have forgotten the closing table tag.
In its present state the error is a syntax error on line 19 char 5.

But I think this is what flyingbuddha is talking about....

theUKdude - Yep you're write, I've now added </table> to each table

Quote:
Originally posted by flyingbuddha
Javascript throws up an error when there is no semi-colon at the end. A way to get around this is the following...

document.write( "<TABLE>"
+ "</TABLE>" );

The '+' symbol allows you to continue your tags and strings over to a new line.

Let me know if I need to explain it clearer.
Yes please! I'll have a play with it but would like a bit more help

Thanks all
sanc
Reply With Quote
  #9  
Old 10-07-2002, 03:05 PM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
Quote:
Originally posted by sanc 


In its present state the error is a syntax error on line 19 char 5.

But I think this is what flyingbuddha is talking about....

theUKdude - Yep you're write, I've now added </table> to each table



Yes please! I'll have a play with it but would like a bit more help

Thanks all
sanc
EDIT
Also, the my second posting with the code, is the entire code - hence the extra lines

Reply With Quote
  #10  
Old 10-08-2002, 01:23 PM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
Hey guys

After a whole afternoon and evening I've still not got anywhere (plus I now look like this --> )

I've come to the conclusion that this task is taking too much of my time up and so I've decided that I'm quite happy to pay for someone to do this for me

I know that its probably not to difficult to do - for people who know - but I don't, so if anybody has got some spare time and would like to do this small job for me then please send me a quote.

Thanks again everyone
sanc

ps. I live in the UK!
pps. ..... hope I'm allowed to put this kind of post on your forum - if not then please delete it! - thanks

Below is the entire script, before I started to hack it to pieces

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#C0C0C0">
<script language="JavaScript">

today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";

document.write ;if((today.getHours() >=0) && (today.getHours() <=11)){
document.write(('<center><OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=748 HEIGHT=420><PARAM NAME=movie VALUE="morning3_info.swf"><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="morning3_info.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></center>'))
}
if((today.getHours() >=12) && (today.getHours() <=16)){
document.write(('<center><OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=748 HEIGHT=420><PARAM NAME=movie VALUE="afternoon3_info.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="afternoon3_info.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> </OBJECT> </center>'))
}
if((today.getHours() >=17) && (today.getHours() <=23)){
document.write(('<center><OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=748 HEIGHT=420><PARAM NAME=movie VALUE="evening3_info.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="evening3_info.swf" loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> </OBJECT> </center>'))
}
</script>

</body>
</html>


thanks
Reply With Quote
  #11  
Old 10-09-2002, 06:05 PM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
don't all rush at once !
Reply With Quote
  #12  
Old 10-09-2002, 10:09 PM
flyingbuddha flyingbuddha is offline
Registered User
 
Join Date: Nov 2000
Location: Redditch, UK
Posts: 33
Rep Power: 0
flyingbuddha is on a distinguished road
Rejoice I need the swf's.

Hi,

Send me the .swfs and I'll sort it for free.

Regards.
__________________
http://www.mikeholloway.co.uk
Reply With Quote
  #13  
Old 10-10-2002, 05:14 PM
flyingbuddha flyingbuddha is offline
Registered User
 
Join Date: Nov 2000
Location: Redditch, UK
Posts: 33
Rep Power: 0
flyingbuddha is on a distinguished road
Big Grin Sorted

Hi Sanc,

Here's your solution, I will also email it you, but thought that I would put it here incase anyone comes across the same trouble as you in the future.

Regards.

Code:
<html> 
<head> 
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
</head> 

<body bgcolor="#C0C0C0"> 
<script language="JavaScript"> 
<!--
today = new Date();
if(today.getMinutes() < 10){ 
	pad = "0";
}
else{
	pad = "";
}


if((today.getHours() >=0) && (today.getHours() <=11)){ 
	document.write(	"<center>"
			+ "<OBJECT classid='clsid27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=748 HEIGHT=420>"
			+ "<PARAM NAME=movie VALUE='morning3.swf'><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>"
			+ "<EMBED src='morning3.swf' loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"
			+ "</OBJECT>"
			+ "</center>");
} 
if((today.getHours() >=12) && (today.getHours() <=16)){ 
	document.write(	"<center>"
			+ "<OBJECT classid='clsid27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=748 HEIGHT=420>"
			+ "<PARAM NAME=movie VALUE='afternoon3.swf'><PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>"
			+ "<EMBED src='afternoon3.swf' loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"
			+ "</OBJECT>"
			+ "</center>"); 
} 
if((today.getHours() >=17) && (today.getHours() <=23)){ 
	document.write(	"<center>"
			+ "<OBJECT classid='clsid27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=748 HEIGHT=420>"
			+ "<PARAM NAME=movie VALUE='evening3.swf'> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>"
			+ "<EMBED src='evening3.swf' loop=false menu=false quality=high bgcolor=#FFFFFF WIDTH=748 HEIGHT=420 TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"
			+ "</OBJECT>"
			+ "</center>"); 
}
-->
</script> 

</body> 
</html>
__________________
http://www.mikeholloway.co.uk
Reply With Quote
  #14  
Old 10-10-2002, 09:19 PM
flyingbuddha flyingbuddha is offline
Registered User
 
Join Date: Nov 2000
Location: Redditch, UK
Posts: 33
Rep Power: 0
flyingbuddha is on a distinguished road
Rolleyes ...and centering vertically

Hi Sanc,

I know you emailed, but again, best to display to everyone.
To centre vertically, you must use a nested table. Heres how...

Code:
<HTML>
<BODY>

<!-- ==============================================
#  The top table makes a frame 100% wide and 100% tall
# Inside this table we have a cell, this is where we put the body of the work
# in your case, you want the flash movie to be vertically aligned to the
# middle.
============================================== -->
<TABLE BORDER = "0" CELLSPACING = "0" CELLPADDING = "0" WIDTH = "100%" HEIGHT = "100%" ALIGN = "Center" BGCOLOR = "#000000">
 <TR>
  <TD>
	<!-- ==============================================
	#  This second table is the container. We do not denote its height because
	# we want it to be able to move up and down freely as the window changes
	# dimensions. However, notice the new 'vALIGN' tag, we use this to tell
	# the cell to centre whatevers inside. We can set the width to "100%" so that
	# whatever is inside can use the maximum width of the screen.
	============================================== -->
	<TABLE BORDER = "0" CELLSPACING = "0" CELLPADDING = "0" WIDTH = "60%" ALIGN = "Center" vALIGN = "Center" BGCOLOR = "#FFFFFF">
	 <TR>
	  <TD ALIGN = "Center">
		Anything here will be centered vertically and horizontally, this could be your flash movies.
	  </TD>
	 </TR>
	</TABLE>
  </TD>
 </TR>
</TABLE>

</HTML>
</BODY>
__________________
http://www.mikeholloway.co.uk
Reply With Quote
  #15  
Old 10-11-2002, 09:11 AM
sanc sanc is offline
Registered User
 
Join Date: Oct 2002
Posts: 7
Rep Power: 0
sanc is on a distinguished road
Thanks flyingbuddha
I'll have a play with both pieces of code you kindly produced
I'll let you know how it goes
Thanks again
sanc
Reply With Quote
ReplyREPLY THREAD


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aligning the Flash animation Dajo Flash CS3 / Flash 9 0 01-29-2008 12:20 AM
www.FlashExposer.com - Flash Upload Center FlashExposer Site Check 2 05-24-2006 04:50 AM
html layers + resizable flash animation OverDead Newbies 2 02-15-2004 09:21 PM
questions about Flash animation between Actionscript and dragging manually xCanadian Design and Animation 9 06-17-2003 10:00 PM
The unfounded Flash Animation Guru FlashMove Cool Sites 4 08-25-2001 08:59 AM




All times are GMT. The time now is 05:32 AM.