MX - I've got the idea, but I don't know how to do it

Hello, everybody!
I have one main “host” movieclip in which al the content (other swf-files) of my site should be loaded. That’s the part that works already.
But now I want to assign a script to this “host” movieclip that should do the following: First the script has to check the value of a variable in the swf that is loaded into my host-movieclip. Then, it should compare this variable with another one that’s in my main movie(swf). And depending on this, I want to let something happen. :crazy:
I’ll explain with an example: this is what I have:

-The main movie, named “main01”. Here, there’s a variable named “tag01”

-The ‘host’ movieclip, named “host01” This is the clip where I want to assign the script to.

-The external swf that loads into “host01”, named “visitor01.swf”. In this swf there’s a second variable, named “tag02”

So: when “visitor01” is loaded into “host01”, the script attached to “host01” should check the value of “tag02” and compare it with “tag01”

But I don’t know how to translate this in a working actionscript. So I hope there’s someone on this forum who can help me with this!