How to suppress Flash migration warnings (1090)

后端 未结 5 1373
不知归路
不知归路 2021-02-20 13:30

In Flash Professional CS4, I get \"migration issue\" warnings when I use mouse/keyboard input handler names such as onMouseDown, onKeyUp, etc., even though I have added event li

相关标签:
5条回答
  • 2021-02-20 14:06

    What about changing the name of the function being called from onMouseDown to handlerOnMouseDown. Would it solve the issue?

    Are you using Flex Builder?
    If so, go to Project -> Properties -> Flex Compiler. There you can add arguments to the compiler.

    0 讨论(0)
  • 2021-02-20 14:17

    I agree with the previous post; the message is trying to tell you that you need to register that event handler. Just adding a method called onMouseDown() won't do it. What you need to do is to add something like

    addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    

    in either your constructor or maybe in the parent component.

    0 讨论(0)
  • 2021-02-20 14:21

    You can filter out these warnings using Flash Builder's problems filtering capability:

    • open problems view
    • on the right click on the small triangle that opens a drop-down menu
    • select Configure Contents...
    • on the left side, create a new configuration, name it as you wish
    • on the right side adjust its settings:
      • Scope: On any element in the same project (or anything you want)
      • Description: choose doesn't contain and type in Migration issue (this will filter out warnings with migration issue in the description)
      • choose at least Flex problems

    You can combine predefined and custom configurations by selecting more then one on the left side.

    0 讨论(0)
  • 2021-02-20 14:29

    You can if you edit EnabledWarnings.xml in $Flash/$LOCALE/Configuration/Actionscript 3.0/EnabledWarnings.xml, where $Flash is the path to Flash inside your Applications/Program Files folder and $LOCALE is your language.

    e.g.

    /Applications/Adobe Flash CS4/en/Configuration/ActionScript 3.0/EnabledWarnings.xml

    You will need to edit line 29, setting the enabled attribute to false for warning with id 1090:

    <warning id="1090" enabled="false"  label="kWarning_DepricatedEventHandlerError">EventHandler was not added as a listener.</warning>
    

    Quick sidenote:

    "Flash Builder (CS4)" is a confusing term. After Flex Builder 3, Flex Builder got renamed to Flash Builder, there is no Flash Builder CS4. The regular Flash IDE is known as Flash Professional/Flash Professional CS4, this was to avoid confusion between products with similar names: Flash Catalyst, Flash Builder(was Flex Builder), Flash Professional. Obviously it doesn't always work that great :)

    0 讨论(0)
  • 2021-02-20 14:30

    Why are you overriding that? It never existed in the first place. The error message is actually telling you something useful. Don't suppress it.

    If you want to create an event handler called onMouseDown, try something like

    private function onMouseDown(e:MouseEvent) : void {
      // statements
    }
    
    0 讨论(0)
提交回复
热议问题