View Full Version : communicating between external swf
shadow7
11-05-2005, 02:21 PM
hi all
sorry im really new with actionscript
but anyways, say if I got parent.swf and I loaded a child.swf using loadMovie(); function and in the child.swf file I got a movieClip instance called “box” if I want the change the property (eg._alpha) of that “box ” from the parent.swf how would I code it.
hope I didn’t made it too confusing
Any help appreciated
shadow7
11-06-2005, 04:12 AM
i've tried using
loadMovie("child.swf", myTargetClip);
myTargetClip.box._alpha = 50
but somehow it didnt work with external files
oldnewbie
11-06-2005, 06:01 AM
You have to wait till the child.swf, is fully loaded, to change the property of that movie itself (or of one of it's movie clips), from the parent movie.
You can't change a property of something that doesn't exist, and it will only exist when the child.swf is fully loaded.
thelbr2004
11-06-2005, 06:38 AM
one way that you can try is to create an empty movie clip load the movie into the empty movie clip and then adjust the alpha of the empty movie clip
something like this
my_mc.createEmptyMovieClip("addMovie_mc", 1);
addMovie_mc._alpha = 50
my_mc..loadMovie("ENTERFILEHERE.swf", "addMovie_mc");
this might help you out
This code will not change the alpha of the movie that you are trying to load. it will change the alpha of the movie clip that you are loading your external into thus, changing the alpha of that swf as well and best of all you dont have to wait until it loads
oldnewbie
11-06-2005, 07:16 AM
one way that you can try is to create an empty movie clip load the movie into the empty movie clip and then adjust the alpha of the empty movie clip
something like this
my_mc.createEmptyMovieClip("addMovie_mc", 1);
addMovie_mc._alpha = 50
my_mc..loadMovie("ENTERFILEHERE.swf", "addMovie_mc");
this might help you out
This code will not change the alpha of the movie that you are trying to load. it will change the alpha of the movie clip that you are loading your external into thus, changing the alpha of that swf as well and best of all you dont have to wait until it loads
Problem with that suggestion, is that the whole loaded movie will be at 50% alpha, and not just that "box" mc within that loaded movie!
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.