?
Solved

Images linked to Flash

Posted on 2003-02-24
5
Medium Priority
?
143 Views
Last Modified: 2013-12-24
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
Comment
Question by:portal123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:weeezl
ID: 8009529
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
 
LVL 2

Expert Comment

by:weeezl
ID: 8009560
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
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8011679
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
 
LVL 17

Accepted Solution

by:
anandkp earned 1200 total points
ID: 8014557
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
 

Author Comment

by:portal123
ID: 8020240
Thank you, all guys.

I could solve my problem.

portal123
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question