java+flex .mxml文件在运行的时候老是报404错误

zhangkang0808 2010-11-26 06:04:25
HTTP Status 404 - /sample/sample-debug/sample.html
...全文
152 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
龙心 2010-11-29
  • 打赏
  • 举报
回复
楼主访问路径有问题,先直接在tomcat里打开试试。
龙心 2010-11-29
  • 打赏
  • 举报
回复
楼主访问路径有问题,先直接在tomcat里打开试试。
老猫的TOM 2010-11-29
  • 打赏
  • 举报
回复
java 直接调用的是mxml编译后的文件(html),将html改为jsp,在jsp页面中直接调用swf文件,例如下面是我项目中用到的:
<%@ page language="java" import="com.index.util.*" pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String fileName = request.getParameter("fileName");
Properties p = new Properties();
p.load(CreatTable.class
.getResourceAsStream("/com/index/util/ReportModel.properties"));
String reportpath = p.getProperty("reportpath").toString();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">

<!--
Smart developers always View Source.

This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.

Learn more about Flex at http://flex.org
// -->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<!-- END Browser History required section -->

<title></title>
<script src="AC_OETags.js" language="javascript"></script>

<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->

<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 28;
// -----------------------------------------------------------------------------
// -->
</script>
</head>

<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;

AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "flexpaper",
"quality", "high",
"bgcolor", "#869ca7",
"name", "flexpaper",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
"FlashVars", "FileName=<%=reportpath%>/report/<%=fileName%>/ALL(<%=fileName%>).swf");
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "flexpaper",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "flexpaper",
"quality", "high",
"bgcolor", "#869ca7",
"name", "flexpaper",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
"FlashVars", "FileName=<%=reportpath%>/report/<%=fileName%>/ALL(<%=fileName%>).swf"


);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="flexpaper" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="flexpaper.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="FlashVars" value="FileName=<%=reportpath%>/report/<%=fileName%>/ALL(<%=fileName%>).swf" />

<embed src="flexpaper.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="flexpaper" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
FlashVars="FileName=<%=reportpath%>/report/<%=fileName%>/ALL(<%=fileName%>).swf"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
cheniqit1 2010-11-27
  • 打赏
  • 举报
回复
报404 肯定是路径问题 不用多想, 把路径配置放出来
Jlins 2010-11-27
  • 打赏
  • 举报
回复
找不到文件 文件位置防止错误
zhangkang0808 2010-11-27
  • 打赏
  • 举报
回复
不知道怎么配这个呀!那个swf文件可以运行,而且还没有错误!
JadonYuen 2010-11-27
  • 打赏
  • 举报
回复
檢查你服務器的端口和.mxml的路徑

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧