Groups | Blog | Home
all groups > flash actionscript > august 2004 >

flash actionscript : loadMovie question??


yoyoyoyoyoyoyoyok
8/28/2004 6:44:19 PM
I have loaded another swf into a scrollPane using this code. I was wondering if
I can use buttons in the picture1.swf to change dynamic text boxes and MCs in
the main SWF

Thanks


btn_arr = new Array("Btn_Sub1", "Btn_Sub2", "Btn_Sub3", "Btn_Sub4");
for (i = 0 ; i < btn_arr.length ; i++)
{
this.options[btn_arr[i]].onPress = function ()
{
duplicateMovieClip(scroller, "contentSP", 100)
createEmptyMovieClip("holder", 200);
holder._x = 350;
holder._y = 50;
holder.loadMovie("picture1" + ".swf");
onEnterFrame = function ()
{
contentSP.setSize(550, 140);
if (this.holder._width > 0)
{
contentSP._x = 0;
contentSP._y = 260
contentSP.setScrollContent(holder);
}
}
}
}
maxil
8/29/2004 1:15:16 AM
Yes you can, just target it by instance name or _level as you would any other
time. Using relative targets, _parent, would probably be the best option.

Also I noticed in your code you are using an onEnterFrame event to monitor the
width of a clip, don't forget to delete the onEnterFrame when the clips width
is > 0

onEnterFrame = function ()
{
contentSP.setSize(550, 140);
if (this.holder._width > 0)
{
contentSP._x = 0;
contentSP._y = 260
contentSP.setScrollContent(holder);
delete this.onEnterFrame
}
}
AddThis Social Bookmark Button