For instance when the page is loaded you may see 10 parts listed and the
button will show up 10 times also, one button next to each part listed. I am
currently using a simple image as a link to the larger view and it works fine.
The link looks like this.
largeview.php?SearchField=<?php echo $row_Recordset1['Part']; ?>
My problem is that flash doesn't read the php in this code: "<?php echo
$row_Recordset1['Part']; ?>". I need flash to read the php code so it knows
what part number to show.
Is there any other code that can be used to have Flash read the php code?
I hope I explained this properly and any help would be greatly appreciated!
I am new to flash so please spell it out for me.
Thanks
Post some links to your files, so that folks here can understand the problem
and help you solve it.
Clicking on any link in the nav bar to the left loads different parts using
PHP.
The entire page is PHP. The "More Info" image is currently just an image with
a link attached that shows a larger view of the part and more info. I just want
to use flash to create a button that will follow the link to the larger view so
nothing will load in the flash button it will only be a link.
Cheers,
Gorka
www.AquiGorka.com
value="moreinfoBtn.swf?link=largeview.php?SearchField=<?php echo
$row_Recordset1['Part']; ?>"
this should set the variable 'link' to the URL. Then in your button code in
Flash, retreive the dynamic value within the getURL method for the button:
moreInfoBtn.onRelease = function() {
getURL(link, "_self");
}
if you still would like Flash to display the part number, use String.subString
to get the last 5 characters from the value of 'link' and assign them to a
textField.
you say to put this code in the ebedding script:
value="moreinfoBtn.swf?link=largeview.php?SearchField=<?php echo
$row_Recordset1['Part']; ?>"
but I don't know if you mean in flash somewhere or in my php code somewhere?
and when I use this code in flash I just get errors.
moreInfoBtn.onRelease = function() {
getURL(link, "_self");
}
Where exactly does this code need to be placed and are you writing it exactly
like it should be or is there something else I need to be adding to it?
Thanks for your patience
@dz: do you think that the '?' will confuse Flash, act as a delimiter and
break the string into additional variables? not as associatives, though.
No, as long as it's in the embed code..
Now, what should I do with the button?
if you're refering to the button code, we'd looked into it earlier:
//-------------------Embed script---------------------
<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="550" height="400" id="moreinfoBtn" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie"
value="moreinfoBtn.swf?link=largeview.php%3FSearchField=<%3Fphp echo
$row_Recordset1['Part'];%3F>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="moreinfoBtn.swf?link=largeview.php%3FSearchField=<%3Fphp echo
$row_Recordset1['Part'];%3F>" quality="high" bgcolor="#ffffff" width="550"
height="400" name="urlvariables" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
//------------------------onRelease for button-------------------------
moreInfoBtn.onRelease = function() {
getURL(_level0.link, "_self");
};
moreInfoBtn.onRelease = function() {
getURL(link, "_self");
}
<?php
$colname_Recordset1 = "1";
if (isset($HTTP_GET_VARS['SearchField'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ?
$HTTP_GET_VARS['SearchField'] : addslashes($HTTP_GET_VARS['SearchField']);
}
mysql_select_db($database_Painless, $Painless);
$query_Recordset1 = sprintf("SELECT * FROM AllParts WHERE Catagory = '%s'",
$colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $Painless) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$colname_Recordset2 = $colname_Recordset1;
if (isset($HTTP_GET_VARS['Recordset1.Catagory'])) {
$colname_Recordset2 = (get_magic_quotes_gpc()) ?
$HTTP_GET_VARS['Recordset1.Catagory'] :
addslashes($HTTP_GET_VARS['Recordset1.Catagory']);
}
mysql_select_db($database_Painless, $Painless);
$query_Recordset2 = sprintf("SELECT * FROM tblWebCatalog WHERE CatID = %s",
$colname_Recordset2);
$Recordset2 = mysql_query($query_Recordset2, $Painless) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>
<?php
if(file_exists("include/supertop.php"))
include("include/supertop.php");?>
<head>
<script src="../Scripts/AC_RunActiveContent.js"
type="text/javascript"></script>
</head>
<body topmargin="0">
<div align="left">
<font size="6"><strong><?php echo $row_Recordset2['webcatagory'];
?></strong></font>
</div>
<p align="center">
<script type="text/javascript">
AC_FL_RunContent(
'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=7,0,19,0','width','625','height','80','src','/webcatalog/images/shopatro
nbuybanner','quality','high','pluginspage','http://www.macromedia.com/go/getflas
hplayer','movie','/webcatalog/images/shopatronbuybanner' ); //end AC code
</script><noscript><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=7,0,19,0" width="625" height="80">
<param name="movie" value="/webcatalog/images/shopatronbuybanner.swf">
<param name="quality" value="high">
<embed src="/webcatalog/images/shopatronbuybanner.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="625" height="80"></embed>
</object></noscript>
</p>
<p align="center"><font size="6"><img src="../images/largeviewimage.jpg"
width="500" height="29" id="Image1"></p>
<p><font size="4"><?php echo $row_Recordset2['WebCatPageHdr']; ?></font> </p>
<hr>
<?php do { ?>
<table width="657" border="0" cellpadding="0" cellspacing="0"
bgcolor="#000000">
<tr>
<td width="185"></td>
<td width="482"></td>
</tr>
<tr>
<td><strong><font size="4">Part# <?php echo $row_Recordset1['Part'];
?></font></strong></td>
<td></a></td>
</tr>
<tr>
<td colspan="2"> <strong><font size="4"><?php echo
$row_Recordset1['Description']; ?></font></strong></td>
</tr>
<tr>
<td align="left" valign="top"><div align="left">
<script type="text/javascript">
AC_FL_RunContent(
'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=7,0,19,0','width','50','height','25','src','/webcatalog/moreInfoBtn','qu
ality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie
','/webcatalog/moreInfoBtn' ); //end AC code
</script><noscript><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=7,0,19,0" width="50" height="25">
<param name="movie" value="/webcatalog/moreInfoBtn.swf">
<param name="quality" value="high">
<param name="FlashVars"
value="moreinfoBtn.swf?link=largeview.php?SearchField=<?php echo
$row_Recordset1['Part']; ?>" />
<embed src="/webcatalog/moreInfoBtn.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="50" height="25"></embed>
</object></noscript></td>
<td><a href="largeview.php?SearchField=<?php echo $row_Recordset1['Part'];
?>"><img src="thumbs/<?php echo $row_Recordset1['image']; ?>" alt="Part # <?php
echo $row_Recordset1['Part']; ?>" border="0"></a></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><strong><?php echo
$row_Recordset1['Information']; ?></strong></td>
</tr>
<tr>
<td height="52" colspan="2"><hr></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<p> </p>
</body>
<?php
if(file_exists("include/superbottom.php"))
include("include/superbottom.php");
?>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
?>
</head>
<body topmargin="0">
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=8,0,0,0" width="50" height="25" id="moreinfoBtn" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie"
value="moreinfoBtn.swf?link=largeview.php%3FSearchField=<%3Fphp echo
$row_Recordset1['Part'];%3F>" />
<param name="quality" value="high" />
<embed src="moreinfoBtn.swf?link=largeview.php%3FSearchField=<%3Fphp echo
$row_Recordset1['Part'];%3F>" quality="high" width="50" height="25"
name="moreinfoBtn" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
I have the button code set to the on release just as you said.
I must be doing something wrong or maybe I'm just not understanding you.
but now the link goes no where.
Here are the links
http://www.painlessperformance.com/webcatalog/flashimage/button2.gif
http://www.painlessperformance.com/webcatalog/flashimage/button3.gif
When I click the button it goes to
http://www.painlessperformance.com/webcatalog/undefined
</head>
<body topmargin="0">
<param name="movie" value="moreinfoBtn.swf" />
<param name="FlashVars" value="link=<?php echo
(urlencode($row_Recordset1['Part']));?>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="moreinfoBtn.swf" FlashVars="link=<?php echo
(urlencode($row_Recordset1['Part']));?>" quality="high" bgcolor="#ffffff"