Click to See Complete Forum and Search --> : [RESOLVED] Why login swf cannot be run on html?
wowptc
07-02-2009, 05:56 AM
Hi
I built a swf which can let user login with username and password.
When user click on the login button on swf, it calls a web service to do authentication.
It works on Ctrl+Enter in Flash CS3.
Then, I publish it with html and run on IIS.
There is no response when I click the login button on the html which embedded with the swf.
How can I fix it?
rajeshb_flash
07-07-2009, 07:44 AM
just go thru the fla and publish it and do the same ie how u did ur earlier one.. if still the prob persists... den go to abobe and change the global security settings... option.. it will works fine...
wowptc
07-07-2009, 10:19 PM
I can run your fla on web server.
However, my code has called web service.
butLogin.addEventListener(MouseEvent.CLICK, doLogin);
function doLogin(e:Event):void
{
prompt.text = "doLogin";
UserName = txtUsername.text;
Password = txtPassword.text;
trace("username " + UserName + ", password " + Password);
var ws = new WebService("http://XXX.XXX.XXX.XXX/FlashWS/Service.asmx?wsdl"); // It is a public ip
var op:Operation = new Operation(ws);
prompt.text = "ws";
op.addEventListener(OperationEvent.COMPLETE, onResult);
op.addEventListener(OperationEvent.FAILED, onFault);
op.CheckOperatorLogin(txtUsername.text,txtPassword .text);
prompt.text = "call function";
trace("txtUsername: " + txtUsername.text + ", txtPassword " + txtPassword.text);
function onResult(e:OperationEvent):void {
prompt.text = "onResult";
for (var prop in e.data){
trace (e.data[prop]);
}
loginResult = int(e.data);
trace("Login Result: " + loginResult);
prompt.text = "Login Result";
if (loginResult > 0){
prompt.text = "gotoandplay";
gotoAndStop(2);
} else {
stop();
}
}
function onFault (e:OperationEvent):void {
trace (e.data);
}
}
stop();
It runs up to prompt.text = "call function";
If I run it on Flash CS3, it can goto next frame after doing authentication.
wowptc
07-22-2009, 09:58 PM
It needs to use a crossdomain.xml.
flashkit.com
Copyright Internet.com Inc., All Rights Reserved.