This content has been marked as final. Show 3 replies
localconnection would be used if there are two swfs open in different browser windows or different applications. i don't see where you are doing that.
if you are loading an external swf into a main swf, you reference objects and variables using the correct relative or absolute path.
the main timeline in the main swf can always be referenced by _level0 from anywhere. so, if you want to reference a button in the main swf that's on the main timeline you would use:
if you yourButton is in a movieclip, mc, that's on the main timeline in your main swf, use:
Thanks for helping,
you are right, we have been using LocalConnection because we had two separeted SWF.
But now we have got another project where we will have one SWF loaded into it by loadMovie();
As we are new to Flash and ActionScript, what we really would like to know is how could we call a method in a movie clip located in the loader SWF, say mc_loader. We have created a new class (extended from MovieClip) and inserted a new method on it called dispatch(pValue:String).
then, from the loaded SWF we have tried, as you said,
_level0.dispatch("Test"), but the method/function is not being called.
Thanks very much
mc_loader must be a member of the class and must be on the main timeline of your loading swf.