PDA

View Full Version : Include Flash in a PHP?


MatthewAnders
08-04-2009, 03:58 PM
Hi all,

Im trying to get my navigation and header bars to get written by PHP.

Basically its this.

the header file and the navbar are flash, and i am trying to get it so that when i make successive pages I can just include('pagetop.php') inside the pagetop.php would be code that writes the header(flash), navbar(flash), and the top of the content section(standard CSS/Image background).

The problem I am having is when i try to encapsulate the Flash Links given to me by Flash 8.
I am probably going about this the wrong way, but as a test I tried making navbar.php.<?php print <<<HERE<!-- total width of this is going to be varied --><!--urls used in the movie-->
<a href="http://www.mattanders.com/index.php"></a>
<a href="http://www.mattanders.com/gallery.php"></a>
<a href="http://www.mattanders.com/about_me.php"></a>
<a href="http://www.mattanders.com/contact.php"></a>
<a href="http://www.mattanders.com/port_res.php"></a>
<a href="http://www.mattanders.com/games.php"></a>
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<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="900" height="60" id="navbar" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="navbar.swf" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="assets/flash/navbar.swf" loop="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="900" height="60" name="navbar" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<!--For flash impared, this will be a horizontal nav bar, using images and state changes
<ul class="nav_list">
<li class="hnav"></li>
<li class="hnav"></li>
<li class="hnav"></li>
<li class="hnav"></li>
<li class="hnav"></li>
</ul>-->HERE;?>

What i'm thinking is wrong here is that i have to escape all the quotation marks and get rid of as much of the extraneous as possible. Am i thinking correctly?

Thanks,
Matty

scoutt
08-18-2009, 08:50 PM
HERE;?>

has to be the last line and all the way to the left of the document. Other than tha tit should work

Hanratty
09-04-2009, 04:19 AM
Hmm it might be nothing, but it occurred to me that the problem could be path related.

If the php file you include is in a folder different from the file it is included in, and you use relative paths to get the flash movie you might experience this..

Example

Myfile.php is in the root folder

Root/Myfile.php

It includes the Flash.php in the subfolder Flash

Root/Flash/Flash.php

The Flash.php opens the Flash.swf by using movie=Flash.swf etc.
Root/Flash/Flash.swf

The result is that the final combination of Myfile.php and Flash.php looks for the flash.swf in the Root folder and not Root/Flash/

scoutt
09-04-2009, 07:37 AM
we will never know unless the original poster tells us if it is fixed or not.