English 中文(简体)
表3:谅解备忘录概述缓慢/没有正确操作
原标题:as3: MOUSE_OVER is slow/not working correctly

Okay so Im仅从事3类工作(没有创作套或Xml)。 我有rite。 它带了一个大的 rec,然后稍微小的 rec。 我想改变一下,当我把 mo倒掉时,稍微小的 rec子的颜色。 现在,它要么不会做出反应(我完全可以 over忙,不发生任何事情),要么反应缓慢。 此外,试金星的碰撞区似乎是一个截断区,因此,当我对试金角的上左上角有 mo时,它的反应更频繁。

这里的任何途径都使用:

public function MAIN()
        {
   BUTTON_1.graphics.clear();
   BUTTON_1.graphics.beginFill(0x000000);
   BUTTON_1.graphics.drawRect(188,96,104,24);
   BUTTON_1.graphics.endFill();
   BUTTON_1.graphics.beginFill(0x0000DC);
   BUTTON_1.graphics.drawRect(190,98,100,20);
   BUTTON_1.graphics.endFill();
   addChild(BUTTON_1);
   BUTTON_1.addEventListener(MouseEvent.MOUSE_OVER,MOUSE_OVER_1);
   function MOUSE_OVER_1():void
   {
    removeChild(BUTTON_1);
    BUTTON_1.graphics.clear();
    BUTTON_1.graphics.beginFill(0x000000);
    BUTTON_1.graphics.drawRect(188,96,104,24);
    BUTTON_1.graphics.endFill();
    BUTTON_1.graphics.beginFill(0x0000A0);
    BUTTON_1.graphics.drawRect(190,98,100,20);
    BUTTON_1.graphics.endFill();
    addChild(BUTTON_1);
   }
}

如果能有更好的办法使我知道这一点,那么我就认为3点是新的。

最佳回答

我最后使用点击弹。

        if (BUTTON_1.hitTestPoint(mouseX,mouseY,true)) 
        {   

            removeChild(BUTTON_1);
            removeChild(TEXT_MENU_1);
            BUTTON_1.graphics.clear();
            BUTTON_1.graphics.beginFill(0x000000);
            BUTTON_1.graphics.drawRect(188,96,104,24);
            BUTTON_1.graphics.endFill();
            BUTTON_1.graphics.beginFill(0x0000A0);
            BUTTON_1.graphics.drawRect(190,98,100,20);
            BUTTON_1.graphics.endFill();
            addChild(BUTTON_1);
            addChild(TEXT_MENU_1);
        }
        else
        {
            removeChild(BUTTON_1);
            removeChild(TEXT_MENU_1);
            BUTTON_1.graphics.clear();
            BUTTON_1.graphics.beginFill(0x000000);
            BUTTON_1.graphics.drawRect(188,96,104,24);
            BUTTON_1.graphics.endFill();
            BUTTON_1.graphics.beginFill(0x0000DC);
            BUTTON_1.graphics.drawRect(190,98,100,20);
            BUTTON_1.graphics.endFill();
            addChild(BUTTON_1);
            addChild(TEXT_MENU_1);
        }
问题回答

该法典似乎不正确。 宣传活动的听众 用途 最终标为参数。 因此,您的《备忘录》概述1 应改为:Function式式《备忘录》>. 概述_1(e:MouseEvent): 避免





相关问题
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 ...

热门标签