2009-11-11 5 views

답변

0

자바 스크립트 Flex 어플리케이션이있는 HTML 페이지 내부 ..

<script language="JavaScript" type="text/javascript"> 
function images(url) 
{ 
var width = 700; 
var height = 500; 
var left = (screen.width - width)/2; 
var top = (screen.height - height)/2; 
var params = 'width='+width+', height='+height; 
params += ', top='+top+', left='+left; 
params += ', directories=no'; 
params += ', location=no'; 
params += ', menubar=no'; 
params += ', resizable=no'; 
params += ', scrollbars=no'; 
params += ', status=no'; 
params += ', toolbar=no'; 
newwin=window.open(url,'Screenshots', params); 
if (window.focus) {newwin.focus()} 
return false; 
} 
</script> 

그리고 단추를 클릭 할 때 호출 플렉스 기능 ...

private function imagesButtonClick():void { 
    var url:String = data.images; 
    ExternalInterface.call("images", url); 
} 
1

HTTPService를 사용하여 php 또는 html 파일을 호출 할 수 있습니다.

import mx.rpc.http.HTTPService 


<mx:HTTPService method="post" url="{php path}" resultFormat="e4x" ShowBusyCursor="true" /> 

PHP 또는 HTML

<?php 

echo "<script>window.open('url path','mywindow','width=400,height=200,scrollbars=no, toolbar=no,menubar=no')</script>"; 


?> 

사소한 오류에 대한 확인하시기 바랍니다.

희망이 도움

+0

안녕 Treby, 나는 PHP 파일에 대한 POST 메소드가 어떻게 작동할지는 모르지만 ... 브라우저에서 호출 된 PHP 코드는 작동하지만 Flex 코드에서는 작동하지 않습니다. 내가 더 조사를 완료하고 FlexIn ExternalInterface 함수를 사용하여 javascript를 넣을 수 있어야하지만 그 중 하나에 확실하지 않습니다. – medoix

+0

당신은 method = "post"무시할 수 있습니다. url 경로를 php 또는 html로 지정하십시오. html 쪽에서 코드를 넣으십시오. – Treby