_root?
Can anyone give me a good explanation of what _root is for and when the appropriate times are to use it?
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 04-17-2003, 10:01 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_root.play() / _root.gotoAndPlay() Not Working
Hi,
I am working on an interactive movie, the movie consists of a number of small movie clips. I need each clip to play and when it reaches it’s end stop and tell the main time line to move to next frame, on that frame the next MC will [play and do the same.
I am trying to use this script for the last frame of the movie:
_root.play()
I also tried “_root.gotoAndPlay()” and “_root.nextFrame()
It doesn’t seem to work.
Anyone has any idea why ???
Loading .swf To _root And Performing Actions On _root
Hello, I have a loader which should load a movie which should be placed on the _root so that all of it's actions will still work. also, i need to perform some actions on the _root which is specified in my loader. f.eks. say I load my movie at _level0 and then I trace "movieLoaded" all the time.
And I use flash MX
This _root And That _root, Parents, Children, LoadMovie...
I'm building a showcase to show a bunch of my work. Let's call my work "children" and the showcase file the "parent".
A lot of the children files have some actionscript that references functions and variables on the root level. However, when those files are loaded into the parent file, the root is now the root of the parent file, not the child file.
SOME of the stuff, I've been able to remedy by opening each flash file and copying and pasting all that crud into the shell flash movie.
Unfortunately, not all of my wizardry is working, and hey, who knows what's wrong. Since the individual files each have functionality that works on it's own, is there some way of telling those children files to look at the root ONLY on their own file, or, as soon as the swf is loaded, the root is changed?
How can I avoid this in the future?
ALSO, is there some way to globally override the "getURL" function call so any and all clicks are now dead links?
_root.link / _root.page Help
hi gang, ive got a flash template im trying to edit for a friend, id say im fairly good at flash ive made alot of sites with actions but having trouble with this.
the problem i have got is the _root.link=
this is the action script:
on (release) {
if (_root.link <> 8) {
_root["page"+_root.page].gotoAndPlay("w2");
_root.link = 8;
_root.page = _root.link;
}
}
(there was more but that was just controling the button animation, ive just posted this to keep it simple , for me atleast)
what im having trouble doing is working out where the route is?
i want to be able to creat another movie and link it
eg:
on (release) {
if (_root.link <> 9) {
_root["page"+_root.page].gotoAndPlay("w2");
_root.link = 9;
_root.page = _root.link;
}
}
how would i lable the movie to be '9' where would i do this, i have looked and ive had no joy, some help would be good, if u need more info from me please do ask
_root._root[eelmine].nextFrame(); ?
if a condition is true, then:
_root.(MC with instance name that is the value of "_root.eelmine").nextFrame();
is this correct?
_root._root[eelmine].nextFrame();
_root._root[eelmine].nextFrame(); ?
if a condition is true, then:
_root.(MC with instance name that is the value of "_root.eelmine").nextFrame();
is this correct?
_root._root[eelmine].nextFrame();
_root._root.testbox?
I have this small problem.
I have 2 swfs(main.swf and links.swf)
I then load links into main. In links I loadvar using php and sql.
I fetch links from my sql databas and print it in php.
But it doesnt work when I load links into main.
It only works when I view links.swf directly.
Example:
links.php
databas connection etc etc
mysql query etc etc
print"&name=$name";
print"&link=$link";
print"&status=DONE";
in flash(links.swf)i then have this:
status = "LOADING";
loadVariablesNum("links.php", 0, "POST");
if (status eq "LOADING") {
gotoAndPlay (_currentframe-1);
} else {
gotoAndPlay (2);
}
I have 3 dynamic boxes called:name,link and status.
and a stop() on frame 2.
So how do I get this to work? I´m sure you guys know the answer to this.
I also have another question.
When I look at the links.swf directly only the first post appears and I want the whole list so that the user/visitor can scroll the link list. How do I loop that in flash or is it in php/sql It should be done and if so,, how would the php code look like.
Would this work?
$query="select * from links";
$result=mysql_query($query);
$name=mysql_result($result,"name");
$name=mysql_result($result,"link");
print"&name=$name";
print"&url=$link";
print"&status=DONE";
How do I then make the name linkable?
I can only have one dynamic box in the flash right?
So that the name flashkit is the link to flashkit.
Please help me with the above,, really need to get this to work.
_root._parent.? Problem With "_root" Etc
I have been using flash for some time now and understand basic actionscript. However only just recently(last few days), i have gone onto more advanced stuff like cursors (advanced for me )
Well i am making a flash movie that incorporates all of my testings for people to see.
I am current;y working on a movie where the cursor is a knife, and when the cursor goes over this picture of someone, the knife (cursor) should go to and play the second frame of the knife (cursor) which has added blood.
I.e, when the mouse goes over the picture, the knife becomes a picture with blood, so in effect you are stabbing the picture. (don't worry, i'm not a sadist!)
At the moment my movie is like this...
drag drag2
(pic) (knife)
^ ^
| |
<<drag_mc>>
^
|
Scene 1 -----> navigation...
(root?)
Description: The scene one has two movies in it, "navigation" (which is OK) and the "drag_mc". The "navigation" is fine so i won't go into that. The "drag_mc", then has two movie clips in it, "drag" and "drag2".
I assume that to make the "drag2"(cursor) go to frame 2 when it hovers over "drag"(picture) that the "drag" should have a on(rollover)
command. I've put in the command, but i'm having troubles linking that to the "drag"'s frame 2.
I have just messed about with _parent and stuff, but never understood it.
Please could someone help me here, and/or tell me exactly how the _root and stuff works??
P.S. the on (rollover) is actionscript for the drag movie, and not in the movie if you get what i mean....
---newbie in distress---
EDIT: the picture did not come out as planned, but it is still readable. Just remember that the two movies ("drag" and "drag2") are placed in the "drag_mc" movie
A Button In A MC In Frame 1 Of _root Hiding An MC In Frame 2 Of _root?
Hi. I have a button, "auroraB" in a movie clip "startupMC" which is in frame 1 of _root. There is another MC, "scenic" in frame 2 of _root.
The button "auroraB" is clicked and takes the user to frame 79 of the MC in frame 1. From there the user clicks another button to go to frame 2 of the _root.
How do I get it to hide MC "scenic" in frame 2 of _root when the button "aurroraB" is clicked? Thanks
_root.send1.text = _root.total3.text;
Ok I have this script in a Movie Clip! First frame has
_root.send1.text = _root.total3.text;
2nd frame
gotoAndPlay(1);
So it updates!
Both send1.text and total3.text are input text fields in Flash! When I test this out it works fine but when I get it up online it doesn't work! The information in total3.text doesn't get sent to send1.text!! Also note both have Var titles asigned to them! Let me know if you can figure out what's wrong! Thanks!
Convert "_root" To _root
anyone know how to convert a string "_root" to the path specifier _root???
The Object() converstion function doesn't seem to be doing the trick..
hmmm
any help would be appreciated
cheers
"_root.MCname" + "_root.MCvalue"
Hallo,
how can I grab the value contained within a MC name, e.g.:
Code:
duplicateMovieclip(_root.myMC, "_root.myMC"+someIntegerVariable, level);
_root.myMC+someIntegerVariable._x = 100;
It happens that the parser cannot parse the second row, since
"Left side of assignment operator must be variable or property".
My target is to make the sum of two instance names as a single instance name.
thank you very much!
s---
_root?
hello
i have a clip inside a clip.. and in THAT clip i have a button that want to close the MAIN clip to be removed from the main time line.. it is located there....
doesent work with :
on (release) {
removeMovieClip (_root.news);
_root
Help I've got some flash 5 code that I have to edit yet I don't know flash 5 code well enough.
The problem is that all the code is referencing the _root directory, but I need to put it into another file. Now when I was using flash 4 code I would simply use relative references, but I don't know how to move outside of a file in flash 5. For Flash 4 I would go ../blah.
How can I do this???
Please help
What Is _root?
i have a movie with many Mc controlled by tell target action in it.now i want to add preloader scene to this movie.when i add the scene ,it works fine but in the movie some buttons in the MCs have goto _root and play <frame no.> these button send the movie to preloader,why???
what is root for the flash player---the maintime line of the scene it is right now OR maintime line of the first scene???
_root.a._x Eq -271 {
if (_root.a._x eq -270) {
stop ();
} else if (_root.a._x ne -270) {
gotoAndPlay (21);
}
Can someone tell me what's wrong with this if anything?
It should be working.. i dont get it..
-Paradoxz
_root
I'm reading and reading and I still don't understand for what is the _root on Flash.
And I neither understand the function of with (I used Tell Target).
Bye::::::::::::
Help With '_root'
Erm, I got this from a previous post....
_root.MUSIC.gotoAndPlay("MUSICOFF")
What would I do if I wanted it to be the same but to level 7??
_root
Where is the _root command in the actionscript menu
If _root ?
Hello friendly flashers,
I have a new problem.;-)
Here is the idea.
It has to be a check for a button. And then goto the correct frame.
if it's onframe 1 goto frame 40
on (release) {
tellTarget ("_root") {
gotoAndPlay (40);
if (_root) {has to check frame 2
tellTarget ("_root") {
gotoAndPlay (41);
}
}
}
}
Hope you understand my question.
Thanks in advance
J
_root Help
i'm desiging a website for my friend. on request, i made all buttons in a movie clip that have pull down buttons. a nifty trick, but i cannot get the buttons to work properly.
i use normal mode, and it hasn't worked properly. i've heard that to function, it needs the _root. command, but i have fooled around with it and am better off asking for some real help. if you could get one button to work, i could copy/paste/edit for the others.
i'd like the buttons to work when pressed. the content is on scene1.
please help
stews
_root. What? Please Help
hey flashers,
ok, i have a movie clip, inside the movie clip is a button that when clicked, is supposed to load a movie into a blank movie clip on the main timeline. its not working as you probably figured. I gave the blank movie clip on the main timeline an instance name of "dtext". the action script i have for the button is this.
Code:
on (release) {
loadMovie ("dynamic text box.swf", "dtext");
}
i know it has something to do with that .root command, but i cant figure it out. where does the root command go, and is there anything else i am doing wrong? please help.
Jacob
_root?
I want to go down multable levels in movie clips.
and i thought you use root and give each movie an instance name. so like
_roor.movie1.movi2.gotoAndPlay(5);
but it does not do anything, am i writing the code wrong
_root.?
what's the difference b/w for example -root.gotoAndPlay() and gotoAndPlay()?
Something Other Than _root ?
I'm that annoying guy who asks questions about every little detail without trying it himself, but this time, i swear, i have a legit question.
I'm using some script to fade out a sound...i found a post here that was WAY helpful. One problem though. I'm using: _root.interClip.s.setVolume(25); This works when fading sounds in the same scene. BUT, i want to fade a sound from another scene. is there something other than _root I need to be using?
Thanks!!!
To _root Or Not To _root
Here's a dilemma...
I'm building an online course that uses a navigation function (menu buttons) as a movie, hence the links use _root to specify the frames to jump to.
Here's the problem. These functions work when they are standalone but when I upload it as a swf inside an html page, it refuses to recognize the _root functions.
Any comments!!!
_root.
What's the root action?!
I have a button in a movieclip and I want that button to link frame nr. 76 in my main timeline, not nr.76 in the movieclip where the button is placed in...
i think it's something like: _root.scene1.GotoAndplay(76) but I'm not shure, let me know something ASAP !
THNX,
Wouter
_root.
hi all,
I am writing an action in a movie clip to read a particular variable(in the movie) is 1 or 0.
if (_root.Number(a1)==1) {
play();
} else {
stop();
}
something is not right, as its not working can someone tell me if there is a problem with the script?
thanks
nixthinx
_root
on (release) {
_root.home_mc.help_mc.gotoAndStop(1);
}
I have a button name Help out side of the movie clip but it just wont load that like...
and I don't want to move the button and put it inside the movie clip.
any suggestions?
_root
Here is my situation. Im a beginer in AS. I have a window that scrolls a MC wich has a bunch photo clips. When a user clicks one of these photos I want it to display the photo enlarged in a window above the scrolling window. All the large photo's are in the main time line on seperate key frames with stop actions. How do I tell the button wich is the "photo clips" to go the main time line and stop on specific key frame?
Any help would be apreciated. Because I kinda suck at AS syntax.
_root.?
Hi,
Need to understand how this work, why must use
_root.walk_bgclp.gotoAndPlay("start"); and not just gotoandplay("start")? what is _root. for?
Thanks
_root?
I have a loader on my main ' _root ' that counts the bytes of the _root obviously. I also want to use this loader on a movie that is being loaded into a target. I put the loader in the ' _root ' of the movie being loaded, but I need to change the code. I'm not sure what to put. I've tried ' _level2 ', but that's not working.
_root.getBytesTotal()
_level2.getBytesTotal() *Not working.
My target name is 'mcload '.
mcload.getBytesTotal() *Not working.
Any recommendations?
Getting The _root._y From Within A MC
How can I tell if a movie clips _y property is below a _y property of the root? This is for Flash 5.
The part that i need help with is on the second line.
Code:
onClipEvent (enterFrame) {
if (this._y>????????) {
this._y=0;
} else {
if (this._rotation == 0) {
move = -1;
}
if (this._rotation == -45) {
move = 1;
}
this._rotation = this._rotation+move;
this._y = this._y+3;
}
}
Help?
_root[ ]
I am trying to access beyond the _root level of a moive by using _root[myTarget] where myTarget == "test.myMovie" but it doesn't seem to like anything beyond the _root level. How can I dynamically access movies that are embeded deeper than the _root?
_root.var+n Becomes 1 :-(
_root.var+n becomes 1 :-(
im trying to do this:
i have _root.var1, _root.var2, _root.var3, etc
each var has a different value, i need to asign this value to a new txt block after i duplicatemovieclip it.
variable: _root.txt+n (expression)
value: _root.var+n (expression)
the variable part returns
_root.txt1
_root.txt2
_root.txt3 etc, as i want.
BUT
the value part is giving me hassle
value: _root.var+n (expression)
returns
1
2
3 etc
value: "_root.var"+n (expression)
returns
_root.var1
_root.var2
_root.var3 etc
it returns the var name, not the actual value that the var holds
help!
if i am being realy vague with the above explanation let me know
thnx
-thomas
_root?
This may be a stupid question, but what is _root?
Does it have a value? What part does it play in flash mx?
A brief explanation would be greatly apreciated.
Getting Away From _root (HELP ME)
right now i am doing a lot of work with nodes and movies with names like n1,n1,n3...
i ususally use an equation like:
A=_root["n"+i]
the problem i am running into is when i try to load this .swf into another, the _root screws everything up. How else can i make this work.
P.S. A=_parent... dosent work unless you did something with it that i didnt.
_root
here's my promblem...
_root
here's my problem...
i am trying to load a outside swf file use the loadMovie command which work fine on all my other work. but now i am trying to get the swf to comw up within a movie clip insted of the x=0 and y=0 that it normaly come up in. the swf it self in a 1 frame scroll gallary that is controled by action script and work fine again. but when loaded in to the movie clip it does not work!. i have looked at the action script in the gallary and i think it could be something to do with this command
_root.pages. and so on
i know that this is talking to the main time line but in my mind if it work as a swf it should work as a loadMovie.
any ideas?
_root.HELP
People, programmers, gurus, anyone,
can someone guide the light into printing in flashMX.
Example
// Let's say I have 15 frames with different content on each.
// Let's also say that I have a button on each of those frames.
// And this button wishes to print that specific frame that you
// are currently on.
// It sounds logical to accomplish this, but I have researched,
// and found out that this cannot be done. (besides printing that one frame or all frames with the #p label.
I am slowly, but surley going very crazy about this enigma,
someone tell me the truth, or give me hope.
Godspeed
_root.HELP
People, programmers, gurus, anyone,
can someone guide the light into printing in flashMX.
Example
// Let's say I have 15 frames with different content on each.
// Let's also say that I have a button on each of those frames.
// And this button wishes to print that specific frame that you
// are currently on.
// It sounds logical to accomplish this, but I have researched,
// and found out that this cannot be done. (besides printing that one frame or all frames with the #p label.
I am slowly, but surley going very crazy about this enigma,
someone tell me the truth, or give me hope.
Godspeed
_root Help
What exactly is _root? and how do i put something there?
If Not _root Then What?
I've got a "menu swf" that loads into the "main swf" via sliderContainerMC and the "menu swf" has buttons on it that call up "info swf" vua lcdContainerMC at another x,y location.
All worked well, UNTIL, I tried to attatch some caption flags that are supposed to tell you what is what over the buttons in the menu. If I use the menu stant alone, it works perfect. But when that menu swf is loaded into the main swf all hell breaks loose.
If _root is pointing to the main swf once the menu swf is loaded, what else can I call it so it know's that it's only supposed to work within the menu swf?
You can look at my site if you like, right now it's just a desaster! .. lol .. the menu hooks to your mouse once it's loaded instead of the caption flag when you are over buttons .. lol ..
Help?
Justin
_root
ok i have a pretty major glich with my flash moviie
so i have a main flash movei and with in it, all my links to other pages are with in a scrollable box using the geturl function.
so the problem is with the inside swf, i have a nav bar that is a movie it fly's out and then stops and is the nav bar.
so iam using
on(release{
_root.gotoandStop("whatever")
}
so it works when i watch that swf by itself BUT, as soon as i watch the other swf with it inside it it ceases working
i have already checked that my names for the frame labels are not the same i suspect that the peoblem is witht the _root. thing but i don't know how to fix it
any help would be heaps apreachated
|