This topic is locked

Flash Player pulling file name from data-field

12/28/2007 6:32:04 PM
ASPRunnerPro General questions
S
SDDivine author

Here's my problem....

I have a database where by I want to load a media file (.swf) into a directory and enter that file name into a data field.

The record would be the details on a product and the user is provided a link to see a video with more information. This video would be loaded into a separate directory and the name of the video stored in a text field in the database.
On the view page, I would like to have a player shown that would get the media file name from the database field and then have it to be shown if the person clicked the player. My intent would be to include the code for the flash player in the template of the view page.
Is this possible?
I'm lost in that I don't know how to change the code string below to call the data from the text field. My text field is named "video" and will contain the name of a file that is on the harddrive associated with that directory record.
In the example below the file is announce.swf but each record would have a different file name stored in the database.
PLAYER CODE FOLLOWS:
<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="368" HEIGHT="276">
<PARAM NAME=movie VALUE="announce.swf">
<PARAM NAME=quality VALUE="high">
<PARAM name="wmode" value="transparent">
<EMBED src="announce.swf" quality="high" wmode="transparent" WIDTH="368" HEIGHT="276" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">;
</OBJECT>
ANY HELP WOULD BE GREATLY APPRECIATTED!!!
Steve Divine

lefty 12/28/2007

Steve ,

If I'm getting your problem write . Just have one table in the database with fields

ex.... filename1 and ex.....upload2_swf (fmedia file) .

Then setup filename as hyperlink

and actual player file field as file\image choice.
Put a read/write directory on your server ex.... Player/ with the files or add the files through add page asprunner add/edit area..
when a user goes to that record on the list page thwy will click the link to the player and the player will open that file automatically. If the player is confiqured right then it should open the media file . make sure the filename upload is chose as file in the view page.
make sure you have a directory seperated from the project . use ../../ to the path of the diretory. depending hom many folders up from the project
I think this is what you are looking for. This is kind of the opposite . meaning open the player with the link instead of opening the link with the player.

S
SDDivine author 12/28/2007

THANKS FOR YOUR RESPONSE...but it doesnt work if I am following you....

A clarification....

I have loaded a windows media file with an extension of wmv and it works fine just as you say. I have the video in a separate directory and the video text field has the name of the file. When you click on that, it loads in windows media and plays fine.
The PROBLEM is that we want to run FLASH files such as an swf extension. If I am understanding my other applications, I must download a flash player for the view page to work. I can insert the html for the flash player, but I'm having a hard time understanding how to get the file name from the text field into the line code for the flash player. Hence, I just can not get it to work.
In summary, I need to take the file name from the VIDEO field and insert it into HTML for the player on each record in the view screen.
The big question is HOW?
Thanks

Steve

Steve ,

If I'm getting your problem write . Just have one table in the database with fields

ex.... filename1 and ex.....upload2_swf (fmedia file) .

Then setup filename as hyperlink

and actual player file field as file\image choice.
Put a read/write directory on your server ex.... Player/ with the files or add the files through add page asprunner add/edit area..
when a user goes to that record on the list page thwy will click the link to the player and the player will open that file automatically. If the player is confiqured right then it should open the media file . make sure the filename upload is chose as file in the view page.
make sure you have a directory seperated from the project . use ../../ to the path of the diretory. depending hom many folders up from the project
I think this is what you are looking for. This is kind of the opposite . meaning open the player with the link instead of opening the link with the player.

Sergey Kornilov admin 12/29/2007

Steve,
set "View as" type of this field to Custom and make it output this HTML code.

Replace file name (announce.swf) with strValue variable which should contain uploaded file name.

S
SDDivine author 12/29/2007

Sergey,

Maybe I am stupid...but I can't figure out the EXACT syntax.
Are you saying that I should write out that sentence or simply say
strValue=announce.swf
Please expand on your answer.
Thank you.

Steve

Steve,

set "View as" type of this field to Custom and make it output this HTML code.

Replace file name (announce.swf) with strValue variable which should contain uploaded file name.

Sergey Kornilov admin 12/29/2007

Steve,
you need to write a piece of ASP code that outputs HTML code you posted.
Instead of hardcoding announce.swf file name you need to use strValue variable which stores the file name.
If you have any problems doing this post your project to Demo Account and contact me directly at support@xlinesoft.com with your order number.