HINT 1: The easiest way to solve this problem is to think of it in 2 dimensions instead of 3. Imagine making the room out of a peice of cardboard. There are several different ways that a single piece of cardboard can be cut so that is can be folded to form a rectangular box. Try drawing these shapes on a piece of paper. Take care to think about where spider and the fly should be marked on these diagrams.
HINT 2: There are in fact two completely different routes (each of different length) that the spider can take that are shorter than 42 feet.
HINT 3: Dudeney chose the numbers 30 and 12 for a good reason. If your solution does not make his reason for choosing these numbers obvious, it's almost certainly wrong.