I don't think bytesLoaded and bytesTotal are part of the meta
data. So the two things are separate issues.
onMetaData happens once, whereas the bytesLoaded property
would obviously change over time and will need to be read many
times. And evidently bytesTotal changes as well.
The main answer is you get -1 because that is the answer you
get. Not so helpful, but really it is the answer. This same problem
has stumbled people making preloaders for loadMovie for many years
as well.
Since the bytesLoaded and bytesTotal will sometimes read 0,
sometimes read -1, and eventually get to their correct values, you
have to add something that basically checks to make sure they are
greater than 0 before you try and rely on them.
I guess the big question is, "What are you trying to do?"
Since you are using the NetStream class, you should probably look
at onStatus and use that to tell when things are buffering, etc.
Otherwise I'm not quite sure why you would be looking at
bytesLoaded.