Class Question

Hey all,
I am having trouble with classes and loading external files, specifically .jpgs.
I have a simple class, that looks like this,


dynamic class test extends MovieClip {
var nn;
function test() {
nn = this.num
trace(nn)
}
function onEnterFrame () {
trace(nn)
}
}

I have it attached to the stage, it traces nn repetitively until i load the jpg, when i load the jpg into it, it loses all of it class properties it seems…
it stops the onEnterFrame and the nn is no longer there.
Take a look at the fla to see what i mean…

NOTE: mx2004 only…

its not a class issue, its a loadMovie issue.

Whenever you use loadMovie on a movieclip it will lose all properties and methods assigned to it and is a “cleared” movieclip.

Instead, create an extra movieclip within your class movieclip symbol and load images into that

ohhh, i get it, thx!
I have another question also though…
It again has to do with classes (man am i having trouble with them…)
I made a class, and attched to the stage. ok cool everything works as it should. The problem is the buttons inside the MC that i attachted wont work at all. I narrowed it down to be the function onRollOver(){} that i have in my attached movie clip’s class. If i remove that all the buttons work great…
Any ideas on how to fix this?
PS, i am thinking about getting colin mooks book actionscript 2, have any of you used it/read it? if so what do you think?
Does it cover classes in great detail? Becuase thats the thing i am really having trouble with…

this is another common issue, just like the loadMovie. You cannot have button events for instances within movieclips that have button events them selves. The movieclip’s events will always over-ride the events of instances within it. You’ll just to have to not have an onRollOver for your class and instead use it in somethign else within your movieclip - another movieclip or more buttons, just like the buttons you have in there now.

oh, ok, thanks!