Mailto 在 Flash Pro 中工作,但在发布时不工作

Mailto works in Flash Pro but not when Published

在 Adob​​e Flash Pro 中测试时代码正常运行(电子邮件应用程序打开并包括主题、姓名、ID、主管、分数),但是每当我在 FireFox、IE 中发布和打开,或者只是打开 swf播放器,电子邮件客户端将打开,但缺少所有字段,包括主题...我喜欢它在 Flash 中的工作方式,以及不必有服务器端的简单性 php,但它没有按预期工作...

stop();

import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.net.URLLoader;


// Variables
nameout_txt.text = names;
idout_txt.text = id;
supervisorout_txt.text = supervisor;
score.text = myscore+"";

//Email
var Email:URLRequest = new URLRequest
("mailto:ra@email.org" + "?subject=WOE Certificate" + "   " + names +    "&body=" + "Name: " + names + "\nEID: " 
 +id + "\nSupervisor Name: "+ supervisor + "\nScore: " + myscore);
emailbtn.addEventListener(MouseEvent.CLICK,emailCert);

function emailCert(event:MouseEvent):void {
navigateToURL(Email," _blank" ) ;
}


//Array to hold a list of the weekdays.
var weekdays:Array = new Array ("Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday");

//Array to hold a list of the months.
var months:Array = new Array ("Jan","Feb","Mar","Apr","May","Jun","Jul",
"Aug", "Sep", "Oct","Nov","Dec");

//Adds an event listener to the dymanic text field.
the_date_txt.addEventListener(Event.ENTER_FRAME,showDate);

function showDate(event:Event):void {
//Create a new instance of the date class.
var myDate:Date = new Date();

//Retrieve the day, month and year from the date class.
var theDay=weekdays[myDate.getDay()];
var theMonth=months[myDate.getMonth()];
var theDate=myDate.getDate();
var theYear=myDate.getFullYear();

//Display the date in the dynamic text field.
the_date_txt.text=theDay+", "+theMonth+" "+theDate+", "+theYear;
}

/* Printing... */
/* Button */


print_btn.addEventListener(MouseEvent.CLICK,    fl_ClickToGoToAndPlayFromFrame_3);

function fl_ClickToGoToAndPlayFromFrame_3(event:MouseEvent):void
{
gotoAndPlay(14);
}
trace(myscore)

Working Correctly Not working

这是对 Flash Player 的安全限制,您有多种选择:

  1. 如果您想 运行 本地 swf 文件,您可以在 Global Security Settings Panel
  2. 中添加例外
  3. 在 Windows 上,使用 Flash 导出 .exe 投影仪文件 Player.exe
  4. 使用本地网络服务器(如 XAMP)并从 http://localhost 加载文件,而不是使用 file:/// 路径(或简单地将 .swf 文件上传到网站并访问如果从那里)
  5. AIR 而不是 Flash Player
  6. 发布文件

对于选项 1,您需要为计划在本地 运行 此 .swf 的每台计算机添加此例外,因此选项 2 更有意义。

方案三应该也够简单了。

选项 4 可能有点矫枉过正,除非您需要访问更好的本机功能(例如文件系统访问、保存设置、自定义图标、将应用程序最小化到系统托盘以及可能发布到 IOS/Android/etc。)