@gioele-bencivenga
A little correction on accessing the user data, the line

var platform:Platform = i.int2.castBody.userData.data;

actually freezes the game on some occasions, so I swapped it for

var platform:Platform = i.int2.userData.data;

and this seems to be working better.