2012-12-06 3 views
0

저는 이미 Parse.com을 iOS와 함께 사용해 왔으며 훌륭합니다. 제 3 자의 actionscript/parse API도 알고 있지만 AIR에서만 작동합니다.parse.com을 Flash Player에서 사용하는 방법은 무엇입니까?

제 질문은, 어떻게 Flash 웹 게임에서 구문 분석 API를 사용할 수 있습니까? (나는 플래시 플레이어와 함께).

내가 믿는 Parse.com REST API를 사용하는 PHP Parse API도 있습니다. 옵션일까요? 또는 구문 분석 API와 함께 작동하지 않는 Flash Player에 대한 정보가 있습니까?

답변

1

구문 분석 나머지 API와 함께 작동하지 않는 Flash는 없습니다. php에서 api를 호출 할 수 있다면 as3, C++, .net 또는 klingon에서 호출 할 수 있습니다.

+0

이것은 제 3 자 API https://github.com/parkerkrhoyt/Parse에 대한 링크입니다. 아래로 스크롤하면 "Flash Player에서 HTTP 인증 헤더를 수정할 수 없으므로 라이브러리는 AIR 만 사용하므로 데스크톱과 모바일 애플리케이션 모두에서 테스트했습니다. " – Phil

+0

그렇다면 Flash Player에서 PHP API를 사용하는 것이 좋습니다. – Phil

+0

표준 구성 요소가 아닌 플래시를 사용하여 인증 헤더를 수행 할 수 있습니다. 필,이 일을하는 수업이 필요한 경우, 내가 쓴 이메일을 보내 드리겠습니다. 커스텀 헤더, 전체 안심할 수있는 put, 삭제 등 –

0

POST를하고 데이터/변수를 보내지 않는 한 플래시 플레이어는 헤더를 사용할 수 없습니다. 플래시 플레이어에서 구문 분석을 사용하려면 사용자 정의 flash.net.URLLoader가 필요합니다. 여기에 내가 찾은 것이 있지만 이 플래시 플레이어의 새 버전에서 작동하지 않는 몇 가지 이유는, 저는 여기에 서버를 구문 분석하는 작업 REST 호출을 수행하는 방법을 발견 링크 http://www.abdulqabiz.com/blog/archives/2006/03/03/http-authentication-for-httpget-requests-using-actionscript-3/

0

입니다

public function runParseCloudFunction(cloudFunctionName:String):void 
     {    
      if (parseRequestor != null){ 
       return; 
      }   

      //Create the HTTP request object 
      var request:URLRequest = new URLRequest("https://api.parse.com/1/functions/" + cloudFunctionName); 
      request.method = URLRequestMethod.POST; 

      // Create Parse headers 
      var headerAppID:URLRequestHeader = new URLRequestHeader("X-Parse-Application-Id", MY_PARSE_APP_ID); 
      var headerRestKey:URLRequestHeader = new URLRequestHeader("X-Parse-REST-API-Key", MY_PARSE_REST_KEY); 
      var headerContentType:URLRequestHeader = new URLRequestHeader("Content-Type", "application/json"); 
      request.requestHeaders.push(headerAppID); 
      request.requestHeaders.push(headerRestKey); 
      request.requestHeaders.push(headerContentType); 

      //Add the URL variables, json encoded format (OPTIONAL)    
      request.data = '{"param1":"sample1","param2":"sample2","param3":"sample3"}'; 

      //Initiate the transaction 
      parseRequestor = new URLLoader(); 
      //requestor.dataFormat = URLLoaderDataFormat.TEXT;   
      parseRequestor.addEventListener(Event.COMPLETE, callParseCloudFunctionCompleted); 
      parseRequestor.addEventListener(IOErrorEvent.IO_ERROR, callParseCloudFunctionError); 
      parseRequestor.addEventListener(SecurityErrorEvent.SECURITY_ERROR, callParseCloudFunctionError); 
      parseRequestor.addEventListener(HTTPStatusEvent.HTTP_STATUS, callParseStatusHandler); 
      parseRequestor.load(request); 
     } 

클라우드 구문 분석 API 버전 과 테스트 1.3.2

희망이 있습니다!

관련 문제