Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 things! centering my movie into a HTML file and... 2

Status
Not open for further replies.

chinoka

Programmer
Jun 13, 2002
7
AR
Two things:
a) How can i center my movie into a Html file, cause when i publish my movie in HTML the movie is shown on the upper left corner!!
b)I placed some button into a movieclip in my movie. Now i need to use this buttons to go somewhere else in the movie, as an example, Scene 3, frame 2.
I've tried gotoAndPlay ("Scene 3", 2); and
_root.gotoAndPlay ("Scene 3", 2)
None of this two worked... What can i do?
Thanks in advance to anyone who answers.
 
a) You would have to put your movie in a table. Here's what I used as template, just changing dimensions (actual in pixel sizes) and the name of the file (here "your.swf"). Looks pretty centered to me both in IE and Netscape, and no right scrollbar if you don't need it!
Code:
<HTML>
<HEAD>
<TITLE>FLASH TEST!</TITLE>
</HEAD>
<BODY bgcolor=&quot;#999999&quot; MARGINHEIGHT=&quot;0&quot; MARGINWIDTH=&quot;0&quot; TOPMARGIN=&quot;0&quot; 
LEFTMARGIN=&quot;0&quot; RIGHTMARGIN=&quot;0&quot; BOTTOMMARGIN=&quot;0&quot; SCROLL=&quot;NO&quot;>
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<center>
<table width=&quot;100%&quot; height=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;7&quot;>
<tr bgcolor=&quot;#999999&quot;> 
<td align=&quot;center&quot; valign=&quot;middle&quot;></td>
<td align=&quot;center&quot; valign=&quot;middle&quot;>
<OBJECT classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
 codebase=&quot;[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,4,0&quot;[/URL] WIDTH=650 HEIGHT=400>
 <PARAM NAME=movie VALUE=&quot;your.swf&quot;> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> 
 <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> 
 <EMBED NAME=&quot;flashfile&quot; src=&quot;your.swf&quot; loop=false 
 menu=false quality=high bgcolor=#000000  WIDTH=650 HEIGHT=400 
 TYPE=&quot;application/x-shockwave-flash&quot; PLUGINSPAGE=&quot;[URL unfurl="true"]http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&quot;>[/URL]
 </EMBED>
</OBJECT>
</td>
</tr>
</table>
</BODY>
</HTML>
[code]

This is what it looks like (not my site!):

[URL unfurl="true"]http://odin.prohosting.com/~oldnew/flashtesting/template3.htm[/URL]

b)From movie clips or from external movies loaded on other levels, and once the .swf is compiled, scene names are completely useless. Label the frame you want to target with an unique label (in your case frame 2 of Scene 3) such as [b]_start3[/b] or whatever else, and use that target in your button script. Since adding _root would not work from a loaded movie on another level, add _level0 to your goto. _level0 will work from movie clips or from loaded movies on other levels:

on (press){
    _level0.gotoAndPlay(&quot;[b]start3[/b]&quot;);
}

May I be blessed by your vote! Regards,

[img]http://members.lamicro.com/~FGill/oldman3.gif[/img]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top