Root?
ok guys, i've got mc's in mc's in mc's, in the last mc theres a button, which must contain the action 'go to and play first frame OF THE MAINTIMELINE' (not the timeline of that mc) how do i do this?
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-17-2001, 12:45 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Controlling Root With MC Loaded Into Empty MC On Root
I have a movie in which there are 7-8 Empty movieclips put on the stage. I load movieclips into these on load and from some Btns on the main or root movie. Now I'm trying to change out one of these empty MCs from a MC loaded into another empty MC....If that makes any sense?? Here's the code:
code:
onPress = function () {
this.gotoAndPlay(frame);
if (code == "1"){
_parent.getURL(site, target);
}
else if (code == "0"){
fscommand("exec", fs);
}
else if (code == "2"){
_root.clipnmone.loadMovie(movie, clipnmone);
_root.clipnmtwo.loadMovie(movie2, clipnmtwo);
}
}
I'm getting the Vars clipnmone & clipnmtwo But I can't seem to hit the clip on the root movie. It's called clip4. Now, it works if I put the clip name in place of the Vars. If someone could point out what I'm doing wrong, that would be great. Thanks for your help and time on this. Oh, and I'm using Flash vers 6. So, please don't send me 2004 code. Thanks.
[AS3] _root Or Var Root = Root;
Pls.. i need help to find _root (as2) on my project AS3.
_root.gotoAndStop(2);
And AS3 I have used:
var root = root
root.gotoAndStop(2);
This is a bug ???
I can“t understand ??
Why i need white var root = root ???
Somebody know other way to do this ???
tnx for all
Questions About The Using Of Root And This.root
Hi,
I have some questions about the using of "this" and "root":
Why the following codes works:
Quote:
var r = root;
r.myText_txt.text = "Kirupa Forum";
But not this:
Quote:
root.myText_txt.text = "Kirupa Forum";
And why the following also works:
Quote:
var r = this.root;
r.myText_txt.text = "Kirupa Forum";
But not this:
Quote:
this.root.myText_txt.text = "Kirupa Forum";
Thanks and best regards
Alex
Root?
Why doesn't this script work?
on (release) {
_root.open._root.layout.gotoAndStop (2);
}
i think i structurised my site not good enough
*my first scene is a preloader
*second scene: first frame; MC of buildingnavigation; instance=open.
*lastframe of that MC; MC of Site; instance=layout
*In that Mc you enter another MC (instance=switch) where you can push a button wich should say; MC of Site go to and stop frame2
so? how should i script this
thx
check it http://users.skynet.be/digizone/XSite.html
the layout button should change the background color and another picture
[Edited by PixelAddict on 09-19-2001 at 10:40 AM]
Root
if i use .root as the location does flash use the absolute root, ie if i have one swf loaded into another will root in the loaded movie be the root of the movie it is loaded into?
Help!
Cheers,
Tom
Root
Hi
It is my understanding that "_root" is actionscripting that applies to the first scene. So
_root.gotoAndPlay(35);
plays 35 in the first scene. How would I script this to play 35 in the second scene?
Root Q's
Oi helpful person,
I recently started rebuilding my flash site again (after 6 months or so) and came acros a few probs. I found a nice calander on flashkit and I would like to have on my site, but I don't quite know how to do that.... the source fla is on http://members.home.nl/lenaerts/splash/interface.fla
Ow and anyone have any suggestions for a student (no $$ to spend...) to learn flash step by step!?
Thnx for your help...ANY suggestions for this newbe r always welcome
JeePee
lenaerts@home.nl
MC To Root
Greetings
Does any one knows how to make a movie clip go back to the root on flash version 4?
This is only to use on pocket pc
Any ideas please help
Root Or Not?
I'm a beginner and I'm having trouble with correct action script for
external movies and levels. I've created several image gallerys and LoadMovieNum works great for each image but the big problem is the navigation button at the bottom of the page won't link back to the main menu. I've used _root.gotoAndPlay but to no avail.
Any suggestions?
Thanks!
Root Or Not Again
Hi to everyone. I've attached a segment of the site that I'm working
on. Perhaps that will clarify what the problem is.
Thanks again
For...root
How can I use "for" with 8 "object" and 8 "subobject"
on (rollOver) {
for ( i=1; i<9; i++){
myColor = new Color(myMovie);
colourobj=new Color("object_1.subobject_1")
colourobj.setRGB(0x756979)
Getting To The Root
I have buttons in an animated button and I wasnt the pop up buttons to go to labels on the main timeline what is the code for the root gotoAndPlay ?? (label)
Root
hi guys,
this is really easy cos ive done it before but had a complete mental block:
i have a movie clip wtihin another movie clip, and on press i want this clip to jump the playhead to another frame on my root timeline. so its on(press) gotoAndStop... but i cant remember how to set it to the root timeline. any offers?
thankyou
Getting _y And _x Of The Root From Mc In Mc
Hi,
I'm making a sort of 2d horizontal scrolling action shooter.
The problem I ran into is this:
I have a mc maincharacter, inside mc for most bodyparts. The head and arms (including the weapon) change angle according to the mouse pointer. Now I want to spawn a casing when you fire your gun.
The code is:
a = beretta_upper._y;
b = beretta_upper._x;
_root.attachMovie("weapon_9mm_case_drop","9mm_case "+_root.Case_i,_root.Case_i,{_y:a, _x:b});
But beretta_upper._y and beretta_upper._x give the y and x of the mc beretta_upper in the mc right_arm which is in the mc maincharacter which is in the root. So root > maincharacter > right_arm > beretta_upper .
If I do right_arm.attachMovie("weapon_9mm_case_drop" etc. it will spawn on the right place, but it will move along the mouse angle changing.
So, finally, my question is: how can I get the x and y of a mc inside an mc (inside another mc) from the root?
This And Root
onClipEvent (enterFrame) {
if (_root.dead) {
this.gotoAndStop("dead");
} else {
if (dir == "right"){
this._x += speed;
_root._x -= speed;
}
}
In the above script, what the purpose of this and _root?
this mean the movieclip itselp, how about root?
Getting At Root...
Hey, I loathe doing things this way, but:
Say I have a class called Contact that extends MovieClip, and I need to create a library MC that uses Contact as its base class.
Then I place that library MC inside another MC, which is loaded dynamically at some point. Don't ask why I can't just load Contact dynamically, too, at that point; it has to do with PaperVision viewer issues.
The question is, how can I get a reference to the main timeline from the Contact class if it was just placed on the stage?
Root In AS3
ok, i've searched the forum and am still stumped.
i have a master.swf that loads splash.swf.
in splash.swf there's a button that tells master.swf to go to the next frame.
in AS2 it would be:
_root.nextFrame(); or parent.nextFrame();
how do i do this in AS3???
Var From Root
i have a var i set my root.
ActionScript Code:
var regCode:Number= 100000000000000000* Math.random();
i then attached a movie clip using adChild and went to grab that variable by saying
ActionScript Code:
myText.text=this.parent.regCode;
didn't work got and error..
i read a little bit and then tried:
ActionScript Code:
myText.text= MovieClip(this.parent).regCode;
which returned NaN;
this is troubling me.. as i was also going to call a function in my root from that added child etc.. can someone tell me how to get this variable from the root and call a function in the root from my added child.. please?!
erik
Root Help
Ok. I'm creating an RPG but need a bit of help. If my character hit a bad guy, the health bar goes to the next frame (which has a bit less). But when you get to the last frame, I want it to go to frame 5 in the main timeline. any help please? TNX in advance.
MP3's Outside Of Root?
Hi
Just come across something and not sure if someone can help. I have a flash file that needs to play MP3 files that are stored on disk. My flash file plays these no problem when the mp3 files are located within my web root, however I need to store them outside of the rott for security reasons but the second I move them, and change my file path within my actionscript the MP3's do not load/play.
Is this a restriction of the flash player?
Many Thanks
Kris
Help Root?
Qurrent site
I'm trying to build a new site (see my old). I know some flash (mostely trouh tutorials on the web)
But i don't now how to steer movies from other movies.
So how do I use a button to do something in a totaly difrend movie.
Root something, but i just don't get it.
Some help?
.root Help Plz
hi i know my problem is somthing with root.
i made my webpage in fireworks great now its in flash but its in its own layer called content.png
i have my buttons and i made then button clips already.
i put the usual action script on em and made teh frames in the content.png
on (press) {
_root.gotoAndPlay(1);
}
what do i need to change?
Help Getting To The Root
Doing this tutorial with my own library. http://www.kirupa.com/developer/mx2004/transitions2.htm
My buttons are within a movie clip like the Note mentions. However I have altered my action script to what I think is corrent and cant seem to get the swf's to unload and reload new.
Code:
on buttons:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "gallery";
_root.container.loadMovie("gallery.swf");
} else if (_root.currMovie != "gallery") {
if (_root.container._currentframe >= _root.container.midframe) {
_root.currMovie = "gallery";
_root.container.play();
}
}
}
Is this the correct way of doing it or if it is then it must be something with my swf's that are loading. I can get the first to load fine with:
Code:
_root.currMovie = "home";
container.loadMovie(_root.currMovie+".swf");
but when button click no response. any help is appreciated.
Thanks
MT
Help With Root
hello,
i want to access mouseX mouseY property of the root
any ideas heres my code in as2
if (this.btn.hitTest(_root._xmouse, _root._ymouse) || (this.itemBG_mc.hitTest(_root._xmouse, _root._ymouse))) {
} else {.........
in as3???
Root?
When I use root.i++ I get:
1119: Access of possibly undefined property i through a reference with static type flash.display.DisplayObject.
When I use [i]root++ I get:
1120: Access of undefined property i.
What shall I use to make i++? Please help!
Help With ROOT
For some reason, I cannot figure out how to get back to a specified frame in the main timeline once inside a movie clip. My movie clip resides on the main timeline.
Thought this would work, but it does not.
Code:
root.gotoAndPlay("Start");
What do I need to replace "root" with??
PLEASE HELP!!!
Root
1st frame:
var asdf:Number = 123;
trace(this == root); //true
trace(this.asdf); //123
trace(root.asdf); //undefined
Whats wrong with this? And how can I access AS on my main timeline in my FLA from any level/MC?
Root Ugh.....
ok so Ive spent an hour trying to figure out root in as3. I have a game which consists of 5 frames.frame 1 asks if you wnat to play and that clicks thru to frame 2. I have a meter which is a movieClip, and if the meter goes to the last frame, there is an onEnterFrame listener that I want to tell the main timeline to gotoAndStop at frame 5, here is the eventlistener code:
this.addEventListener(event.ENTER_FRAME, youLoseGame);
function youLoseGame(event:Event):void {
stage.root.gotoAndStop(5);
//stage.gotoAndStop(5);
}
I dont understand how to access the main timeline, Ive tried several things anyone know? I swear I will go back into learning more about the display object but for now I need it to work!
Justin
Duplicate Mc But Not Root?
these damn cows, i keep having them of late.....
I created a movie clip of a raindrop and used action script to duplicate it. On the main time line I have two layers with two frames each. the first layer holds actionscript on each frame:
frame 1
duplicateMovieClip ("_root.drop", c, c);
setProperty (c, _x, random(550));
setProperty (c, _y, random(50));
frame 2
c = c+1;
gotoAndPlay (1);
this is great and works how I would like. Now I would like this movie clip to play as a seperate mc so that I can make the rain start and stop, add lightening effects further down the main timeline and eventually have the rain stop and the movie to brighten as if the storm has passed and the sun is coming out (aaah, I hear you sigh.) Well I have put my two layers of two frames each into a new mc called rain and have removed them from my main time line and replaced it with a single instance of the rain mc on my main time line. I reckon that the mc 'drop', my single falling drop, is no longer on _root but do not know what syntax to use. Please help. BTW, I just get a single falling drop, I can upload the movie if this would help.
Thanks
Hedley
Root Education
I'm a little over my head here, but I remember a great tutorial about 'root' functions. Only I can't seem to find it.
If someone could point me to it, I'd appreciate it.
Otherwise, here's my dilemna.
I've got a relatively simple movie, except that I'm playing around with loading .mpegs using FMProjector, but nevermind that part.
The point is that I'm testing the .mpeg load a few different ways.
One of the ways is simply having a button jump to a certain frame of the original 'root' scene timeline. The problem is that my button is 'buried' in another symbol which appears on the stage.
I've tried the elementary approach of simply saying:
on (release) {
gotoAndPlay ("Scene 1", "Frame whatever");
}
I know my ignorance has no bounds, but I'm pretty sure this being within a symbol in the library requires something more to point to the desired frame. I'm assuming it has to do with root something.
Not knowing anything about the '.root' function I don't know where or how to write it in.
Any help would be greatly appreciated.
Thanks.
Scaling The Root
hi there
is it possible to rescale _root?
My movie needs to load an other movie and than rescale itself to fit the other movie.
rootmovie= 18 px by 18 px originally
the filemovie is 180 by 60
like this:
loadmovie(file,"content")
_root._width=180
_root._height=60
however the content file only shows partly
help is there answer to this problem?
greetings from the netherlands
/ And Root And Drag
Hi.
Just to check...maybe someone could explain me ....
I have this :
startDrag ("/boca", true);
But I was trying to make like this :
_root.boca.startDrag = true;
Yes. It doesn't work and I guess it's made not to work.
But I was thinking that if this: 'setProperty ("boca", _alpha, "10");' has the same result as this '_root.boca._alpha = 10;' maybe the drag could worked.
Just a guess.
Bye::::::::::::::::::
Variables And +root.next
HEre is the probelm:
I have 4 scens
- Scene 1 : intro
- Scene 2, Scene 3 , SCene 4 are just scenes with no importance.
On the intro there are three choices: go to and play Scene2, Scene 3 or SCene 4.
For these choices i have put three buttons with this script:
on (release) {
_root.next = part2;
}
the other buttons have as variables: part1 or part3.
Now at th end of the intro i have put a keyframe with:if (_root.next="part1") {
gotoAndPlay ("Scene 2", 1);
}
if (_root.next="part2") {
gotoAndPlay ("Scene 3", 1);
}
if (_root.next="part3") {
gotoAndPlay ("Scene 4", 1);
}
This all looks fine, but it doesn't work. It just goes to the next scene. Why ? WHat did i miss ?
Root Of The Movie?
I am doing a tutorial for preloaders, and at the very beginning it says to go back to the root of the movie to insert a symbol. What and where is the root of the movie? Is this a specific term or just the author's way of saying the beginning of the movie?
How Do I Run A Function In The Root?
Hi,
I have this function in the root of my scene:
Code:
function resetBtns() {
if (btnPressed=="news") {
btnNews.gotoAndStop("default")
btnPressed="";
}
};
I want this to evaluate every time a button is pressed but the logic is incorrect:
Code:
on (press) {
_root.function(resetBtns);
}
How do I run a function in the root, from a button placed elsewhere?
Please help - I'm feeling blonde today.
Change Root Var From MC
i wanna change a var in the _root of a movie thru my MC, what is the suggested code?
btw jdura99 i see ur in the board at the moment, get on AIM n help me
Root Timelines
O.K so I have a flash movie, and I want to load external swf's into the movie via empty movie clips.
The external swf is a game for example, as soon as it is loaded in it ceases to work because the root timeline has changed, this is all logical. Is there a way around this problem.
A solution that does not require me to change every bit of code from _root to _root.emptymovieclip would be amazing!
Thanks
mr mooch
Get Root Size
hi, I've created a cool preloader, it uses main movie's sizes to work.
So instead of always inserting the _root width by actionscript (if movie is 800px larger I have to put 800 in the actionscript and change that number every time I change sizes) can I get this property?
I tried with this:
rootx = getProperty(_root, _width);
but it doesn't work... anyone can help?
Root Resizing
Hi folks,
i have a question about user screen resolution detection. i would like to have the root flash movie detect the users resolution, and resize itself accordingly.
perhaps it could load itself in an appropriate sized flash shell after detection. and then direct to a different key frame with adjusted art, pending on the resolution detected.
-i will be loading images so i wouldnt want to stretch the flash.
-an objective is to keep one root.fla for easier future edits.
any thots?
thanks,
Bub
Root URL Linking
I am using a multi layered menu that is based off of _root screens. When you click on one layer of the menu, the root screen for the sub menus fly in...
Here is an example of what I am talking about...
Mainlevel= [boton0, boton1, boton2, boton3, boton4];
subMenus = [sub0, sub1, sub2, sub3, sub4];
sub0 = ['Team Bios', 'Contact', 'Sign Up'];
sub1 = ['Calendar', 'Tournaments', 'Local Fields', 'Archives'];
sub2 = ['Photos', 'Movies', 'Submit Media'];
sub3 = ['Purchase Gear', 'DYE Paintball', 'General Joes'];
sub4 = ['Message Board', 'Chat', 'Contact Us'];
When you click on the one of the levels, the sub menu appears. Here is the script for the main menu buttons that cause the sub menus to appear.
onClipEvent (load) {
display = _root.sub1.length;
yinit = this._y;
ypos = yinit
click = true
nivel = 1
}
onClipEvent (enterFrame) {
this.mov();
}
I need to make the items in the sub menu URL's (i.e.- ['Team Bios', 'Contact', 'Sign Up']; need to all go to different URL's). Does anyone know how to do this?? Please help me! Thanks!
email me! kevin@mcintoshdesign.com
Root Issues
I know this is simple, but I need it to work. I have a button that is in a movie clip that I want to go back to the main timeline, currently it is just ending the movie clip. Somenody please help, my dead line is tomorrow morning, and this is the last thing i have to fix
thanks
Root Problems
Okay, here's the concept.
I've got a movie clip. Let's call it "mc1".
I've got another movie clip. Let's call it "mc2".
mc2 is a movie clip within mc1.
In mc2, a frame needs a code which makes a variable in the scene say "yes".
I've tried _root.root.variable == "yes" but I don't think using "_root.root" was right.
Can anyone give me the correct way of doing this?
Thankya.
Absolute Root ?
I have a movie within a movie and I am trying to get it to play a label in the root..that absolute root, not just up a level but up 2 levels. Target "../" is not cutting it.
Any ideas ?
Controling MC On Root
I have a MC (named spinBed) with a stop action in it on the root level. I am trying to move to the 20th frame of the MC using a button on the root level.
Why doesn't this work this code...
on (release) {
spinBed.gotoAndPlay(20);
}
Controling MC On Root
I have a MC (named spinBed) with a stop action in it on the root level. I am trying to move to the 20th frame of the MC using a button on the root level.
Why doesn't this work this code...
on (release) {
spinBed.gotoAndPlay(20);
}
|