Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Trouble Getting A "_root"



I need to jump from a frame within a mc to a frame within the timeline that hold this mc, i understand you use _root.gotoandStop ("frame_label")
but i dont know how to implement this into a button, is it an "onmouse event" , someone help!



FlashKit > Flash Help > Flash ActionScript
Posted on: 02-19-2002, 10:07 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

_root. Trouble
hi, i have a scrollpane with a movie clip attatched (using linkage) and in that movie clip are 3 buttons. the idea was to have a scrolling set of buttons that when clicked, they go to a certain frame. the reason i want it scrolled is because i intend to add more buttons later on.
i put this code for the buttons in the movie clip
on (press) {
_root.gotoAndStop("main", "cartoon");
}

but it doesnt work ("main" is the scene with the scrollpane, and the frame i want to got to)("cartoon" is the frame label i want it to got to (in "main")
why wont this work? is it something to do with the movieclip being inside a scrollpane.

thanks.

_root Trouble
check out the .flas, you have to put a k where the * is in the URL, it's a cuse word.

http://glidefx.org/hitchcoc*/desktop.zip

The thing is, they work when they are seperate .swfs. But when I load them into the empty movieClip, thats when there's trouble.

Ok first export the two .swfs. one as alayout and teh other as board. Then open up the alayout .swf, and go to "board", play with the scroller, then go back to the buttons to the left. After I learn how to fix the problems with that I will be able to fix the problems with teh board. Thanks.

Trouble With _root? Please Help
I'm a super novice with Action script and I need help.

This what i am trying (and failing) to do.

I have a base movie let's call it "base" this is always displayed and I am loading movies into a blank movie I have created, this part works.

Where I am running into problems is I want to control which movie is playing with a variable let's call this "Movie_Num" I want to be able to edit the number of the variable in the other movies, this is where I have problems, I am horrible with this. Here's my basic code (I know its archaic)

In a keyframe on the timeline In "BASE" I have this-

if (_root.Movie == 0) {
this.Movie_Num.loadMovie("Movie_0.swf");
}

if (_root.Movie == 1) {
this.Movie_Num.loadMovie("Movie_1.swf");
}

if (_root.Movie == 2) {
this.Movie_Num.loadMovie("Movie_2.swf");
}

I want the Base file to load the second movie at the end of the first one so in the "Movie_0.swf" I try to change Movie_Num to 1 by adding this to the last frame of the movie -

_root.Movie = 1


That's all- Please please pleas help

Thanks

_root Trouble
check out the .flas, you have to put a k where the * is in the URL, it's a cuse word.

http://glidefx.org/hitchcoc*/desktop.zip

The thing is, they work when they are seperate .swfs. But when I load them into the empty movieClip, thats when there's trouble.

Ok first export the two .swfs. one as alayout and teh other as board. Then open up the alayout .swf, and go to "board", play with the scroller, then go back to the buttons to the left. After I learn how to fix the problems with that I will be able to fix the problems with teh board. Thanks.

Having Trouble Accesing _root...simple Problem?
I have a button inside of an MC. When one pushes the button I want it to tell a movie clip in the root directory to play a frame label.

on (release)
tellTarget (_root.SAMPS) {
gotoAndPlay("ORGANIC");
}

SAMPS is the name of the movie clip, ORGANIC is the frame label. Why isn't this working?

Flashmx-Im Trying To Make It So That When _root.lazer Collides With _root.bad It Goto
Im trying to make it so that when _root.lazer collides with _root.bad it gotoandplays("Explode"); im using this script

onClipEvent (load) {
if (this.lazer(_root.bad)) {
this.gotoandplay("Explode");

My fla is attached.

_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 ???

? -- TellTarget(_root.man_0 && _root.man_1) { -- ?
Can you tellTarget multiple targets?

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.xyzxyz What This _root Means?
What is the meaning of _root. What does it represent.

_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!

LoadMovie Trouble Trouble Troubles
hello,

i'm having a little bit of trouble here trying to load multiple movies into the same container. not all at one time. like this:

when a button is clicked this happens in my preloader clip which is located in my _root movie:

********************************
// set vars
sectionMovie = _root.currentSection + ".swf";

// un/load movie
unloadMovie("_root.SectionContent");
loadMovie(sectionMovie, "_root.SectionContent");
********************************

then the next frame of the preloader says:

********************************
// get the percent of the movie loaded
bytesLoaded = _root.sectionContent.getBytesLoaded();
bytesTotal = _root.sectionContent.getBytesTotal();
percentLoaded = int((bytesLoaded / bytesTotal)*100);

// if it's loaded then continue
if (percentLoaded == 100) {
this.gotoAndStop (1);
}
********************************

it all seems like it should work. i click "button1" which loads "movie1.swf" perfectly. then i click "button2" and it will unload the movie fine, but it just stops when it gets to "loadMovie"... anyone know what is happening?

thakns in advance for the help, it's a school project...mwaahaha!

xo

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

If (this._url = _root._url && _root:leiaSala) {
SORRY ABOUT MY ENGLISH!

WHAT MEANS THIS LINE

if (this._url != _root._url && _root:leiaSala) {

IN SPECIAL THE :

I'M NEED TO EXPORT SWF IN AS 2.0, AND THIS "OPERATOR" IS DEPRECATED.

THANKS

"Oooooh Trouble Trouble..." (Foghat Reference +1000 Points)
I am attempting to add X movie clips to the stage via script, with follow AI behaviors added to each of them. But for now I am just having them immediately start moving left until they hit the stage edge OR eachother...which is the problem.

I cannot get them ALL to stop when they collide with somehting else on the stage...

the way I atempted to solve this problem was to start an array... a list... and to add to that list the name of every object I add to the stage when I add it to the stage. So before ANYTHING moves it loops through this array to see if it is hitting anything else on the stage. Sounds simple right?

Well it seems to only work for the LAST movie attached in my function.

I have attached the script to this post. Please take a look, provide some help, give me some alternative ideas, tell me a good joke :-P, just gimme some feedback. Thanks in advance to anyone who even tries to help.

[F8] From Text "_root.home.score" To Variable _root.home.score ?
Hej

How can i convert this string "_root.home.score" to a varialbe, so i can use it for actionscripting

"_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---

Trouble Explaining The Trouble
i am having a hard time explaining this problem so i have attached my fla file with some notes attached to it.
i'm trying to customise the a.s. but alas i'm not very good at it yet.

i have an element on the page that when it is clicked on it zooms big and comes to the center of the stage. when you click on it again it zooms back to its original position. - i have this part working.

the problem is i want elements within the zoomed elements to behave the same way. essentially zooming further into the stage. i just can't get it to work.

at this point i am completely lost, any help on this is much appreciated.
thanks everyone

_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

Copyright © 2005-08 www.BigResource.com, All rights reserved