使用FlashDevelop编译错误

时间:2018-06-20 10:23:26

标签: compiler-errors flashdevelop

如果有人可以帮助我,请。我在下面显示错误和要理解的文件。我正在使用FlashDevelop版本5.3.3.1

Print of error

错误:

I:\Dev\ObjectBuilder_0_4_3\src\src\otlib\components\SpriteList.as(143): col: 17 Error: Attempted access of inaccessible property setSelectedIndex through a reference with static type otlib.components:SpriteList.
I:\Dev\ObjectBuilder_0_4_3\src\src\otlib\components\SpriteList.as(143): col: 17 Error: Call to a possibly undefined method setSelectedIndex.
I:\Dev\ObjectBuilder_0_4_3\src\src\otlib\components\ThingList.as(103): col: 22 Error: Attempted access of inaccessible method setSelectedIndex through a reference with static type otlib.components:ThingList.
I:\Dev\ObjectBuilder_0_4_3\src\src\com\mignari\animator\components\FrameList.as(125): col: 22 Error: Attempted access of inaccessible method setSelectedIndex through a reference with static type com.mignari.animator.components:FrameList.

代码:

SpriteList.as

package otlib.components
{

import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.ContextMenu;
import flash.ui.Keyboard;

import mx.core.ClassFactory;

import otlib.components.renders.SpriteListRenderer;
import otlib.core.otlib_internal;
import otlib.events.SpriteListEvent;
import otlib.sprites.SpriteData;

[Event(name="copy", type="flash.events.Event")]
[Event(name="paste", type="flash.events.Event")]
[Event(name="replace", type="otlib.events.SpriteListEvent")]
[Event(name="export", type="otlib.events.SpriteListEvent")]
[Event(name="remove", type="otlib.events.SpriteListEvent")]

public class SpriteList extends ListBase
{
    //--------------------------------------------------------------------------
    // PROPERTIES
    //--------------------------------------------------------------------------

    //--------------------------------------
    // Getters / Setters
    //--------------------------------------

    public function get selectedSprite():SpriteData
    {
        if (selectedItem)
            return selectedItem as SpriteData;
        return null;
    }

    public function set selectedSprite(value:SpriteData):void
    {
        selectedIndex = getIndexOf(value);
    }

    public function get selectedSprites():Vector.<SpriteData>
    {
        var result:Vector.<SpriteData> = new Vector.<SpriteData>();

        if (selectedIndices) {
            var length:uint = selectedIndices.length;
            for (var i:uint = 0; i < length; i++) {
                result[i] = dataProvider.getItemAt(selectedIndices[i]) as SpriteData;
            }
        }
        return result;
    }

    public function set selectedSprites(value:Vector.<SpriteData>):void
    {
        if (value) {
            var list:Vector.<Object> = new Vector.<Object>();
            var length:uint = value.length;
            for (var i:uint = 0; i < length; i++) {
                list[i] = value[i];
            }
            selectedItems = list;
        }
    }

    //--------------------------------------------------------------------------
    // CONSTRUCTOR
    //--------------------------------------------------------------------------

    public function SpriteList()
    {
        itemRenderer = new ClassFactory(SpriteListRenderer);
    }

    //--------------------------------------------------------------------------
    // METHODS
    //--------------------------------------------------------------------------

    //--------------------------------------
    // Internal
    //--------------------------------------

    otlib_internal function onContextMenuSelect(index:int, type:String):void
    {
        if (index != -1 && dataProvider) {
            var spriteData:SpriteData = dataProvider.getItemAt(index) as SpriteData;
            var event:Event;
            if (spriteData) {
                switch(type) {
                    case Event.COPY:
                        event = new Event(Event.COPY);
                        break;
                    case Event.PASTE:
                        event = new Event(Event.PASTE);
                        break;
                    case SpriteListEvent.REPLACE:
                        event = new SpriteListEvent(SpriteListEvent.REPLACE);
                        break;
                    case SpriteListEvent.EXPORT:
                        event = new SpriteListEvent(SpriteListEvent.EXPORT);
                        break;
                    case SpriteListEvent.REMOVE:
                        event = new SpriteListEvent(SpriteListEvent.REMOVE);
                        break;
                }

                if (event)
                    dispatchEvent(event);
            }
        }
    }

    otlib_internal function onContextMenuDisplaying(index:int, menu:ContextMenu):void
    {
        if (multipleSelected) {
            menu.items[0].enabled = false; // Copy
            menu.items[1].enabled = false; // Paste
        } else {
            setSelectedIndex(index, true);
        }

        if (hasEventListener(SpriteListEvent.DISPLAYING_CONTEXT_MENU)) {
            dispatchEvent(new SpriteListEvent(SpriteListEvent.DISPLAYING_CONTEXT_MENU));
        }
    }

    //--------------------------------------
    // Event Handlers
    //--------------------------------------

    override protected function keyDownHandler(event:KeyboardEvent):void
    {
        super.keyDownHandler(event);

        switch(event.keyCode) {
            case Keyboard.C:
                if (event.ctrlKey) dispatchEvent(new Event(Event.COPY));
                break;
            case Keyboard.V:
                if (event.ctrlKey) dispatchEvent(new Event(Event.PASTE));
                break;
            case Keyboard.DELETE:
                dispatchEvent(new SpriteListEvent(SpriteListEvent.REMOVE));
                break;
        }
    }
}
}

FrameList.as

package com.mignari.animator.components
{

import flash.ui.ContextMenu;

import com.mignari.animator.events.FrameListEvent;

import otlib.components.ListBase;
import otlib.core.otlib_internal;
import com.mignari.animator.Frame;

use namespace otlib_internal;

[Event(name="duplicate", type="com.mignari.animator.events.FrameListEvent")]
[Event(name="remove", type="com.mignari.animator.events.FrameListEvent")]

public class FrameList extends ListBase
{
    //--------------------------------------------------------------------------
    // PROPERTIES
    //--------------------------------------------------------------------------

    //--------------------------------------
    // Getters / Setters
    //--------------------------------------

    public function get selectedFrames():Vector.<Frame>
    {
        var result:Vector.<Frame> = new Vector.<Frame>();
        if (this.selectedIndices) {
            var length:uint = selectedIndices.length;
            for (var i:uint = 0; i < length; i++) {
                result[i] = dataProvider.getItemAt(selectedIndices[i]) as Frame;
            }
        }
        return result;
    }

    public function set selectedFrames(value:Vector.<Frame>):void
    {
        if (value) {
            var list:Vector.<int> = new Vector.<int>();
            var length:uint = value.length;
            for (var i:uint = 0; i < length; i++) {
                var index:int = getIndexOf(value[i]);
                if (index != -1) {
                    list.push(index);
                }
            }
            this.selectedIndices = list;
        }
    }

    //--------------------------------------------------------------------------
    // CONSTRUCTOR
    //--------------------------------------------------------------------------

    public function FrameList()
    {
        super();
    }

    //--------------------------------------------------------------------------
    // METHODS
    //--------------------------------------------------------------------------

    public function addObject(object:Frame):void
    {
        this.dataProvider.addItem(object);
    }

    //--------------------------------------
    // Internal
    //--------------------------------------

    otlib_internal function onContextMenuSelect(index:int, type:String):void
    {
        if (index != -1 && this.dataProvider)
        {
            var frame:Frame = this.dataProvider.getItemAt(index) as Frame;

            if (frame) {
                var event:FrameListEvent;

                switch(type) {
                    case FrameListEvent.DUPLICATE:
                        event = new FrameListEvent(FrameListEvent.DUPLICATE);
                        break;
                    case FrameListEvent.REMOVE:
                        event = new FrameListEvent(FrameListEvent.REMOVE);
                        break;
                }

                if (event) {
                    dispatchEvent(event);
                }
            }
        }
    }

    otlib_internal function onContextMenuDisplaying(index:int, menu:ContextMenu):void
    {
        if (!this.multipleSelected)
            this.setSelectedIndex(index, true);

        if (hasEventListener(FrameListEvent.DISPLAYING_CONTEXT_MENU)) {
            dispatchEvent(new FrameListEvent(FrameListEvent.DISPLAYING_CONTEXT_MENU));
        }
    }
}
}

ThingList.as

package otlib.components
{

import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.ContextMenu;
import flash.ui.Keyboard;

import mx.core.ClassFactory;

import otlib.components.renders.ThingListRenderer;
import otlib.core.otlib_internal;
import otlib.events.ThingListEvent;
import otlib.things.ThingType;
import otlib.utils.ThingListItem;

[Event(name="replace", type="otlib.events.ThingListEvent")]
[Event(name="export", type="otlib.events.ThingListEvent")]
[Event(name="edit", type="otlib.events.ThingListEvent")]
[Event(name="duplicate", type="otlib.events.ThingListEvent")]
[Event(name="remove", type="otlib.events.ThingListEvent")]
[Event(name="displayingContextMenu", type="otlib.events.ThingListEvent")]

public class ThingList extends ListBase
{
    //--------------------------------------------------------------------------
    // CONSTRUCTOR
    //--------------------------------------------------------------------------

    public function ThingList()
    {
        this.itemRenderer = new ClassFactory(ThingListRenderer);
    }

    //--------------------------------------------------------------------------
    // METHODS
    //--------------------------------------------------------------------------

    //--------------------------------------
    // Internal
    //--------------------------------------

    otlib_internal function onContextMenuSelect(index:int, type:String):void
    {
        if (index != -1 && this.dataProvider)
        {
            var listItem:ThingListItem = this.dataProvider.getItemAt(index) as ThingListItem;

            if (listItem && listItem.thing) {
                var event:ThingListEvent;

                switch(type) {
                    case ThingListEvent.REPLACE:
                        event = new ThingListEvent(ThingListEvent.REPLACE);
                        break;
                    case ThingListEvent.EXPORT:
                        event = new ThingListEvent(ThingListEvent.EXPORT);
                        break;
                    case ThingListEvent.EDIT:
                        event = new ThingListEvent(ThingListEvent.EDIT);
                        break;
                    case ThingListEvent.DUPLICATE:
                        event = new ThingListEvent(ThingListEvent.DUPLICATE);
                        break;
                    case ThingListEvent.REMOVE:
                        event = new ThingListEvent(ThingListEvent.REMOVE);
                        break;
                }

                if (event) {
                    dispatchEvent(event);
                }
            }
        }
    }

    otlib_internal function onContextMenuDisplaying(index:int, menu:ContextMenu):void
    {
        if (this.multipleSelected)
            menu.items[2].enabled = false; // Edit
        else
            this.setSelectedIndex(index, true);

        if (hasEventListener(ThingListEvent.DISPLAYING_CONTEXT_MENU)) {
            dispatchEvent(new ThingListEvent(ThingListEvent.DISPLAYING_CONTEXT_MENU));
        }
    }

    //--------------------------------------
    // Event Handlers
    //--------------------------------------

    override protected function keyDownHandler(event:KeyboardEvent):void
    {
        super.keyDownHandler(event);

        switch(event.keyCode) {
            case Keyboard.C:
                if (event.ctrlKey) dispatchEvent(new Event(Event.COPY));
                break;
            case Keyboard.V:
                if (event.ctrlKey) dispatchEvent(new Event(Event.PASTE));
                break;
            case Keyboard.DELETE:
                dispatchEvent(new ThingListEvent(ThingListEvent.REMOVE));
                break;
        }
    }

    //--------------------------------------
    // Getters / Setters
    //--------------------------------------

    public function get selectedThing():ThingType
    {
        if (this.selectedItem) {
            return this.selectedItem.thing;
        }
        return null;
    }

    public function get selectedThings():Vector.<ThingType>
    {
        var result:Vector.<ThingType> = new Vector.<ThingType>();
        if (this.selectedIndices) {
            var length:uint = selectedIndices.length;
            for (var i:uint = 0; i < length; i++) {
                result[i] = dataProvider.getItemAt(selectedIndices[i]).thing;
            }
        }
        return result;
    }

    public function set selectedThings(value:Vector.<ThingType>):void
    {
        if (value) {
            var list:Vector.<int> = new Vector.<int>();
            var length:uint = value.length;
            for (var i:uint = 0; i < length; i++) {
                var index:int = getIndexById(value[i].id);
                if (index != -1)
                {
                    list.push(index);
                }
            }
            this.selectedIndices = list;
        }
    }
}
}

Lorem Ipsum只是印刷和排版行业的伪文本。自1500年代以来,Lorem Ipsum一直是行业的标准伪文本,当时一位不知名的打印机拿起一个厨房,将其打乱成一本样本书。它不仅生存了五个世纪,而且在电子排版方面也取得了飞跃,但基本上没有改变。它在1960年代开始流行,发布了包含Lorem Ipsum段落的Letraset工作表,最近又发布了包括Alres PageMaker在内的桌面发行软件,包括Lorem Ipsum的版本。

0 个答案:

没有答案