473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Flash Unable To Open URL when Application.cfm exists! Why?

I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was working fine, till i decided to add the Application.cfm file for session variables.

Whenever i remove the application.cfm, everything works fine.But if i add it in again, nothing works again.... *sigh*

Error given out by flash is :
Error opening URL "http://192.168.1.6/flash/testing/LoginProcess.cfm"

Anyone knows how to fix this?

Application.cfm
Expand|Select|Wrap|Line Numbers
  1. <CFPARAM NAME="timeout" DEFAULT="#createtimespan(0,0,0,5)#">
  2. <!--- With Session Management Enabled --->
  3. <CFAPPLICATION NAME="Flash" SESSIONMANAGEMENT="YES" SETCLIENTCOOKIES="NO" SESSIONTIMEOUT="#timeout#" >
  4. <!--- CF will not set the client cookies automatically, so set them manually as per-session cookies --->
  5. <CFIF not IsDefined("Cookie.CFID")>
  6.     <CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">
  7.         <CFCOOKIE NAME="CFID" VALUE="#SESSION.CFID#">
  8.         <CFCOOKIE NAME="CFTOKEN" VALUE="#SESSION.CFTOKEN#">
  9.     </CFLOCK>
  10. </CFIF>
  11.  
The Action Script
Expand|Select|Wrap|Line Numbers
  1. submitURL = "http://192.168.1.6/flash/testing/LoginProcess.cfm";
  2.  
  3. //Define function to process form data
  4. function checkUser():Void {
  5.     //Creates an instance of LoadVars to send form data to Coldfusion.
  6.     // creating an Array with LoadVars called dataOut to send the form data as a bulk to Coldfusion.
  7.  
  8.     dataOut = new LoadVars();
  9.  
  10.     //These variables will be the once that will correspond to the variables in Coldfusion.
  11.     dataOut.Fname = userinput.text;
  12.     dataOut.Fpwd = passinput.text;
  13.  
  14.     // Create another LoadVars instance to receive the server's reply
  15.     replyData = new LoadVars();
  16.  
  17.     // Initialize reply variable.
  18.     replyData.reply_username = "";
  19.     replyData.reply_pwd = "";
  20.     replyData.reply_status = "";
  21.     replyData.reply_tokencf ="";
  22.     replyData.reply_ftoken ="";
  23.  
  24.     replyData.onLoad = handleReply;
  25.  
  26.     // Submit the order data
  27.     dataOut.sendAndLoad(submitURL, replyData, "post");
  28.  
  29. }
  30.  
  31. function OnReset():Void {
  32.     userinput.text="";
  33.     passinput.text="";
  34.     status_txt.text="";
  35. }
  36.  
  37.  
  38. function handleReply(success) {
  39.     if (success) {        
  40.         if (replyData.reply_status) {
  41.                         gotoAndStop(3);
  42.  
  43.         }
  44.         else {
  45.             mx.controls.Alert.show("Login Failed!", "Alert");
  46.             gotoAndPlay(1);
  47.  
  48.         }
  49.     }
  50.     else {
  51.         mx.controls.Alert.show("There was a problem submitting your login. The server may be down or not responding.", "Alert");
  52.  
  53.     }
  54. }
The LoginProcess.cfm
Expand|Select|Wrap|Line Numbers
  1. <cfset LoginName=#Fname#>
  2. <cfset LoginPwd=#Fpwd#>
  3.  
  4. <cfquery datasource="#FlashDB#" name="CheckLogin">
  5.     Select * 
  6.     From Clients 
  7.     Where AccountName='#LoginName#' AND Password='#LoginPwd#' AND LoginStatus <> 'True' 
  8.     <!--- this is for web login, not flash login --->
  9.     <!--- AND FlashLogin <> 'True' ***might cause timeout error, if timeout doesnt work*** --->
  10.     <!---AND suspend <> 'True'--->
  11. </cfquery>
  12.  
  13. <cfsetting enablecfoutputonly="YES">
  14. <cfcontent type = "application/x-www-urlform-encoded">
  15.  
  16. <cfif CheckLogin.FlashLogin NEQ True>
  17.     <cfset LoginStatus=1>
  18.     <cfset CurrBalance = #NumberFormat(CheckLogin.CurrencyBalance*100, '99')#>
  19.     <cfset returnToFlash = "&reply_username=#URLEncodedFormat(LoginName)#&reply_pwd= #URLEncodedFormat(LoginPwd)#&reply_status= #URLEncodedFormat(LoginStatus)#&reply_balance= #URLEncodedFormat(CurrBalance)#&reply_nick= #URLEncodedFormat(CheckLogin.LastName)#&reply_clientID= #URLEncodedFormat(CheckLogin.ClientID)#&abc=1234">
  20. <cfelse>
  21.     <cfset LoginStatus=0>
  22.     <cfset returnToFlash = "&reply_username=#URLEncodedFormat(LoginName)#&reply_pwd= #URLEncodedFormat(LoginPwd)#">
  23. </cfif>
  24.  
  25. <!--- FlashOutput contains the string that will be sent back to Flash--->
  26. <cfprocessingdirective suppresswhitespace="Yes">
  27. <cfoutput>
  28. #returnToFlash#
  29. </cfoutput>
  30. </cfprocessingdirective>
Login page, with the flash embedded
Expand|Select|Wrap|Line Numbers
  1. <body>
  2.  
  3. <cfoutput>
  4.  
  5.         <object width="350" height="250">
  6.  
  7.             <param name="movie" value="Login3.swf">
  8.  
  9.             <embed src="Login.swf" width="350" height="250">
  10.  
  11.             </embed>
  12.  
  13.         </object>
  14.  
  15. </cfoutput>
  16.  
  17.  
  18. </body>
  19.  
Mar 18 '08 #1

✓ answered by benjaminkang

ah, my mistake, i just realized that i forgot to cfset datasource.... hahahaha my bad...sorry

4 4022
acoder
16,027 Expert Mod 8TB
Maybe the timeout is too low. How long does it take the page to open?
Mar 18 '08 #2
well, the page opens almost instantly since its hosted on a local server.
Mar 19 '08 #3
ah, my mistake, i just realized that i forgot to cfset datasource.... hahahaha my bad...sorry
Mar 19 '08 #4
acoder
16,027 Expert Mod 8TB
So why didn't the error message show that?
Mar 19 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
1
by: zeb | last post by:
Hi, How can I have a flash played in a popup window when I load my index page ? Thanks in advance...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
115
by: post2google | last post by:
I was thinking about where to go for lunch the other day, so I went to hardees.com to see what the menu looked like these days. What comes up is a big note that my flash version is not new enough...
5
by: JJ | last post by:
Although this question involves Flash, I suspect the actual issue is an asp one.. I am trying to open the web.sitemap file in an .swf file enbedded in an asp page (I'm working in VS 2005). I...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.