【问题标题】:1119: Access of possibly undefined property Complete throught a reference with static type Class1119:通过静态类型 Class 的引用完成对可能未定义属性的访问
【发布时间】:2012-02-27 20:16:25
【问题描述】:

我正在做一个 flash 网站,我想将一个 html 文件导入到 flash 文件中

这是我在 Ehow 上找到的代码 here is the tutorail

var displayText:TextField = new TextField();

displayText.scaleY = stage.stageHeight/600;
displayText.scaleX = stage.stageWidth/1225;
displayText.width = 400;
displayText.height = 700;

var importFile:URLLoader = new URLLoader();
var requestedFile: URLRequest = new URLRequest("HTML/الدرس الأول.htm");

importFile.load(requestedFile);

importFile.addEventListener(Event.Complete, htmlloaded_fn);

function htmlloaded_fn(event: Event): void {

    displayText.htmlText = importFile.data;

}

addChild(displayText);

【问题讨论】:

    标签: html flash actionscript-3 flash-cs4


    【解决方案1】:

    事件属性 COMPLETE 应为大写:

    importFile.addEventListener(Event.COMPLETE, htmlloaded_fn);
    

    按照惯例,一个类的所有静态属性都用大写字母书写,单词之间有下划线。

    【讨论】:

    猜你喜欢
    • 2012-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-12
    相关资源
    最近更新 更多