Good morning;

Do any 1 here know how to get the value stored in a global variable from other movie?
to use it in current movie?

Example:
in movie one.dir
there is a global called name
stored the name

in movie two,dir
i need to use that global name
to be in the code

how to do it???

GreenDay2001 commented: Your question made me experiment with flash after long time. +4
Member Avatar for GreenDay2001

Nice Question. Never thought of that. Anyway after doing a bit of experimenting, I come to this conclusion.

As soon as external movie is loaded, you could retrieve the data ( not necessarily global ) from that clip, using regular syntax for accessing variables.

Suppose you do this. It wont work.

_root.mo.loadMovie("test2.swf"); // mo is movieclip
trace(f);    // f is global var in test2.swf

I don't know but why the movieclip "mo" doesn't get loaded when trace(f) is reached.

Now, now add this somewhere _root.mo.loadMovie("test2.swf"); like _root.onLoad and in another move clip which will be used as button I add this

onClipEvent (mouseUp) {
	trace(f);
}

Then it would work.

In this case the external movie is loaded. So for now the second one is the solution available. If you want to update the data regularly, use EnterFrame clipEvent. If you get any other solution, post here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.