Students screamed and chanted "Spiderman" as the two actors worked the young crowd at Commonwealth Secondary School, high-fiving them and handing out baseball caps.
The school visit was organised by the World Wildlife Fund Singapore which complimented the school's strong eco programme.
Garfield and Foxx were also invited to plant a tree in the school's garden, where Foxx joked around with his watering can by trying to drink from it.
The star of The Amazing Spider-Man 2, Andrew Garfield, was recently announced as the first 'Super Hero' ambassador for World Wildlife Fund's (WWF) Earth Hour. He is set to turn off the lights at the landmark Marina Bay Sands in Singapore, where Earth Hour is based.
Launched by the WWF in 2007, Earth Hour encourages communities, households and businesses across the globe to make a pledge to reduce their impact on the planet by turning off non-essential lights for one hour.