macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: BG sound with on off control in cfm

Subject: Re: BG sound with on off control in cfm
From: Ian Skinner
Date: Tue, 28 Aug 2007 11:25:52 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion

 <cfset session.isUserKnown = 1>
 <cfif isDefined("session.isUserKnown")>
 <embed SRC="CFdocs/ocean.wav" AUTOSTART="true" HIDDEN="false"
LOOP="false"></embed>
 <cfif NOT isDefined("session.isUserKnown")>
 <embed SRC="CFdocs/ocean.wav" AUTOSTART="true" HIDDEN="false"
LOOP="true"></embed>
 </cfif>
 </cfif>



Ok some basic Boolean logic, you have an if-else situation there, you don't need the two if statements one if statement can do both.
<cfif isDefiend("session.isUserKnown")>
   <cfembed ... loop="false">
<cfelse>
   <cfembed ... loop="true">
</cfif>

However this can be further simplified by just defining the session variable to be the value of the loop parameter.
<cfset session.playBGsound = "true">
<embed ... loop="#session.playBGsound#">

But I still have no idea how you get the user interaction from the client to the server. You have indicated that the <embed...> command triggers the browser to launch a plug-in. If that is what you are working with, you are going to need to explore the capabilities of that plug in and whatever API it may allow.
Of course this leads into questions of what happens if the plug in my
browser uses is different the plug in your browser uses and both may be
different then the plug in George's browser uses.




<Prev in Thread] Current Thread [Next in Thread>