You want to spawn on all the four borders?If so,
Condition: -Spawn object on X -Random(1024) ,Y- 1 (Upper Border)
-Spawn object on X -Random(1024) ,Y- 576 (Lower border)
-Spawn object on X -1 ,Y- Random(576) (Left border)
-Spawn object on X -1024 ,Y- Random(576 (Right Border)