This content has been marked as final. Show 3 replies
There's really no way to know why it worked in this instance without the
context, as 'this' refers to the currently executing scope. You should get
in the habit of using it though, as it can help you to know your intentions
six months later when you open your file - ie you know into which
timeline/scope you want to load. I'd also suggest ditching loadMovie and
using the much better MovieClipLoader class.
Adobe Community Expert
It's a good question, and I'd be curious to know the definitive answer. According to the Flash docs there is the loadMovie global function and the loadMovie method of the movieclip class.
Just about every example I could find in the docs uses the global approach. So to have a case like this where one works and the other doesn't, it would be good to know why. What is the difference in context that leads to this. The program apparently knows what that is, so whoever designed the program probably knows what it is, so it should be explainable.
Unfortunately, the mystery may remain since there's probably enough on their plate to figure out what's going on in the present, nevermind digging into the past to better explain it.
Well this.loadMovie("howto.swf",howto) shouldn't work the same at all as loadMovie("howto.swf",howto).
So my guess is that the movieclip instance howto wasn't created when the first one was trying to load howto.swf into the instance of howto. Because that is what that one is trying to do.
The next one is trying to load howto.swf into this and pass a GET or POST which is most likely undefined.
To use the second one in the same way as the first one it should probably look like:
So, I'm just guessing here, but...I think the reason this works is because it provides loadMovie a qualified movieclip instance, whereas your other one isn't working because howto isn't a valid movieclip at the time the statement is called.
In any event it really is time to stop using loadMovie and start using the MovieClipLoader class. Really!