Flash Vars not Loading

I am trying to access variables from an HTML wrapper which is playing my flash file. All other code seems to be working but this line is giving me a problem:

var loadedVars:Object = LoaderInfo(MyMovie.mainTimelineRef.loaderInfo).parameters;

where mainTimelineRef = MyMovie(this.root);

I obtained this structure from the Peter deHaan tutorial, and I am not an expert at actionscript by any means. If you need more information, let me know. I didn’t put in a lot of code here because it spans several files. If more information is needed I can provide it, but the above line seems to be where the problem arises.