Skip to content

Instantly share code, notes, and snippets.

@tosik
Created July 29, 2013 07:45
Show Gist options
  • Select an option

  • Save tosik/6102706 to your computer and use it in GitHub Desktop.

Select an option

Save tosik/6102706 to your computer and use it in GitHub Desktop.
valueOf を使わずに Object が int に変換される例
package
{
import flash.display.Sprite;
public class Main extends Sprite
{
public function Main()
{
trace(int(new Foo).valueOf()); //=> 123
}
}
}
class Foo
{
public function toString():String
{
return "123";
}
}
@tosik
Copy link
Author

tosik commented Jul 29, 2013

int(new Foo) の段階で 123 になる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment