to access a variable in the main timeline, you have to put the keyword _root in front of it. I tried to explain how it works in the as tricks section.
And to access a variable inside an object from that timeline, you have to give an instance name to the object (look for a tute here) and then write the path to the variable: