When cycling the tank you should definitely have the media in the filter. You want to build up the bacteria all over the ceramic rings, glass spheres, or bio balls. You may omit the floss and carbon until you add fish. The entire idea of cycling a tank is to get as much bacteria colonized as possible before adding fish. This way your tank is off to a good start and can process waste immediately upon adding a fish. Leaving media out will cause the system to abort and begin cycling again as you won't have enough bacteria. The entire idea of using fused glass, ceramic or bio balls is the huge amounts of surface area that the bacteria can cover.
As to what order to stack them? Some use a heavy foam first to separate the largest particles. My filters start with ceramic rings first (this is where you'd put bio balls if using them) and then I use a heavy foam to separate the fused glass spheres. I separate that with a finer foam and sometimes cover this with carbon. I finally top it all off with fine floss to prevent any jamming of the filters pump.