[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Displaying a .SWF from an MS Access database in Classic ASP

Posted on 2008-02-09
6
Medium Priority
?
193 Views
Last Modified: 2013-11-19
I want to display a .swf file on a web page using an access database, this holds the swf file name and path. The images swf and flv are held in a directory.

For some reason swf files do not  show using a recordset, jpgs and gifs are OK but the swf shows nothing on the page, not even a red X

I am using DW CS3
Any Ideas please?
Thanks
John
0
Comment
Question by:johnhardy
  • 3
  • 3
6 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 20858554
Hi John,

You need to echo the value from the recordset in the javascript call to AC_RunActiveContent.  It can be a little tricky to do this depending on how the path is stored in the Access file.

What you should do is embed the file normally and look to see how DW writes the call to the video file.  If your path in the database is different from what DW expects, you need to alter the database.  Then, just replace the static path and filename with the recordset value.
0
 

Author Comment

by:johnhardy
ID: 20859214
Thanks Jason
Will come back on this one soon
0
 

Author Comment

by:johnhardy
ID: 20862141
Hi Jason
At last I have managed to have a look at this method.

I dragged the .swf file on to the page which give me the code that follows:
I can see four references to the image in the recordset ImagesUpload/IMGP1208_384K


<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','320','height','240','src','ImagesUpload/IMGP1208_384K','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','ImagesUpload/IMGP1208_384K' ); //end AC code
</script>

<noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="320" height="240">
          <param name="movie" value="ImagesUpload/IMGP1208_384K.swf" />
          <param name="quality" value="high" />
          <embed src="ImagesUpload/IMGP1208_384K.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="320" height="240"></embed>
        </object></noscript



If I substitute the first image ref with <%=(rs.Fields.Item("MyImage1Dir").Value)%> the vidoe shows OK.
If I substitute the second image reference with <%=(rs.Fields.Item("MyImage1Dir").Value)%> the video does not show.

Am I on the right track?
Thanks
John
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:johnhardy
ID: 20862256
Hi
I further noticed that I could change reference to the images Numbers 1, 3 and 4 but if I change

'movie','ImagesUpload/IMGP1208_384K'

 to 'movie','<%=(rs.Fields.Item("MyImage1Dir").Value)%>' the image does not show
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 20863299
Okay, let me work backwards a little bit.

This part of the code:

noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="320" height="240">
          <param name="movie" value="ImagesUpload/IMGP1208_384K.swf" />
          <param name="quality" value="high" />
          <embed src="ImagesUpload/IMGP1208_384K.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="320" height="240"></embed>
        </object></noscript>

Can actually be removed.  The noscript section is used for browsers with the javascript turned off and doesn't affect 99% of your visitors.  Removing it simplifies the debugging.

So that leaves us with this code:

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','320','height','240','src','ImagesUpload/IMGP1208_384K','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','ImagesUpload/IMGP1208_384K' ); //end AC code
</script>

Where the critical part is:

'src','ImagesUpload/IMGP1208_384K'

In theory, all you need to do is replace the 'ImagesUpload/IMGP1208_384K' with '<%=(rs.Fields.Item("MyImage1Dir").Value)%>' and when the page loads, the ASP evaluates and puts the correct call to the Flash file in there.

Remember, the value in the DB needs to match what DW printed initially.  You need:

IMGP1208_384K

not

IMGP1208_384K.swf

J
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 20863301
Ah, and also you need to replace:

'movie','ImagesUpload/IMGP1208_384K'

with

'movie','<%=(rs.Fields.Item("MyImage1Dir").Value)%>'
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Learn how to create interesting presentations by including videos to keep your audience engaged using Prezi. Select "Insert" from the top menu in your Prezi editor: Select "YouTube Video": Paste the video URL into the prompt: "Select "Insert":…
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

607 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