Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: Throwing cfoutput variables into javascript
From: Daniel H
Date: Thu, 11 May 2000 19:25:18 +0100

Here is a very basic template of what I have tried to do.
I am trying to pass data from a database via coldfusion to JavaScript
basically. This would allow for me to use a database to store flash
filenames and all the variables created for that flash image. Then I could
use a parent page (be it a form or a link, redirect or a search query on a
web page) to call up the database to get the appropriate information for the
particual flash swf needed. At this time it would to see if the client
browser supports flash 4 - then display the flash 4 swf file ... or if the
browser does not suppoer flash 4 then display the secondary image (quered
from the database) such as a animated gif or a jpg image.

I had tried a very simple form of this, trying to embed objects within
objects. (IE.. <Object flash variables etc etc> <Object gif variables etc
etc></Object></Object> This didnt work for me when testing it out on a
broswer that didnt have flash 4 installed.

As you can see below I am using the html that flash publish produces as a
template

Any thoughts would be appreciated

**********

<cfquery name="GetFlash" datasource="mydatasource">
SELECT FlashData.*
FROM FlashData
WHERE FlashDataID = #GetPageObjectData.SelectedFlashID#
</cfquery>

<cfoutput query="GetFlash">
<OBJECT classid="#FlashData.Class#"
codebase="#FlashData.CodeBase#"
ID=#FlashData.ObjectIDName# WIDTH=#FlashData.FlashWidth#
HEIGHT=#FlashData.FLashHeight#>
<PARAM NAME=movie VALUE="#FlashData.flashfile#"> <PARAM NAME=loop
VALUE=#FlashData.FlashLoopYN#> <PARAM NAME=quality
VALUE=#FlashData.Flashquality#> <PARAM NAME=bgcolor
VALUE=#FlashData.FlashBGHEX#>

<SCRIPT LANGUAGE=JavaScript>
<!--
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin &&
parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >=
4 ) {
// Check for Flash version 4 or greater in Netscape
document.write('<EMBED src="#FlashData.FlashFile#.swf"
loop=#FlashData.FlashLoopYN# quality=#FlashData.FLashQuality#
bgcolor=#FLashData.FlashBGHEX# ');
document.write(' swLiveConnect=#FLashData.SWLIVETF#
WIDTH=#FLashData.FlashWidth# HEIGHT=#FlashData.FlashHeight#');
document.write(' TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_
Version=ShockwaveFlash">');
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0
&& navigator.appVersion.indexOf("2.")>=0)){
// Netscape 2 will display the IMG tag below so don't write an extra one
document.write('<IMG SRC="#FlashData.FlashAltImgFile#"
WIDTH=#FlashData.AltWidth# HEIGHT=#FlashData.AltHeight# BORDER=0>');
}
file://-->
</SCRIPT>
</OBJECT>
</cfoutput>

**********
Dan


----- Original Message -----
From: illogic <illogicatbastid [dot] net>
To: <flasheratchinwag [dot] com>
Sent: Thursday, May 11, 2000 1:35 PM
Subject: Re: FLASH: Throwing cfoutput variables into javascript


> what exactly are you trying to accomplish?
> ----- Original Message -----
> From: "Daniel H" <danatmediacomm [dot] com>
> To: <flasheratchinwag [dot] com>
> Sent: Thursday, May 11, 2000 12:38 PM
> Subject: FLASH: Throwing cfoutput variables into javascript
>
>
> > IM having a challange here.
> >
> > I am not the best javascript programmer but in a nutshell here is what I
> > want to do.
> >
> > I am trying to output data about flash attributes located in a database
> into
> > javascript via coldfusion.
> >
> > My question is: How can I pass information from a cfoutput to javascript
> or
> > how do can I encode the javascript to accomodate coldfusion tags within
> > it...
> >
> >
> > I tried nesting cold fusion tags with in javascript.. That doesnt work.
I
> > have also tried the cfset tag to create a variable before the javascript
> > starts. This does not work either.
> >
> > Does anyone have any experience in manipulating a cfoutput to properly
> store
> > a variable so javascript can read it?
> >
> > If anyone has any questions or wishes to see some of the code I have
done.
> I
> > could post it.
> >
> > TIA
> >
> > Dan
> >



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml

Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: Problem intro., Eric Smollin
  Re: FLASH: Problem intro., Helen Triolo
  FLASH: Throwing cfoutput variables into , Daniel H
  Re: FLASH: Throwing cfoutput variables i, illogic

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]