I need help whit loadet data!

Hy! I’m searching a way to listen to a loader, that he has something in it, or not? There are two listeners who are calling the same function, wich is seting the x and y position of the loaded content. One is listening for the complete event, then calls the function, the otherone is listening for the resize of stage, and allso calls the same function. The problem is, when a resize is happening, whit no content loaded, I get runtime error. It does not affect the webpage, but i would the resize listener to call the positioning fonction only if there is data in the loader(and mc).

i tried

if (loader.content > 0) {
add the event listener
}

but this is an incorrect condition, becous of the two diferent data types. Is tehere a way to make this work? In this case it’s no problem, but there might be a case when it means problem.