View Full Version : Integrating Flash and PHP


mandarinspyce
02-09-2006, 08:07 PM
I'm fairly new to both, so I'm not exactly sure how to do this.

My site is in PHP, except for the navigation, which is designed in Flash. What I want to happen is, when you click a link in the nav it loads where all the other content is- here's my site:

http://www.four-nineteen.org/etc/himtest02/index.php

and here's the code:

<html>
<head>
<title>HIM</title>
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="imagetoolbar" content="no">
<script>
document.body.style.scrollbarFaceColor="425160"
document.body.style.scrollbarArrowColor="000000"
document.body.style.scrollbarTrackColor="425160"
document.body.style.scrollbarShadowColor="425160"
document.body.style.scrollbarHighlightColor="425160"
document.body.style.scrollbar3dlightColor="425160"
document.body.style.scrollbarDarkshadowColor="425160"
</script>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="5" bottommargin="0" rightmargin="0">
<table width="737" border="0" cellpadding="0" cellspacing="0" align="center">
<TR>
<TD>
<IMG SRC="images/index_01.jpg" WIDTH=203 HEIGHT=41 ALT=""></TD>
<TD>
<IMG SRC="images/index_02.jpg" WIDTH=476 HEIGHT=41 ALT=""></TD>
<TD>
<IMG SRC="images/index_03.jpg" WIDTH=58 HEIGHT=41 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=41 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/index_04.jpg" WIDTH=203 HEIGHT=40 ALT=""></TD>
<TD>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="476" height="40" id="nav" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="images/nav/eng/nav.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="images/nav/eng/nav.swf" quality="high" bgcolor="#000000" width="476" height="40" name="nav" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></TD>
<TD>
<IMG SRC="images/index_06.jpg" WIDTH=58 HEIGHT=40 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=40 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/index_07.jpg" WIDTH=203 HEIGHT=3 ALT=""></TD>
<TD>
<IMG SRC="images/index_08.jpg" WIDTH=476 HEIGHT=3 ALT=""></TD>
<TD>
<IMG SRC="images/index_09.jpg" WIDTH=58 HEIGHT=3 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=3 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/index_10.jpg" WIDTH=203 HEIGHT=133 ALT=""></TD>
<TD background="images/index_11.jpg" WIDTH=476 HEIGHT=286 ROWSPAN=3>
<div style="width: 476px; height: 286px; overflow: auto;"><?php
$page = $_GET['page'];
if ($page) {
$page = $page . '.php';
include($page);
}
else {
include('main.php');
}
?></div></TD>
<TD ROWSPAN=2>
<IMG SRC="images/index_12.jpg" WIDTH=58 HEIGHT=153 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=133 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2>
<IMG SRC="images/index_13.jpg" WIDTH=203 HEIGHT=153 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=20 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/index_14.jpg" WIDTH=58 HEIGHT=133 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=133 ALT=""></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/index_15.jpg" WIDTH=203 HEIGHT=35 ALT=""></TD>
<TD>
<IMG SRC="images/index_16.jpg" WIDTH=476 HEIGHT=35 ALT=""></TD>
<TD>
<IMG SRC="images/index_17.jpg" WIDTH=58 HEIGHT=35 ALT=""></TD>
<TD>
<IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=35 ALT=""></TD>
</TR>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>

However, I applied a button action to 'Band', so it would load main2.php but it won't load. I keep getting this error: **Error** Scene=Scene 1, layer=Band, frame=1:Line 1: ':' expected
getURL(index.php?page=main2);

Total ActionScript Errors: 1 Reported Errors: 1

I'm not sure how to make it so that the link will actually open up.

Wermaus
02-10-2006, 12:39 AM
Since your problem is in the actionscriptpart, post it the script!
It seems that you forgot a ; or :

mandarinspyce
02-10-2006, 12:03 PM
This is my actionscript... exactly as it appears above:

getURL(index.php?page=main2);

Wermaus
02-10-2006, 12:36 PM
That means you just put your actionscript on the button without an on-handler?

on(release) {
getURL("http://www.yourURL.net");
}

That should work.You also forgot the " and " around the url.

mandarinspyce
02-10-2006, 05:26 PM
Ahh. I didn't know I had to put those in.

I'll give it a try and see what happens. Thanks :)

mandarinspyce
02-10-2006, 05:34 PM
Oh awesome... I hadn't put the 'on release' part in there. thanks for it. It worked :)

Wermaus
02-10-2006, 06:54 PM
Great :)
I'm soo happy that i could help you!