Flex のすべてのコンパイラ警告を有効にして、コード内で解決したいと考えていました。しかし、解決方法がわからないという警告が1つあります。コード例を次に示します。
package lib
{
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
public class player
{
private function tmp(event:NetStatusEvent):void
{
}
public function player():void
{
super();
var connection:NetConnection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, tmp);
}
}
}
-warn-scoping-change-in-this でコンパイルすると、次の警告が表示されます。
/var/www/test/src/lib/player.as(16): col: 59 Warning: Migration issue: Method tmp will behave differently in ActionScript 3.0 due to the change in scoping for the this keyword. See the entry for warning 1083 for additional information.
connection.addEventListener(NetStatusEvent.NET_STATUS, tmp);
player() 内の関数として tmp を配置すると機能しますが、これは私が望むものではありません。this.tmp をコールバックとして使用しようとしましたが、違いはありません。誰かがこのコンパイラ警告を解決する方法を知っていますか?