View Full Version : _root inside target
xzyfer
April 29th, 2003, 04:28 AM
ive loaded a movie into another and postitioned it..
_root.abc._x="400";
_root.abc._y="200";
_root.abc.loadMovie("trig_sub.swf");
but once it is loaded where ever i have used _root in the loaded movie (trig_sub.swf) it nolonger works
eg..
on a button i have
on(rollOver){
_root.menu.stop();
}
bnut this dosent work when it has been loaded into instance "abc" in the main movie...
wat do i have to use instead of root to point at an instance?
kode
April 29th, 2003, 04:39 AM
yup... you'll need to fix the addressing. :-\
here's a little trick http://www.kirupa.com/developer/actionscript/tricks/relativeaddressing.asp
xzyfer
April 29th, 2003, 05:19 AM
ok...
heres i understand wat is being said...
in the main time line of the movie to be loaded (trig_sub.swf) i place: _global.myAppMain = this;
and then everywhere i used _root i just delete the _root and put myAppMain instead.?
have i got this right, because i cant get it working..
kode
April 29th, 2003, 05:23 AM
yes. you got it right... and it works. :-\
keep trying. or attach your files. ;)
xzyfer
April 29th, 2003, 05:25 AM
question...
if i have a dynamic textbox with the var name "bob".
and i later state
myAppMain.bob="hello";
this should work right>...
kode
April 29th, 2003, 05:29 AM
is "bob" the instance name of the TextField or you assigned "bob" to the variable of the TextField?
if it's the variable... it should work.
if it's the instance name... you use
myAppMain.bob.text = "hello";
=)
xzyfer
April 29th, 2003, 05:34 AM
nah i have created a dynamic text box..made it non-selectable and insisde an MC with the instance name "menu" i have put
myAppMain.bob="hello";
and the varible name of the text box, under properties, is bob.
but it just turns up blank.
aslo in _root>menu>1-10 i have a button and i told it one mouse over to myAppMain="goodbye?";
neither of which have any affect...
y?
xzyfer
April 29th, 2003, 05:36 AM
i menat to put myAppMain.bob="goodbye?";
kode
April 29th, 2003, 05:39 AM
well, obviously there's a problem... could you attach the files? :P
xzyfer
April 29th, 2003, 05:40 AM
ijm not familer with that....
how would i do it...?
kode
April 29th, 2003, 05:44 AM
click here <a href="newreply.php?s=&action=newreply&threadid=21919"><img alt="you'll be able to attach your files if you click here" src="images/post_reply.gif" border="0" width="90" height="25"></a>
xzyfer
April 29th, 2003, 06:07 AM
sorr y i though he ment in flash..
i cant load them their too big put u can get them here..
http://144.136.39.3/flash/
xzyfer
April 29th, 2003, 07:16 AM
any luck guys?
kode
April 29th, 2003, 01:39 PM
sorry, i can't download the files... i got a gateway timeout. :-\
xzyfer
April 30th, 2003, 02:08 AM
sorry about that guys..
alls better now..
http://144.136.39.3/flash
upuaut
April 30th, 2003, 03:13 AM
also useful (sometimes more so) is the "_parent" property.
_parent refers to the timeline that contains the timeline with the _parent reference.
ie mc1 contains mc2 which contains mc3
from mc3, _parent._parent._name would return "mc1"
kode
April 30th, 2003, 03:27 AM
you have to publish the swf to flash 6 version, not flash 5. :-\
otherwise you'll need to use _parent, as david suggested. ;)
xzyfer
April 30th, 2003, 04:16 AM
yer i finally figure it out..
thx guys/..
kode
April 30th, 2003, 04:29 AM
no problem. :P =)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.