• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

Images linked to Flash

Hi!, Guys.

I have a question for you.

I have tblProducts, a table in MS Access.

tblProducts has three fields:
pid(Auto Number-primary key), pic(contains .jpg names), and pic2(cotains .swf names)

And also I have two coldFusion files:

FlashPre1.cfm and FlashPre2.cfm

In FlashPre1.cfm file, there are small images linked to a next page,FlashPre2.cfm. If a user click on a small image, it bring him to a next page, FlashPre2.cfm.

In FlashPre2.cfm, if a Flash file's name exists in a cell in pic2 column in tblProducts in MS Access, I would show a Flash presentaion by .swf file. If a Flash file's name is null, I would show simply magnified JPEG.

But a Flash file does not work in the following code(in FlashPre2.cfm). Would you please somebody help me!!

First page: FlashPre1.cfm

<cfquery name="GetProducts" datasource="TestList">
Select * from tblProducts
</cfquery>

<cfoutput query="GetProducts">
<a href="flashPresentaion2.cfm?pid=#GetProducts.pid#">
<img src = "images/#GetProducts.pic#" border=0 width="50" height="50"></a>
<hr>
</cfoutput>
------------------------------
Second page: FlashPre2.cfm

<cfif IsDefined('URL.pid')>

     <cfquery name="GetFlashs" datasource="TestList">
     Select * from tblProducts Where pid = #URL.pid#
     </cfquery>

     <cfif GetFlashs.pic2 IS NOT "">
     
     
     <CFSET OLDSTRING = GetFlashs.pic2>
     <CFSET NEWSTRING = listfirst('OLDSTRING','.')>
     
     <!--- Here Is Problems--->
     <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
      codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
      WIDTH="250" HEIGHT="250" id="<cfoutput>#NEWSTRING#</cfoutput>" ALIGN="">
      <PARAM NAME=movie VALUE="<cfoutput>#OLDSTRING#</cfoutput>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#999999> <EMBED src= "./images/<cfoutput>#OLDSTRING#</cfoutput>" quality=high bgcolor=#999999  WIDTH="250" HEIGHT="250" NAME="<cfoutput>#NEWSTRING#</cfoutput>" ALIGN=""
      TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
     </OBJECT>
     
     <cfelse>
     
<cfoutput query="GetFlashs">
     <img SRC="./images/#GetFlashs.pic#" width="300" height="300">
     </cfoutput>
     </cfif>
     
</cfif>

Regards and BestWish, portal123
0
portal123
Asked:
portal123
1 Solution
 
weeezlCommented:
well, the obvious thing wrong here is this line:

<CFSET NEWSTRING = listfirst('OLDSTRING','.')>

The quotes around the 'OLDSTRING' value make it a string and not a variable so the output of:

<CFSET NEWSTRING = listfirst('OLDSTRING','.')> = OLDSTRING

Try getting rid of the quotes first:

<CFSET NEWSTRING = listfirst(OLDSTRING,'.')>

If you still have problems, check the source of the page and look at the code for embedding the flash object. If you had done this before, you would have noticed the above error.
0
 
weeezlCommented:
Also, make sure that your embed source location is correct:

<EMBED src= "./images/<cfoutput>#OLDSTRING#</cfoutput>"

Should this be:

<EMBED src= "images/<cfoutput>#OLDSTRING#</cfoutput>"

??

as referenced above in FlashPre1.cfm:
<img src = "images/#GetProducts.pic#" border=0 width="50" height="50">
0
 
HamdyHassanCommented:
It's better to do step by step

First make sure the listfirst is working


<cfif IsDefined('URL.pid')>

    <cfquery name="GetFlashs" datasource="TestList">
    Select * from tblProducts Where pid = #URL.pid#
    </cfquery>

    <cfoutput query="GetFlashs">
   
      <cfif #pic2# IS NOT "">
       <CFSET OLDSTRING = #pic2# >
       <CFSET NEWSTRING = listfirst('OLDSTRING','.')>
       <BR> Value of NEWSTRING is #NEWSTRING#
      </cfif>

    </cfoutput>
</cfif>


Also check what weeezi said about /images and ./images
0
 
anandkpCommented:
hi make sure ur flash code - [when shown on browser looks like]

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="150" HEIGHT="120">
    <PARAM NAME="MOVIE" VALUE="http://Domainname/Images/joinam2.swf"><!--- 1 --->
    <PARAM NAME="QUALITY" VALUE="HIGH">
    <!--- 2 ---><EMBED SRC="http://Domainname/Images/joinam2.swf" QUALITY="HIGH" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" TYPE="application/x-shockwave-flash" WIDTH="150" HEIGHT="120">
    </EMBED>
</OBJECT>

the Embed Src & the value marked as 1 & 2 above - shld be the same - in ur case the path r different

just chk up on that & see if it helps

let me know

K'Rgds
Anand
0
 
portal123Author Commented:
Thank you, all guys.

I could solve my problem.

portal123
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now