- 主题:求助 帮忙看下为什么flash找不到定义
<script>
var soundChannel1; // Used to stop the MP3 sound.
var button1; // Used to reference the DOM button object with the ID "button1"
function init(){
if(window.runtime){
console.err("runtime is ok")
}
var urlReq = new window.runtime.flash.net.URLRequest("test.mp3");
sampleMp3 = new window.runtime.flash.media.Sound();
sampleMp3.load(urlReq);
sampleMp3.addEventListener(air.Event.COMPLETE, loaded);
}
</script>
一段javascripy想使用AIR提供flash接口播放文件,但捕获到了
Uncaught TypeError: Cannot read property 'flash' of undefined
本人菜鸟新手。实在是费解,帮忙看看 是怎么回事
--
修改:larbin FROM 220.231.27.*
FROM 220.231.27.*
好像是runtime没有flash属性,你把runtime对象结构log出来看看。
【 在 larbin 的大作中提到: 】
: <script>
: var soundChannel1; // Used to stop the MP3 sound.
: var button1; // Used to reference the DOM button object with the ID "button1"
: ...................
--
修改:dhcn FROM 124.42.13.*
FROM 124.42.13.*
执行了下 console.log(window)
看了下R开头的部分
ProgressEvent: function ProgressEvent() { [native code] }
RGBColor: function RGBColor() { [native code] }
RTCIceCandidate: function RTCIceCandidate() { [native code] }
RTCSessionDescription: function RTCSessionDescription() { [native code] }
Range: function Range() { [native code] }
RangeError: function RangeError() { [native code] }
Rect: function Rect() { [native code] }
ReferenceError: function ReferenceError() { [native code] }
RegExp: function RegExp() { [native code] }
SQLException: function SQLException() { [native code] }
SVGAElement: function SVGAElement() { [native code] }
貌似没有runtime
--
FROM 220.231.27.*
<html>
<link rel="stylesheet" type="text/css" href="css/SampleStyles.css">
<script>
var soundChannel1; // Used to stop the MP3 sound.
var button1; // Used to reference the DOM button object with the ID "button1"
document.write(window.runtime)
function init(){
if(window.runtime){
console.err("runtime is ok")
}
var urlReq = new window.runtime.flash.net.URLRequest("test.mp3");
sampleMp3 = new window.runtime.flash.media.Sound();
sampleMp3.load(urlReq);
sampleMp3.addEventListener(air.Event.COMPLETE, loaded);
}
</script>
<body onload="init()">
<flash><>
</body>
</html>
这个是整个的html,就是打算用window.runtime.flash播放个文件,貌似window结构里没有runtime
【 在 dhcn 的大作中提到: 】
: 好像是runtime没有flash属性,你把runtime对象结构log出来看看。
--
FROM 220.231.27.*
这句if(window.runtime)代码的判定结果你从控制台输出结果应该可以看出来。
【 在 larbin 的大作中提到: 】
: <html>
: <link rel="stylesheet" type="text/css" href="css/SampleStyles.css">
: <script>
: ...................
--
修改:dhcn FROM 124.42.13.*
FROM 124.42.13.*
控制台没有,估计window里没有runtime选项
【 在 dhcn 的大作中提到: 】
: 这句if(window.runtime)代码的判定结果你从控制台输出结果应该可以看出来。
--
FROM 220.231.27.*
你这段代码从哪儿抄的?
【 在 larbin 的大作中提到: 】
: 控制台没有,估计window里没有runtime选项
:
--
FROM 124.42.13.*
是从 adobe 官网下的,用adobe的adl运行的话 这个网页可以正常运行
但直接用浏览器打开就不行了 是不是需要加载什么组件之类的
见笑了,对这一块实在是不了解
【 在 dhcn 的大作中提到: 】
: 你这段代码从哪儿抄的?
--
FROM 220.231.27.*