#"Electronegativity"# is conceived to be the ability of an atom involved in a chemical bond to polarize electron density towards itself. There are various scales, of which the Pauling Scale was the earliest, and is still most widely used. Pauling used actual atomic parameters, such as ionization enthalpies and electron affinities to get an approximate scale, which he then normalized so as to give useful (near) whole numbers. AS you know, there are other electronegativity scales..........
On the other hand electron affinity is a MEASURED quantity, and this is the enthalpy change when one mole of gaseous atoms are reduced to form one mole of gaseous anions; i.e. the enthalpy change for the following process,
#Delta# may be positive or negative depending on the nuclear charge. Elements that are late in the Table (i.e. towards the right of the Periodic Table as we face it) tend to have high electron affinities, i.e. for the halogens and chalcogens, the given process is exothermic, as we would expect for atoms with high nuclear charge, which are unshielded by full electronic shells.
Of course, Pauling used such measurements when he constructed his original electronegativity scale.