ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 17th, 2008, 10:38 PM
benjaminkang benjaminkang is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 4 benjaminkang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 50 m 57 sec
Reputation Power: 0
Flash Unable To Open url ONLY 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 file, 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
Code:
<CFPARAM NAME="timeout" DEFAULT="#createtimespan(0,0,0,5)#">
<!--- With Session Management Enabled --->
<CFAPPLICATION NAME="Flash" SESSIONMANAGEMENT="YES" SETCLIENTCOOKIES="NO" SESSIONTIMEOUT="#timeout#" >
<!--- CF will not set the client cookies automatically, so set them manually as per-session cookies --->
<CFIF not IsDefined("Cookie.CFID")>
	<CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">
		<CFCOOKIE NAME="CFID" VALUE="#SESSION.CFID#">
		<CFCOOKIE NAME="CFTOKEN" VALUE="#SESSION.CFTOKEN#">
	</CFLOCK>
</CFIF>

The Action Script
Code:
submitURL = "http://192.168.1.6/flash/testing/LoginProcess.cfm";

//Define function to process form data
function checkUser():Void {
    //Creates an instance of LoadVars to send form data to Coldfusion.
    // creating an Array with LoadVars called dataOut to send the form data as a bulk to Coldfusion.

	dataOut = new LoadVars();

	//These variables will be the once that will correspond to the variables in Coldfusion.
	dataOut.Fname = userinput.text;
    dataOut.Fpwd = passinput.text;

	// Create another LoadVars instance to receive the server's reply
	replyData = new LoadVars();

	// Initialize reply variable.
	replyData.reply_username = "";
	replyData.reply_pwd = "";
	replyData.reply_status = "";
	replyData.reply_tokencf ="";
	replyData.reply_ftoken ="";
	
	replyData.onLoad = handleReply;
	
	// Submit the order data
	dataOut.sendAndLoad(submitURL, replyData, "post");
	
}

function OnReset():Void {
	userinput.text="";
	passinput.text="";
	status_txt.text="";
}


function handleReply(success) {
	if (success) {		
		if (replyData.reply_status) {
						gotoAndStop(3);
			
		}
		else {
			mx.controls.Alert.show("Login Failed!", "Alert");
			gotoAndPlay(1);

		}
	}
	else {
		mx.controls.Alert.show("There was a problem submitting your login. The server may be down or not responding.", "Alert");

	}
}


The LoginProcess.cfm
Code:
<cfset LoginName=#Fname#>
<cfset LoginPwd=#Fpwd#>

<cfquery datasource="#FlashDB#" name="CheckLogin">
[MYSQL]	Select * 
    From Clients 
    Where AccountName='#LoginName#' AND Password='#LoginPwd#' AND LoginStatus <> 'True' [/MYSQL]
	<!--- this is for web login, not flash login --->
    <!--- AND FlashLogin <> 'True' ***might cause timeout error, if timeout doesnt work*** --->
    <!---AND suspend <> 'True'--->
</cfquery>

<cfsetting enablecfoutputonly="YES">
<cfcontent type = "application/x-www-urlform-encoded">

<cfif CheckLogin.FlashLogin NEQ True>
	<cfset LoginStatus=1>
	<cfset CurrBalance = #NumberFormat(CheckLogin.CurrencyBalance*100, '99')#>
	<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">
<cfelse>
	<cfset LoginStatus=0>
	<cfset returnToFlash = "&reply_username=#URLEncodedFormat(LoginName)#&reply_pwd=#URLEncodedFormat(LoginPwd)#">
</cfif>

<!--- FlashOutput contains the string that will be sent back to Flash--->
<cfprocessingdirective suppresswhitespace="Yes">
<cfoutput>
#returnToFlash#
</cfoutput>
</cfprocessingdirective>


Login page, with the flash embedded
Code:
<body>

<cfoutput>
               
		<object width="350" height="250">

			<param name="movie" value="Login3.swf">

			<embed src="Login.swf" width="350" height="250">
	
			</embed>
	
		</object>
        
</cfoutput>


</body>

Reply With Quote
  #2  
Old March 17th, 2008, 11:52 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 17 h 7 m 51 sec
Reputation Power: 42
I would speculate that since you have setClientCookies="no" in your cfapplication tag, and because you clearly are not manually passing the cfid and cftoken on every request, that you are generating a new session on every request. Try setting setClientCookies to true.

This is just a guess though. You might also try removing different pieces from the Application.cfm file to see if you can narrow down what is triggering the problem.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Flash Unable To Open url ONLY when Application.cfm exists! Why?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway