coldfusion flash integration:
I am currently writing a cfc that is called from with flash using remoting. It is pretty basic and works ok, just puts info into a database on a click, then returns a variable so on and so on.... The problem is that one of the fields in my database is filled using the Now() function. That info is then sent back to flash as a variable and displayed in a dynamic text field. For some reason the database entry works great and updates every millisecond if needed, but the string returned to flash only updates once an hour at 08 past!?!?!?!? I am still a beginner with this and assumed it had something to due with an Application setting or Session, but I can't figure it out to save my life. Below is the code being used. I know it is extremely inefficient at this time, but I have been trying all kinds of redundancies to get rid of this issue FLASH CODE function startFlight_Result(id){ currentFlightService.getDepartTime({id:id}); } function getDepartTime_Result(theTime){ offBlock_txt.text = ""; offBlock_txt.text = theTime; } startFlight_btn.onRelease = function(){ currentFlightService.startFlight({pilot:username,depart:depart,arrive:arrive}); } CF CODE <cffunction name="startFlight" access="remote" returntype="string"> <cfargument name="depart" type="string" required="true"> <cfargument name="arrive" type="string" required="true"> <cfargument name="pilot" type="string" required="true"> <cfset currentTime = Now()> <cfquery name="newFlight" datasource="Independence"> INSERT INTO currentFlight(pilot, depTime, depCode, arrCode) Values ('#Arguments.pilot#', #currentTime#, '#Arguments.depart#', '#Arguments.arrive#') </cfquery> <cfquery name="getFlight" datasource="Independence"> SELECT id FROM currentFlight WHERE depTime = #currentTime# </cfquery> <cfreturn getFlight.id> </cffunction> <cffunction name="getDepartTime" access="remote" returntype="string"> <cfargument name="id" type="string" required="true"> <cfquery name="getOffBlock" datasource="Independence"> SELECT depTime FROM currentFlight WHERE id = #Arguments.id# </cfquery> <cfset offBlock = ""> <cfset offBlock = dateFormat(getOffBlock.depTime,"MMM DD, YYYY HH:MM") & " Off Block"> <cfreturn offBlock> </cffunction>
Don't see what you're looking for? Try a search.
|