ReferenceError:错误#1069:在flash.text.TextField上找不到属性标题,并且没有默认值

时间:2014-05-21 08:41:48

标签: actionscript-3

点击" libraryButton"后,我得到以下输出。我已经查看了类似问题的其他答案,但可以找到一个有帮助的答案。

ReferenceError: Error #1069: Property title not found on flash.text.TextField and there is no default value.
at HarmonyMusic_fla::MainTimeline/frame2()
at flash.display::MovieClip/gotoAndStop()
at HarmonyMusic_fla::MainTimeline/openLibrary()

这是我在" Home"上的代码。帧

//When program starts, open the home page

import flash.events.MouseEvent;

gotoAndStop("Home");

//Make "conservatoriumButton" listen for a mouse click and call the "openConservatorium" function
conservatoriumButton.addEventListener(MouseEvent.CLICK, openConservatorium);

function openConservatorium(event:MouseEvent):void{
//Open webpage "http://www.griffith.edu.au/music/queensland-conservatorium" when function is called
navigateToURL(new URLRequest("http://www.griffith.edu.au/music/queensland-conservatorium"), "_blank");  
}
griffithButton.addEventListener(MouseEvent.CLICK, openGriffith);

function openGriffith(event:MouseEvent):void{
//Open webpage "http://www.griffith.edu.au" when function is called
navigateToURL(new URLRequest("http://www.griffith.edu.au"), "_blank");  
}
//Make "libraryButton" listen for a mouse click and call the "openLibrary" function
libraryButton.addEventListener(MouseEvent.CLICK, openLibrary);

function openLibrary(event:MouseEvent):void{
//Goto the frame named "MusicLibrary"
gotoAndStop("MusicLibrary");
}
searchButton.addEventListener(MouseEvent.CLICK, searchGoogle);
//searchBar.addEventListener(KeyboardEvent.ENTER, searchGoogle);

function searchGoogle(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.google.com.au/search?q="+searchBar.text), "_blank");
}

编辑:我打开了调试模式,这就是出现的结果:

ReferenceError: Error #1069: Property title not found on flash.text.TextField and there is no default value.
at HarmonyMusic_fla::MainTimeline/frame2()[HarmonyMusic_fla.MainTimeline::frame2:80]
at flash.display::MovieClip/gotoAndStop()
at HarmonyMusic_fla::MainTimeline/openLibrary()[HarmonyMusic_fla.MainTimeline::frame1:24]

第2帧第80行的代码:

function chooseSong(e:MouseEvent):void{
/*line 80*/switch(e.currentTarget.name){
    case "song1":
        currSong = "../MP3s/"+songList[0] as String;
        quartetsAlbum.visible=true;
        butterflyAlbum.visible=false;
        tapTouchAlbum.visible=false;
        lookingAlbum.visible=false;
        break;

这是第1帧第24行的代码

function openLibrary(event:MouseEvent):void{
/*line 24*/gotoAndStop("MusicLibrary");
}

按钮调用chooseSong

song1.addEventListener(MouseEvent.CLICK, chooseSong);
song2.addEventListener(MouseEvent.CLICK, chooseSong);
song3.addEventListener(MouseEvent.CLICK, chooseSong);
song4.addEventListener(MouseEvent.CLICK, chooseSong);
song5.addEventListener(MouseEvent.CLICK, chooseSong);
song6.addEventListener(MouseEvent.CLICK, chooseSong);
song7.addEventListener(MouseEvent.CLICK, chooseSong);
song8.addEventListener(MouseEvent.CLICK, chooseSong);
song9.addEventListener(MouseEvent.CLICK, chooseSong);
song10.addEventListener(MouseEvent.CLICK, chooseSong);
song11.addEventListener(MouseEvent.CLICK, chooseSong);
song12.addEventListener(MouseEvent.CLICK, chooseSong);

1 个答案:

答案 0 :(得分:0)

尝试在title的代码中搜索并发布包含它的行。我最好的猜测是你有一个动态的TextField并且你正试图在那里写出这首歌的名字。有点像:

    myText.title = "Wrong!"; // is wrong; there is no such property
    myText.text = "Right!"; // the correct way to set the text in a textfield

但这只是一个疯狂的猜测。