- First, you need to make your flash movie with each of the menu items (thumbnails?) on the main timeline. For each of these thumbnails, click on it, hit F8 and assign a name to it as a button. The name is completely arbitrary at this point so name it something that will make it easy for you to distinguish. It sounds like you want to make each picture, when clicked, to pop up centered in a box that will be of a certain color, style etc… without having to code a seperate HTML page for each. In the interest of time and server space, this is a very good idea. This can be accomplished via a very small PHP script. If your server does not support PHP, you are screwed. Throw away your computer and hang yourself with your ethernet (no php no broadband?) or dial up cable. As for the flash movie… Assign this code to each of the thumbnail buttons. Beware: There may be errors in the code syntax simply b/c I’m writing this outright and in the reply box.
1a: Here is the first method using the “_GET” method and hardcoding the variable names and values into the URL so there are absolutely no ****ups. There are several things to take note of here. You need to modify for each button, the URL to the *.php file called picture.php here and the path to that file. You also need to replace ‘img1’ with the filename of the first image and replace the word red with the color of your choice. To do this in a more graphical way… use the second way.
[AS]
on (release) {
getUrl(“http://www.yourserver.com/gfxFolder/picture.php?img=img1&color=red&title=titleOfPicture”, “_blank”)
}
[/AS]
1b. This method uses the “_POST” method for which you will need to do something slightly different. Here you can use the flash interface to modify the code easily. Just click on the button, add the following actions… On -> release, setVar (photo, img1.jpg), setVar (bgcolor, red) and getURL(“http://www.yourserver/path/to/picture.php","_blank","POST”). For each of these actions you will be able to easily edit the options to add the specified parameters. ie… on getURL, in the box, enter the URL, then enter blank for the window, then click ‘send using POST’ for the variables field.
[AS]
on (release) {
photo = img1;
bgcolor = red;
title = Title of Picture;
getUrl(“http://www.yourserver.com/gfxFolder/picture.php”, “_blank”, “POST”)
}
[/AS]
For the PHP file, you should include the file in the directory with the images.
- Now you have set up your movie to present the variables to a PHP script that will process the data and output an HTML file that will show the correct picture with the correct color bg, etc…
IMPORTANT - If you intend to use the POST method, you need to change the first two lines of code. Simply replace the word GET with the word POST. That simple. Also, I’m assuming your files are jpegs, if not you should replace ‘.jpg’ with the applicable extension.
<?php
/*
PHP file to process data from flash movie and output HTML to
display a said image with a said bgcolor. Should be saved
as picture.php in the directory with the images. -- > awligon
*/
$img = $_GET['img'];
$bgcolor = $_GET['bgcolor'];
$title = $_GET['title'];
$image .= ".jpg";
if(empty($img)){
echo "Error: Please close and return to movie.";
break;
}
echo "<br>
<body bgcolor=$bgcolor>
<font face=verdana size=1>
<table align=center>
<tr><th>$title</th></tr>
<tr><td><img src=$img border=0></img></td></tr>
</table></font></body>";
?>
And that should do it for ya. ****, I should be an insta-mod for this. 