Flash Image Enhancer Support Product Page

This topic was archived

Tom Muck's Horizontal Looper 2

Asked 14 May 2009 07:53:49
1
has this question
14 May 2009 07:53:49 Troy Julius posted:
Tom Muck's Horizontal Looper 2 is a great extension. www.tom-muck.com/

I am wanting to use this extension with "Flash Image Enhancer" however only the first records shows correctly, the 2nd record after the 1st record does not show correctly, for example the first record shows a reflection while all the remaining records are appearing normal without any effects from the Flash Image Enhancer. Any ideas, please help.

Below is a chuck of the code, also I've included the link to Tom-Muck's website.
<
%startrw = 0
endrw = HLooper1__index
numberColumns = 5
numrows = 3
while((numrows <> 0) AND (Not Recordset1.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%>
<tr align="center" valign="top">


<% (Recordset1.Fields.Item("my_field".Value)%>


<
%startrw = startrw + 1
Recordset1.MoveNext()
Wend
%>
</tr>
<
%numrows=numrows-1
Wend
%>
<
%While ((startrw <= endrw) AND (Not Recordset1.EOF))
%>

More about this extention: The Horizontal/Vertical Looper is so-called because it repeats your data from your database horizontally or vertically, using a combination of rows and columns. It acts in a similar fashion to the standard Repeat Region that is supplied with Dreamweaver. The server behavior will build a table around your data and display the data in rows and columns.

Please reply,
Hope you can help.

Replies

Replied 14 May 2009 20:13:43
14 May 2009 20:13:43 christian verdirame replied:
Hi Troy,
you have to replace in your page's flash image code with:


<span id="dv_<%= (Recordset1.Fields.Item("my_field".Value)%>



and


flashImage1.write("dv_<%=(Recordset1.Fields.Item("my_field".Value)%>");



Bye

Edited by - christian verdirame on 14 May 2009  20:28:38
Replied 18 May 2009 20:39:03
18 May 2009 20:39:03 Troy Julius replied:
Hey, you are awesome, I will give this a try, thank you so much!
Replied 18 May 2009 22:11:54
18 May 2009 22:11:54 Troy Julius replied:
Would you be able to decipher and take a look at my actual code (which is working) and be able to show me where I would add your code, I think we are close to an answer!

This is my code before the Flash Image Enhancer:

 
 <td valign="top" nowrap bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="style174"><div align="center"><a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>">[img]<% if Trim(Recordset1.Fields.Item("Photo").Value) = "" then Response.Write "photos\no_photo.jpg" else Response.Write Recordset1.Fields.Item("Photo").Value %>" alt="<%=(Recordset1.Fields.Item("Your_Name").Value)%>" width="145" border="0"></a><a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>"></a><a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>"></a><a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>"></a> </div>                  </tr>
      <tr>
        <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="style174"><table width="95%" border="0" align="center">
          <tr>
            <td width="196" valign="top" bordercolor="<% if Trim(Recordset1.Fields.Item("Photo").Value) = "" then Response.Write "photos\no_photo.jpg" else Response.Write Recordset1.Fields.Item("Photo").Value %>"><div align="left">




Here is the code with the Flash Image Enhancer added:

  
      <td valign="top" nowrap bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="style174"><div align="center"><span id="dv_flashImage25">[img]<% if Trim(Recordset1.Fields.Item("Photo").Value) = "" then Response.Write "photos\no_photo.jpg" else Response.Write Recordset1.Fields.Item("Photo").Value %>" width="145" height="undefined" /></span>
<script type="text/javascript">
  // <![CDATA[
  var flashImage25 = new dmxFlashImageEnhancer("<% if Trim(Recordset1.Fields.Item("Photo").Value) = "" then Response.Write "photos\no_photo.jpg" else Response.Write Recordset1.Fields.Item("Photo").Value %>", "fl_flashImage25", "145", Math.round(1.15*parseFloat("undefined"),0));
  flashImage25.setScriptLibrary("../ScriptLibrary");
  flashImage25.addVariable("onClickUrl", "details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>");
  flashImage25.addVariable("onClickTarget", "_self");
  flashImage25.addVariable("cornerRadius", "10");
  flashImage25.addVariable("corners", "tl,tr,bl,br");
  flashImage25.addVariable("hasBorder", "true");
  flashImage25.addVariable("borderSize", "3");
  flashImage25.addVariable("borderColor", "0xFFFFFF");
  flashImage25.addVariable("hasReflection", "true");
  flashImage25.addVariable("reflectStrength", "50");
  flashImage25.addVariable("descriptionText", "<%=(Recordset1.Fields.Item("Your_Name").Value)%>");
  flashImage25.addVariable("mouseOverBorderColor", "0x000000");
  flashImage25.write("dv_flashImage25");
  // ]]>
</script> <a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>"></a><a href="details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>"></a> </div>                  </tr>
      <tr>
        <td bordercolor="#FFFFFF" bgcolor="#FFFFFF" class="style174"><table width="95%" border="0" align="center">
          <tr>
            <td width="196" valign="top" bordercolor="<% if Trim(Recordset1.Fields.Item("Photo").Value) = "" then Response.Write "photos\no_photo.jpg" else Response.Write Recordset1.Fields.Item("Photo").Value %>">

 


I'm using flashImage25. because I already using flashImage1. on the page.

I really appreciate your help!
Thank you,
Troy



Edited by - Troy Julius on 18 May 2009  22:25:48
Replied 19 May 2009 15:43:16
19 May 2009 15:43:16 Miroslav Zografski replied:
Hi Troy,

I see that you are using same php snipped on few places. You can have that "If" to change a variable which to apply on places you need it. That will reduce your code and will made it more readable.

Regards,
Replied 19 May 2009 19:58:42
19 May 2009 19:58:42 Troy Julius replied:
Miroslav,

Hey sorry I didn't understand what you meant. Also it's not PHP, instead I'm working with ASP code.

Would you be able to show an example of the Flash Enhancer along wth the Horizonal Looper II code, I have not been able to get it to work. (

Or do you know of another extention which would accomplish the horizonal looping of a recordset?

Thanks,
Troy
Replied 20 May 2009 00:12:54
20 May 2009 00:12:54 Troy Julius replied:
I'm really sorry, I think I should clarify the code being used, sorry there is code for Tom Muck's horizonal Looper II and also I added some custom code for replacing an image if the image value is null and also there is the code for the Flash Image Enhancer.

So to simplify things would anyone be able to figure out what the code is for using Tom Muck's Horizonal looper with the Flash Image Enhancer? Also I am wonder if there is something else I could use which would allow me to accomlish the same thing that Tom Muck's Horizonal Looper extention does, do you know if there is anything like his extention, maybe this would be another solution?

Please reply,
Troy
Replied 20 May 2009 08:32:49
20 May 2009 08:32:49 Miroslav Zografski replied:
Hi Troy.

Sorry, my bad. What I meant was that you can have your custom ASP snipped that checks the Photo record value placed only once in your page like follows:

<% 
dim Photo
Photo = Recordset1.Fields.Item("Photo").Value
if Trim(Photo) = "" then 
	Response.Write "photos\no_photo.jpg" 
else 
	Response.Write Photo 
end if
%>


About the any other way to achieve the goal - well you can always try with Repeat Region Server Behavior. You can send me your page without the Tom's extension code and a bit of description what you need and I can help you have it.

Regards,
Replied 25 May 2009 06:32:37
25 May 2009 06:32:37 Troy Julius replied:
Okay, help, I give up here is my code, any ideas how to get the Flash Image Enhancer to work with the code below.

This is the code without the Flash Image Enhancer:

 <
%startrw = 0
endrw = HLooper1__index
numberColumns = 5
numrows = 3
while((numrows <> 0) AND (Not Recordset1.EOF))
	startrw = endrw + 1
	endrw = endrw + numberColumns
 %>
  <tr align="center" valign="top">

    <
%While ((startrw <= endrw) AND (Not Recordset1.EOF))
%>


<img src="<%=(Recordset1.Fields.Item("Photo").Value)%>" alt="<%=(Recordset1.Fields.Item("Your_Name").Value)%>" width="145" border="0">


    <
%	startrw = startrw + 1
	Recordset1.MoveNext()
	Wend
	%>
  </tr>
  <
% numrows=numrows-1
 Wend
 %>
</table>  



Here is the code with with the Flash Image Enhancer added;

 

%startrw = 0
endrw = HLooper1__index
numberColumns = 5
numrows = 3
while((numrows <> 0) AND (Not Recordset1.EOF))
	startrw = endrw + 1
	endrw = endrw + numberColumns
 %>
  <tr align="center" valign="top">

    <
%While ((startrw <= endrw) AND (Not Recordset1.EOF))
%>



<span id="dv_flashImage2">[img]<%=(Recordset1.Fields.Item("Photo").Value)%>" width="145" height="undefined" /></span>
            <script type="text/javascript">
  // <![CDATA[
  var flashImage2 = new dmxFlashImageEnhancer("<%=(Recordset1.Fields.Item("Photo").Value)%>", "fl_flashImage2", "145", Math.round(1.15*parseFloat("undefined"),0));
  flashImage2.setScriptLibrary("../ScriptLibrary");
  flashImage2.addVariable("onClickUrl", "details_not_signed_on.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ID=" & Recordset1.Fields.Item("ID").Value %>");
  flashImage2.addVariable("onClickTarget", "_self");
  flashImage2.addVariable("hasReflection", "true");
  flashImage2.addVariable("reflectStrength", "50");
  flashImage2.addVariable("descriptionText", "<%=(Recordset1.Fields.Item("Your_Name").Value)%>");
  flashImage2.write("dv_flashImage2");
  // ]]>
            </script>



    <
%	startrw = startrw + 1
	Recordset1.MoveNext()
	Wend
	%>
  </tr>
  <
% numrows=numrows-1
 Wend
 %>
</table>
             





Edited by - Troy Julius on 25 May 2009  06:34:06
Replied 28 Jun 2009 22:53:48
28 Jun 2009 22:53:48 Tommy Nielsen replied:
Hi

I am also having the same problem, Ican't get this extension to work together a horizontal looper. It is only the first number there is working correct.
Here is my code
------------------------------
<table width="200" border="0" align="center" cellpadding="10" cellspacing="0">
<tr><td>
<table width="180" border="0" cellpadding="10" cellspacing="10">
<tr>
<%
'***************************
' www.DwZone.it
' DwZone Horizontal Looper
' Version 1.1.3
' Before Selection Code
'***************************
dwzLooperCol = 3
dwzLooperRow = -1
dwzCol = 0
dwzRow = 0
do while not rsTilbud.eof
dwzCol = dwzCol + 1
%><td><span id="dv_flashImage2"><img src="<%=(rsTilbud.Fields.Item("butikbilled".Value)%>
" width="140" height="105" /></span>
<script type="text/javascript">
// <![CDATA[
var flashImage2 = new dmxFlashImageEnhancer("<%=(rsTilbud.Fields.Item("butikbilled".Value)%>", "fl_flashImage2", "140", Math.round(1.15*parseFloat("105",0));
flashImage2.setScriptLibrary("../ScriptLibrary";
flashImage2.addVariable("cornerRadius", "15";
flashImage2.addVariable("corners", "tl,tr,bl,br";
flashImage2.addVariable("hasBorder", "true";
flashImage2.addVariable("borderSize", "3";
flashImage2.addVariable("hasShadow", "true";
flashImage2.addVariable("shadowSize", "5";
flashImage2.addVariable("hasReflection", "true";
flashImage2.addVariable("reflectStrength", "50";
flashImage2.addVariable("descriptionText", "<%=(rsTilbud.Fields.Item("butiknavn".Value)%>";
flashImage2.write("dv_flashImage2";
// ]]>
</script></td><%
'***************************
' www.DwZone.it
' DwZone Horizontal Looper
' Version 1.1.3
' After Selection Code
'***************************
if dwzCol = dwzLooperCol then
response.write("</t" & " r>" & vbcrlf & "<t" & "r>"
dwzCol = 0
dwzRow = dwzRow + 1
end if
if dwzRow >= dwzLooperRow and dwzLooperRow <> -1 then
exit do
end if
rsTilbud.MoveNext
loop
for dwz_i = (dwzCol+1) to dwzLooperCol
response.write("<t" & "d>&nbsp;</t" & "d>"
next
%>
</tr>
</table></td>
</tr>
</table>
-----------------------------
What can I do to gwt this extension to work with a horizontal looper?
Replied 06 Jul 2009 11:17:33
06 Jul 2009 11:17:33 Miroslav Zografski replied:
Hello Tommy,

You need to have a different number for "flashImage2" part. Lets say you can place instead the number 2 the record numbered ID like <%=(rsTilbud.Fields.Item("ID".Value)%> if you have such. so your code will look like :
         <table width="200" border="0" align="center" cellpadding="10" cellspacing="0">
            <tr><td>
            <table width="180" border="0" cellpadding="10" cellspacing="10">
	<tr>
	<
%'***************************
' http://www.DwZone.it
' DwZone Horizontal Looper
' Version 1.1.3
' Before Selection Code
'***************************
dwzLooperCol = 3
dwzLooperRow = -1
dwzCol = 0
dwzRow = 0
do while not rsTilbud.eof
	dwzCol = dwzCol + 1
%><td><span id="dv_flash<%=(rsTilbud.Fields.Item("ID").Value)%>">[img]<%=(rsTilbud.Fields.Item("butikbilled").Value)%>     
                    " width="140" height="105" /></span>
                    <script type="text/javascript">
  // <![CDATA[
  var flash<%=(rsTilbud.Fields.Item("ID").Value)%> = new dmxFlashImageEnhancer("<%=(rsTilbud.Fields.Item("butikbilled").Value)%>", "fl_flash<%=(rsTilbud.Fields.Item("ID").Value)%>", "140", Math.round(1.15*parseFloat("105"),0));
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.setScriptLibrary("../ScriptLibrary");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("cornerRadius", "15");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("corners", "tl,tr,bl,br");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("hasBorder", "true");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("borderSize", "3");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("hasShadow", "true");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("shadowSize", "5");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("hasReflection", "true");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("reflectStrength", "50");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.addVariable("descriptionText", "<%=(rsTilbud.Fields.Item("butiknavn").Value)%>");
  flash<%=(rsTilbud.Fields.Item("ID").Value)%>.write("dv_flash<%=(rsTilbud.Fields.Item("ID").Value)%>");
  // ]]>
                    </script></td><
%'***************************
' http://www.DwZone.it
' DwZone Horizontal Looper
' Version 1.1.3
' After Selection Code
'***************************
	if dwzCol = dwzLooperCol then
		response.write("</t" & " r>" & vbcrlf & "<t" & "r>")
		dwzCol = 0
		dwzRow = dwzRow + 1
	end if
	if dwzRow >= dwzLooperRow and dwzLooperRow <> -1 then
		exit do
	end if
	rsTilbud.MoveNext
loop
for dwz_i = (dwzCol+1) to dwzLooperCol
	response.write("<t" & "d> </t" & "d>")
next
%>
  </tr>
</table></td>
            </tr>
          </table>


This way each instance of the Image Enhancer will have a different number and will be recognized as separate image.

Regards,

Reply to this topic