English 中文(简体)
文本的实地突破备忘录概述
原标题:TextField breaking MOUSE_OVER after moving it

我对《谅解备忘录》——监督活动有真正的问题。 I m 建造能动的表格,代表歌唱歌,其中载有带有淫fo和有活力的画面。 我正试图获得一份简单的《备忘录》。 总体情况,你们可以选择下一代歌。

我使用的是字母0的缩略语,把我整个表格(包括文字现场)作为备忘录——概述和——成果的名录。 我通过将甲状腺打上了眼光,实际上覆盖了我的表格,并在我搬走时紧跟着它(确保我不会把该表移走,而不会移动热点)。 而且,我只是在装满我的封条时,才创立这一条,确保它也能涵盖这一点。

现在,当该表处于顶端时,一切都已经dan。 当我搬上桌子,为下台铺设空间时,案文领域就打破了我的滚动行为......就好像是,在你重新聆听MouseEvents时,就把间谍传给你。 但是,......滚动区仍然位于实地之上,我提出可以选择的、可以假装在案文领域......无。

仅仅把整个表格移至现在就把案文放在正文。 我的表象中所有东西方位居首位(视像地看,它仍在预期的层次上)。

我是用餐厅做的,但用系统字体进行审判的,我的证人就是这样做的。

public function Tab(tune:Tune) {
    _tune = tune;
    mainSprite = new Sprite();
    addChild(mainSprite);
    drawBorder();
    createFormat();
    placeArtist();
    placeTitle();
    placeAlbum();
    coverArt();

}

private function placeButton():void {
    _button = new Sprite();
    _button.graphics.beginFill(0xFF000,0);
    _button.graphics.drawRect(0,0,229,40);
    _button.graphics.endFill();
    _button.addEventListener(MouseEvent.MOUSE_OVER, mouseListener);
    _button.addEventListener(MouseEvent.MOUSE_OUT, mouseListener);
    _button.buttonMode = true;
    mainSprite.addChild(_button);
}

private function mouseListener(event:MouseEvent):void {
        switch(event.type){
            case MouseEvent.MOUSE_OVER :
                hilite(true);
                break;
            case MouseEvent.MOUSE_OUT :
                hilite(false);
                break;
        }
}

private function createFormat():void {
    _format = new TextFormat();
    _format.font = "FFF Neostandard";
    _format.size = 8;
    _format.color = 0xFFFFFF;
}

private function placeArtist():void {
    var artist : TextField = new TextField();
    artist.selectable = false;
    artist.defaultTextFormat = _format;

    artist.x = 41;
    artist.y = 3;
    artist.width = 135;
    artist.text = _tune.artist;
    artist.mouseEnabled = false;
    mainSprite.addChild(artist);
}

private function placeTitle():void {
    var title : TextField = new TextField();
    title.selectable = false;
    title.defaultTextFormat = _format;

    title.x = 41;
    title.y = 14;
    title.width = 135;
    title.text = _tune.title;
    title.mouseEnabled = false;
    mainSprite.addChild(title);
}

private function placeAlbum():void {
    var album : TextField = new TextField();
    album.selectable = false;
    album.defaultTextFormat = _format;

    album.x = 41;
    album.y = 25;
    album.width = 135;
    album.text = _tune.album;
    album.mouseEnabled = false;
    mainSprite.addChild(album);
}

private function drawBorder():void {
    _border = new Sprite();
    _border.graphics.lineStyle(1, 0x545454);
    _border.graphics.drawRect (0,0,229,40);
    mainSprite.addChild(_border);
}

private function coverArt():void {
    _image = new Sprite();
    var imageLoader : Loader = new Loader();

    _loaderInfo = imageLoader.contentLoaderInfo;
    _loaderInfo.addEventListener(Event.COMPLETE, coverLoaded)

    var image:URLRequest = new URLRequest(_tune.coverArt);
    imageLoader.load(image);
    _image.x = 1.5;
    _image.y = 2;
    _image.addChild(imageLoader);
}

private function coverLoaded(event:Event):void {
    _loaderInfo.removeEventListener(Event.COMPLETE, coverLoaded);
    var scaling : Number = IMAGE_SIZE / _image.width;
    _image.scaleX = scaling;
    _image.scaleY = scaling;
    mainSprite.addChild (_image);
    placeButton();
}

public function hilite(state:Boolean):void{
    var col : ColorTransform = new ColorTransform();
    if(state){
        col.color = 0xFFFFFF;
    } else {
        col.color = 0x545454;
    }
    _border.transform.colorTransform =  col;
}
问题回答

固定。 正在发生的情况是,我没有打上字幕的高度。 这 over倒了该表,因此lying倒了以前即刻的表格,阻止了MouseOver......甚至不问。





相关问题
Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Sorting twodimensional Array in AS3

So, i have a two-dimensional Array of ID s and vote count - voteArray[i][0] = ID, voteArray[i][1] = vote count I want the top 3 voted items to be displayed in different colors, so i have a 2nd Array -...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签