Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 为什么我要指定此错误?:TypeError:Error#1010:术语未定义且没有属性。基本上_Actionscript 3_Button_Flash Cs6 - Fatal编程技术网

Actionscript 3 为什么我要指定此错误?:TypeError:Error#1010:术语未定义且没有属性。基本上

Actionscript 3 为什么我要指定此错误?:TypeError:Error#1010:术语未定义且没有属性。基本上,actionscript-3,button,flash-cs6,Actionscript 3,Button,Flash Cs6,我正在尝试制作一个小型的粉丝制作的塞尔达游戏。我目前正在处理菜单,并有一个小的介绍视频,导致标志和开始按钮被淡入。但是,由于某些原因,我的按钮没有删除起始页并添加文件页。我库中的按钮名称和ActionScript链接是“StartButton”,它位于我的StartPage movieclip中。该文件页也被命名为“文件页”以及它的AS3链接 这是我的密码 package { import flash.display.MovieClip; import flash.events.MouseEv

我正在尝试制作一个小型的粉丝制作的塞尔达游戏。我目前正在处理菜单,并有一个小的介绍视频,导致标志和开始按钮被淡入。但是,由于某些原因,我的按钮没有删除起始页并添加文件页。我库中的按钮名称和ActionScript链接是“StartButton”,它位于我的StartPage movieclip中。该文件页也被命名为“文件页”以及它的AS3链接

这是我的密码

package 
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.events.Event;
import flash.media.Sound;
import flash.media.SoundChannel;

public class Main extends MovieClip
{
    var startPage:StartPage;
    var filePage:FilePage;
    var introMusic:Sound = new IntroMusic;
    var introMusicChannel:SoundChannel = new SoundChannel();

    public function Main()
    {
        introMusicChannel = introMusic.play();
        startPage = new StartPage;
        filePage = new FilePage;
        addChild(startPage);
        startPage.x = 275;
        startPage.y = -12.50;
        startPage.width = 795.95;
        startPage.height = 498.40;

   /*ADD EVENT LISTENERS
   ***********************/
        startPage.addEventListener(MouseEvent.CLICK, onStartPageClick);
        startPage.StartButton.addEventListener(MouseEvent.CLICK,
                    onStartButtonClick);
    }

   /*EVENT HANDLERS
   ***********************/
    function onStartPageClick(event:MouseEvent):void
    {
        startPage.gotoAndPlay(599);
    }

    function onStartButtonClick(event:MouseEvent):void
    {
        addChild(filePage);
        filePage.x = 275.00;
        filePage.y = 200.00;
        filePage.width = 599.90;
        filePage.height = 399.90;
        removeChild(startPage);
        introMusicChannel.stop();
    }

}
}

我相信是这条线

startPage.StartButton.addEventListener(MouseEvent.CLICK, onStartButtonClick);
转到StartPage MovieClip,选择StartButton并查看属性面板。确保您的StartButton在属性面板中具有“实例名称”作为StartButton


塞尔达游戏万岁(如果你看我的个人资料图片)。不管怎样,它表明您的
TypeError
位于函数
Main
。定义变量后,在
Main
中跟踪
'test'
,看看它是在变量之前还是之后跟踪的。如果在之后,那么您知道在哪里查找错误。然后,您可以将
trace
移得越来越高,直到看到它在哪一行,或者您可以使用
try
catch
查看特定问题。调试您的电影(ctrl+shift+enter)而不是测试(ctrl+enter),您将获得有关问题的更多信息以及问题发生的线路。它将是startPage.StartButton。startPage.getChildByName(“StartButton”)找到了什么?@没有线索。我怎么检查p很抱歉,我是actionscript新手。这使得它根本无法运行。实例名称必须小于或等于。它已经有一个实例名“startButton”。