A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Why login swf cannot be run on html?

  1. #1
    Member
    Join Date
    Jun 2009
    Posts
    63

    resolved [RESOLVED] Why login swf cannot be run on html?

    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?

  2. #2
    Senior Member
    Join Date
    Jun 2009
    Posts
    101

    chek it out

    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...
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    Jun 2009
    Posts
    63
    I can run your fla on web server.

    However, my code has called web service.

    Code:
    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.

  4. #4
    Member
    Join Date
    Jun 2009
    Posts
    63
    It needs to use a crossdomain.xml.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center