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




_root Rollover Help



I am trying to create rollovers in dropdown menus that i have. I am having a problem with the rollovers on the same dropdown all playing at the same time. The rollovers play backward and forward correctly as they should but when you mouse over one of seven they all play.

i really need some help can anyone give me a hand and point me in the right direction. Thanks


The code i am using is:

the invisible button to animate the rollover:

on (rollOut) {
_root.direction = "backwards";
}

on (rollOver) {
_root.direction = "forwards";
}



on the movieclip with the rollover animation in it:

onClipEvent (load) {
this.stop();
}
onClipEvent (enterFrame) {
if (_root.direction == "forwards") {
this.gotoAndStop (this._currentframe + 1);
}
if (_root.direction == "backwards") {
this.gotoAndStop (this._currentframe - 1);
}
}



These are in a movie clip nested in

Scene 1 > drop > Bar > webrollover


I can post the FLA if it would be easier.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 12-03-2004, 10:25 AM


View Complete Forum Thread with Replies

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

_root Rollover Help
I am trying to create rollovers in dropdown menus that i have. I am having a problem with the rollovers on the same dropdown all playing at the same time. The rollovers play backward and forward correctly as they should but when you mouse over one of seven they all play.

i really need some help can anyone give me a hand and point me in the right direction. Thanks


The code i am using is:

the invisible button to animate the rollover:

on (rollOut) {
_root.direction = "backwards";
}

on (rollOver) {
_root.direction = "forwards";
}



on the movieclip with the rollover animation in it:

onClipEvent (load) {
this.stop();
}
onClipEvent (enterFrame) {
if (_root.direction == "forwards") {
this.gotoAndStop (this._currentframe + 1);
}
if (_root.direction == "backwards") {
this.gotoAndStop (this._currentframe - 1);
}
}



These are in a movie clip nested in

Scene 1 > drop > Bar > webrollover


I can post the FLA if it would be easier.

(rollover) _root Backwards
I have a button on the stage and I have added the following code;

on (rollOver) {
_root.kidspage.gotoAndPlay(2);
}

Which plays a movie clip, I have put a stop on the first frame and a stop on the final frame.

How would I now get the movie to play backwards when the curson moves off of the button?

Fez

On(rollover){fadeout _root.MC?}
i'm trying to make an MC on the _root timeline fade out gradually as i rollover a button. It currently fades out but its a really harsh animation, does anyone know how i could slow it down or make it a smoother fadeout?? I've tried while loops and all kinda figures to try and achieve the desired effect....

Heres my code so far - its really simple:

on (rollover) {

var minAlpha:Number= 10;

if (_root.polo4._alpha >0)

_root.polo4._alpha = _root.polo4._alpha+((minAlpha-_root.polo4._alpha)/10);
}
}

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!

Trying To Make A Button Rollover, Wait And Recheck Rollover
hi. i'm mostly comfortable with the graphical elements of using flash and there a gaps in my knowledge when i want to polish things up.

i have a bunch of buttons which, when rolled over, trigger some text to sweep accross in an area above the buttons and sweep away when rolled out.
this works nicely but if the viewer sweeps the mouse over a few buttons quickly all the MCs with text in play and it gets very messy.

the only way i can think to tidy this up is to make the button delay when rolled over and recheck about half a second later. if it's still rolled over then it plays the MC. i tried this the obvious way (triggering a small MC with onRollover > play MC at the end) but it needs the actual act of rolling over to trigger so i had to roll out and over again which defies the point >.<

i realise this is a really specific problem and it's very cheeky to ask others to solve my problems but if any of you have come accross similar problems and can point me in a better direction i'd really appreciate it.

Button RollOver/RollOut Effects WITH Looping On RollOver
I'm planning to use this tutorial, below to make a button:
http://www.kirupa.com/developer/mx2004/button_effect.htm

My question is how can I make it so that only on the rollover, the effect will keep looping?

Example: http://jump5.com/

On the right side, the navigation has this nice hover animation with the pointing arrow that continues to twitch on rollover.

RollOver Action. I Need It To Stay In RollOver Mode When Mouse Is Off.
I have a movieclip with this action attached:


PHP Code:



on (rollOver) {
    loadMovie("logo_intro.swf", "bottom_logo");








When I roll over it, it loads the movie correctly. Yet, How do I get the movie to stay once the mouse is off ite movieclip/button area?

Rollover On Top Of Rollover OR Exit Flash Reset
So I have been working on a project for the last two days now that requires several layerd boxes to swapDepths in order for them to expand correctly. I have been doing this with a on(rollover) tag on a hit area button which then expands to a full screen.

PROBLEM
I cannot figure out how to add a fuctioning button to on top of this full rollover.

I have attached the files so that they may be viewed below
http://www.jdhillen.com/flash/dc_test.fla
http://www.jdhillen.com/flash/dc_test.swf

If you scroll over the yellow box it will expand and show a blue button. I'm trying to get the button clickable, but I'm afraid the way i built the flash doesn't allow me to do so.

Any advice would be greatly appreciated. Thank You

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

Background Rollover With Button Rollover
I'd like for my background behind my buttons to rollover, but remain rolled while I touch the buttons and make those rollover. Here's an example:

http://www.zymocreations.com/index_f.htm

I can get both of my rollovers going, but I can't get the background to stay rolled when I move to the buttons.

Any suggestions? Thanks ahead of time!

Button Rollover Disabled Due To MC Rollover
i have used this nifty code from this .fla (http://www.actionscript.org/forums/a...chmentid=12251, 6.4kb) and it works perfectly. it's a rollover effect that plays or reverses an MC on rollover, i have just one extra thing i'd like to ask that maybe someone could help me with.
in my example, i have a curtain that goes up and down when rolled over and out. this works fine, but what i want is to have my menu behind the curtain, so when the user rolls over the curtain, it goes up, revealing the menu. i've done this, but for some reason my basic menu's rollover actions are disabled. can't anyone help me to get them to work?

here's the code from devonair's example:code: stop();
curtain.onRollOver = function() {
this.onEnterFrame = function() {
this._currentframe == this._totalframes ? delete this.onEnterFrame : this.nextFrame();
};
};
curtain.onRollOut = curtain.onDragOut = function () {
this.onEnterFrame = function() {
this._currentframe == 1 ? delete this.onEnterFrame : this.prevFrame();
};
};and here are the actions on my basic menu that is within the 'curtain' MCcode: on (rollOver) {MC1.gotoAndPlay("over");}
on (rollOut) {MC1.gotoAndPlay("out");}
on (release) {getURL("home.htm", "iframe");}many thanx in advance for any help given...

Blink Rollover Effect On Rollover
- i have three layers within the OVER state of a button (layer1, layer2, layer3)

- layer 3 has a rollover fade in effect for my button
- layer 2 has a blinking effect for my button
- layer 1 is the canvas of my button

I just want layer 3 to animate 1 upon rollover but has layer 2 keep on blinking while the user has its cursor on the OVER state of the button.

I have the "stop();" actionscript function for the rollover fade effect on my layer 3 but it stops everything! I want the layer 2 effect to continue the blinking.

I have tried extending the keyframe time on layer 2 but that didnt work.

Anything else I should try?

Complex Rollover -rollover Sounds
Hello,

I've used the complex rollover tutorial and it works great. My only problem is attaching a sound to the rollover. The rollover is set to rewind when you roll off the navigation link and this replays the rollover sound which I don't want. Is there a way to attach the sound to only the rollover?

thanks for any help you might have

[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---

On Rollover Doesnt Like It When It's In Another MC With On Rollover :(
Ok, so I have a menu that slides out when you rollover a small tab, works great, anyways, the menu has another MC in it, a button, that has a on(rollOver) Attached to it, so that an animation plays when it's rolled over. Why doesnt this work? I mean I guess it's because there's a duplicate rollover command, but whats the work around to this?

RollOver Inside Another RollOver
Hello,
Is this possible?
I have a movie clip with an on (RollOver) function. I have attached another movie to load dynamically with the attachMovie function, but it's on (RollOver) is ignored. Targeting the attached movie clip within the RollOver function doesn't work either. I'm trying to create a menu button with a submenu that opens within it. Thanks!

RollOver Inside Another RollOver?
Hello all,
Is this possible?
I have a movie clip with an on (RollOver) function. I have attached another movie to load dynamically with the attachMovie function, but it's on (RollOver) is ignored. Targeting the attached movie clip within the RollOver function doesn't work either. I'm trying to create a menu button with a submenu that opens within it. Thanks!

One RollOver-function Above Another RollOver
Is it possible to have two areas with rollOver/dragOver funktions to work att the same time, one inside the other.

I have one big button with this code in it:

Code:
on (rollOver, dragOver){
this.gotoAndStop("active");
mx.behaviors.DepthControl.bringToFront(this);
}

on (rollOut, dragOut){
this.gotoAndStop("closed");
}
And i need a smal area, in a Movie Clip places above the big button, to trigger another rollOver/dragOver event. Without killing the rollOver/dragOver from the big button.

I tyed to use rollOver, dragOver and rollOut, dragOut
but it did not work.

Now i have solved it without the second button. I use this code for the second "moseOver" function:

Code:
if ((_root._xmouse>210) and (_root._xmouse<495) and (_root._ymouse>282) and (_root._ymouse<300)) {
this.mcTjanster.gotoAndStop("t1");
}
and it works but is to complicated for my us.

Is it possible to solve it in an more siple way?

Rollover Inside A Rollover...?
Hello,

I was just wondering if it is possible to get 2 rollovers working at the same time which occupy the same space (one on top of the other). I've created a universal thumbnail for my site with a rollover effect which I want to use several times. However, each little thumbnail icon wants to load up a different swf, so each one also needs individual behaivour. So travelling up a level, I have a rollover on the parent movieclip occupying the same space for the individual behaviour.
I am finding that the uppermost rollover is the one that works, and any rollovers beneath it dont, - which makes sense really. I was just wondering if it was possible to get both working...

Can anybody help?
Or am I going about this the wrong way?
Is there a better solution?

Any help appreciated.

Thanks

A Rollover/rollout Movieclip With Rollover/rollout MC's Inside It
Hi there, I am trying to figure out how to make a bottom bar similar to the one seen on www.1000pis.com how he's got clips with animations inside the bar- here's what I've got so far: http://cg.psdsliced.com/test1/ - as you can see I have a date/time MC inside the bar_mc which is working fine but whenever I try to have a new rollover/rollout movieclip (or button) inside the bar_mc it won't work/won't show rollover animation.

so does anyone know how the guy at 1000pis.com does it or can offer me any help at all?

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

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