Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-19-2003, 02:39 PM   #1
rbayly
Registered User
 
Join Date: Jan 2003
Location: Richmond
Posts: 1
Send a message via AIM to rbayly
Unhappy Problem with Flash Remoting and if statement

Okay here is fun one , it is probably simple however I cant figure it out

I have a simple login script that is pulling information from a CFML CFC. I know the cfc is right I have tested it and it is returning the right value (1 or 0) but when I base an if statement off of it it wont validate

here

First Include my gateway code.

#include "NetServices.as"
#include "NetDebug.as"

NetServices.setDefaultGatewayUrl("http://68.57.41.42/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var user = gw.getService("CFC.user", new Result());

then set my default responder

function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
trace(result);
}

this.onStatus = function(error)
{
trace("Error : " + error.description);
}
}


Then on the login page there are two form variables a Username and Password textfield
on press of the login button I set these in an object and go to my next scene.

on (release){
logInfo = new Object();
logInfo.Username = Username.text;
logInfo.Password = Password.text;
gotoAndPlay("LoggingIn");
}



on entering the login clip I call the function and set a variable.

var LoggedIn = user.ValidateUser(logInfo.username, logInfo.password);

it returns properly in the output window (1 or 0)

at the end of the clip I validate for the next clip here is where the problem is.

if (LoggedIn <> 1){
gotoAndPlay("Denied");
}
if (LoggedIn == 1){
gotoAndPlay("SendingToSite");
}
stop();

I tried using an else or just validating Boolean what ever I do it always returns NEQ to 1 even though the output window says 1 ,. what am I doing wrong?
rbayly is offline   Reply With Quote
Old 01-19-2003, 08:06 PM   #2
jimburton
no sleep til bedtime
 
jimburton's Avatar
 
Join Date: May 2001
Location: Brighton
Posts: 1,322
Default

maybe coming in as a string...? try loggedIn == "1"
jimburton is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:05 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.