开发者

1046: Type was not found or was not a compile-time constant:Button

package 
{
    import flash.display.MovieClip;
    import flash.display.NativeWindow;
    import flash.display.NativeWindowInitOptions;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.SimpleButton;


    public class PencereyiGizle extends MovieClip
    {
        public开发者_运维技巧 var natWindow:NativeWindow=new NativeWindow(
        new NativeWindowInitOptions());
        public var pencereyiAc_Btn:Button;

        public function PencereyiGizle(fro:Button)
        {
            pencereAc_Btn = fro;
            //Pencere ekleniyor
            natWindow.width = 500;
            natWindow.height = 400;
            natWindow.activate();
            natWindow.addEventListener(Event.CLOSING,pencereyiSakla);
            pencereyiAc_Btn.label = "Pencereyi Ac";
            pencereyiAc_Btn.addEventListener(MouseEvent.MOUSE_DOWN,pencereyiAktifEt);
        }
        //pencerenin kapanmasını engelleyip pencereyi gizliyoruz.;
        private function pencereyiSakla(e:Event):void
        {
            e.preventDefault();
            natWindow.visible = false;
        }

        //gizlenen pencereyi tekrar aktif hale getiriyoruz
        private function pencereyiAktifEt(e:MouseEvent):void
        {
            natWindow.activate();
        }
    }


}

IN AIR;

import PencereyiGizle;

var firat:PencereyiGizle= new PencereyiGizle();
addChild(firat);

and then, i get that problem "1046: Type was not found or was not a compile-time constant:Button. "


Based on what is in your imports, I think you want to use the SimpleButton class and not the Button class. (Which is a flash component)

Either that or you are missing this import

import fl.controls.Button;

Here is an artilce from adobe on the button component. http://www.adobe.com/devnet/flash/quickstart/button_component_as3.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜