-1

我用这个代码很长时间了。它完美地工作。现在,我制作 php 5.4。它会保存图片,但不会转到网站 daten.php。当我点击保存时,只保存图片。

var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");       
//Create the thumbnail file name
var dotLoc:Number = currentImageName.lastIndexOf(".");
var prefix = currentImageName.substr(0, dotLoc);
var ext = currentImageName.substr(dotLoc);
var thumbName = prefix + "_thumb" + ext;

// Send the data out to PHP to be saved
var jpgURLRequest:URLRequest = new URLRequest ("http://www.domain/datei.php?name=" + thumbName);
jpgURLRequest.data = jpgData;
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
var jpgURLLoader:URLLoader = new URLLoader();       
jpgURLLoader.addEventListener(Event.COMPLETE, saveComplete);
jpgURLLoader.load(jpgURLRequest);
navigateToURL(jpgURLRequest,"_blank")
4

2 回答 2

0

如果我理解正确,数据会保存在服务器上,但 navigateToURL() 不起作用?我听说 Chrome 浏览器中有一些与此相关的问题,而且一些弹出窗口阻止程序可能会阻止 navigateToURL()。

现在最好通过 ExternalInterface 使用 JavaScript 来打开新页面(自然,它只能在浏览器中工作,而不是在独立的 Flash 播放器中,并且您的用户必须在浏览器中启用 Javascript,这是默认设置):

ExternalInterface.call("window.open", "http://www.domain/datei.php?name=" + thumbName, "_blank");
于 2015-11-26T13:48:58.487 回答
0

您的对象嵌入有问题 - 这个嵌入似乎对我有用(在 Chrome 中测试):

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="TestActionScript">
    <param name="movie" value="ThumbCreator.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="true" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="ThumbCreator.swf" width="100%" height="100%">
        <param name="quality" value="high" />
        <param name="bgcolor" value="#ffffff" />
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
    <!--<![endif]-->
    <!--[if gte IE 6]>-->
    <p> 
        Either scripts and active content are not permitted to run or Adobe Flash Player version
        11.4.0 or greater is not installed.
    </p>
    <!--<![endif]-->
        <a href="http://www.adobe.com/go/getflashplayer">
            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
        </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
</object>
于 2015-11-27T14:51:36.680 回答