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
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-09-2008, 03:44 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_root Frame Labels
Am trying to command the _root layer to go to a specific frame lable using a varible to define where it should go but unfortunatly its not talking properly i also have a a lot of if statments as there are 16 possibilities from the menu.
when a button is pressed on the menu it sets a root variable (nextplace) to the frame lable name ie "profile"
_root.nextplace=profile
then on the root a mc plays to its end and goes through the if statments
with (_root)
if _root.nextplace==profile
gotoandplay "profile"
}
}
until it reaches profile then it needs to go to the frame lable in the root "profile"
any suggestions
Add Code To A Frame In A MC From _root
This is not really importand but is it possible? I'm trying to see if I can keep all the code in a file on the root but I'm setting variables and stuff on specific frames within movie clips. Is there anything like:
movieclip.onFrameNumber(number or label){
do something;
}
Cheers,
jr.
_root.next Frame PROBLEM
I have a main movie I load external swf's into via on (release) {
_root.contents_mc.loadMovie("main_content.swf");
}
All of this works but one of my movies has a form on it, all I need it to do is goto next fram after submit button is clicked I cant seem to figure out the right path to send the _mc on. This is what I have but it doesn't work and I know it needs something else after _root. but I dont know what.
onClipEvent(data){
_root.nextFrame();
}
Here is my .fla It was too big to upload so I put it on my server if you need it
http://www.nucklewebdesign.com/dloads/contact.fla
Thanks,
Josh
_root.gotoAndStop(frame);
i store in the database the frame on which a user ended
i retrive it from the database and store it in a variable "frame" when a user clicks "start" button
but when i pass the variable to _root.gotoAndStop(frame);
it doesn't work root doesn't go to that frame ?
on (press){
_root.pauseEnterFrame=true;
var post_get_frame:LoadVars = new LoadVars();
var post_id:LoadVars = new LoadVars();
post_id.ID = id;
post_id.sendAndLoad("http://e-jobs.pl/e-deutsch/getStartF...et_frame,"POST");
post_get_frame.onLoad = function(success:Boolean) {
if (success) {
frame = post_get_frame.start_frame;
trace(frame);
}
else {
frame = 2;
}
};
_root.gotoAndStop(frame);
}
Go To _root Frame, Not Working
A Question needing answering,
I got this movie(main) on which are two important frames, 9 & 10
Now I got a MC on frame 10 within which is a button that when clicked takes you to frame 9 of the "main" movie (not in the mc)
appreciate any help
_root.gotoAndStop (a Scene AND A Frame?) HELP
Hi
I know this must just be a syntax thing but i just can't get it.
I have my main movie loaded into level0 it has 8 scenes.
I have a movie.swf which gets loaded into a blank MC which is in scene 2 in the movie on level0.
There is a button inside the loaded movie.swf which wants to take the user to another scene and frame of the movie in level0.
I think that the AS on the button should be:
_root.gotoAndStop ("scene2", 10)
But it doesnt work. If i take out the "scene2" part it will take me to the frame number specified, but only in the first scene.
HELP!!
How To Refresh The Current Frame On _root
I have a fairly simple tutorial in development. I have a replay button that, when pressed, should replay the current frame as if the frame were just entered. The reason for this is I have some animations stored in movieclips that start when the frame is entered.
I have tried
on (release){
_root.gotoAndStop(_currentFrame);
}
and it just sits there and looks at me. I am assuming that it sees that it is already in the currentframe and essentially ignores the command.
Any help is greatly appreciated.
If (_root.bubblegum._currentframe == 2) { How Do I Put A Frame Name
Hello - this is a really dumb question Im sure but with the following code
if (_root.bubblegum._currentframe == 2) {
what do I do if I want to refer to teh frame number as a frame label? like if frame 2 was labeled "2mancan" what do I put???
is it
if (_root.bubblegum._currentframe == 2mancan) {
or is it
if (_root.bubblegum._currentframe == "2mancan") {
or is it something completely different?
Movie Loading A Frame In _root
I have a movie clip called nagication, when you click on a button, it takes root to another frame which has a movieclip on it. This is how my navigation is set up, you click a button and it goes to a frame with the specified movie clip on it.
Now I have a stop command on every frame on my _root. Now I can make the button say
Code:
_root.play()
and that works fine, but it keeps going throughy each frame and stops, click again and it goes to next one and stops.
I CANNOT, however, get it to go to a certain frame. I tried using the gotoandplay and gotoandstop functions but to no avail, it refuses to goto another frame. I figure its the stop() commands on my _root that are preventing this. How can I accomplish this?
Also, when I get it working, how can I make it not goto a frame again if its already there? I figure an if statement before it goes to the frame like
if _root is on frame 6, stop(), else goto frame 6
I'm not exactly sure on the syntax of the if statesments for checking which frame _root is on though
Printing A Single Frame In _root ?
peepz,
i have 2 frames in my _root i need to print (not at the same time, each seperated) but all the stuff on the stage are in different movieclips..
how i can fix it so it prints everything on the stage in that single frame on the _root.....
thanks already!
Creating Mc.onEnterFrame In _root Frame 1
I have a movie clip (mcTabContact) nested inside two other movie clips (mcGlobe and mcAlpha). I want to create an onEnterFrame function for mcTabContact, but put it in the first frame of root timeline, rather than creating the code directly on the movie clip.
Unfortunately, whereas the code works perfectly when placed directly on the movie clip, it fails to function when moved to the root layer. I figure it has to be an addressing or syntax error somewhere. I'd be very grateful if someone could assist.
On the movieclip itself, I code:
Code:
onClipEvent (enterFrame) {
this._y = -35; //sample code line
} //end enterFrame
Everything functions smoothly. But when I move it to the root timeline and write the following, nothing works:
Code:
mcGlobe.mcAlpha.mcTabContact.onEnterFrame = function() {
this._y = -35; //sample code line
} //end enterFrame
TIA,
Carolyn
If PrevFrame <19 Of _root GP _child.frame 100?
I hope this isn't too confusing... I'm having a hard time figuring out how to target a specific frame in a loaded clip based on the previous frame of the _root timeline.
My project looks like this:
Main.swf
---frame 5 load1.swf externally
---frame 10 load2.swf externally
---frame 15 load3.swf externally
I need to create a statement for load2.swf that looks to see if the previous frame of the main timeline was less than 19 (<19). If yes, the user goes to frame 100 inside of load2.swf.
In the main timeline, on the frame where I load load2.swf externally, i put:
Quote:
var jump_txt:String = ""
set ("jump_txt", "nothing");
if (prevFrame()>19)
{
set ("jump_txt", "jump_forward");
trace(jump_txt);
}
else
{}
My plan was to set a variable and then inside load2.swf I would put an if/then statement to check for the jump_forward variable.. if yes, then the user would jumpt to frame 100.
grrr.. how do I do this?
Printing A Single Frame In _root ?
peepz,
i have 2 frames in my _root i need to print (not at the same time, each seperated) but all the stuff on the stage are in different movieclips..
how i can fix it so it prints everything on the stage in that single frame on the _root.....
thanks already!
Printing A Single Frame In _root ?
peepz,
i have 2 frames in my _root i need to print (not at the same time, each seperated) but all the stuff on the stage are in different movieclips..
how i can fix it so it prints everything on the stage in that single frame on the _root.....
thanks already!
_Root Buttons Targeting MC Frame Labels
I have a basic menu on the _root level. I dynamically load MC's into an empty MC on the stage, and these loaded MC's have frame labels.
I would like to use the gotoAndPlay function from the _root menu to move the play head within the loaded MC's, but it won't work properly.
This seems so simple, but yet I can't make it happen...suggestions?
Target A _root Frame Label From Inside MC
Just wondering how this is done within an "if then" statement. I need a code like
if (_root.frame = "home") then {
this.quickHome.onPress = function () {
_root.gotoAndPlay ("homeToContact");
}
}
I know the first line isn't going to work, but just wondering if someone knew of a code that would?
thanks in advance...
(btw _root always targets the main time line correct? not just the timeline of a mc which the instance is placed in right?)
_root Inherits Frame Rate From Loaded Movieclip?
Hi there,
My main movie uses 25 fps frame rate, i load a swf with a frame rate of 1 fps into level 1. Now my main movie also plays at 1 fps. i was under the impression that a loaded swf inherits the frame rate from the parent, not the other way around..
This is taken directly from the flash help file;
"The movie in level 0 sets the frame rate, background color, and frame size for all other loaded movies. "
can anybody shed some more light on this?
thanx in advance
_root.play(); Works But Goto Frame Doesnt
In a game _root.death tells me if the player is dead or not.. on the movieclip that generates enemies it has an if statement that says if death==1 then goto frame 2...
For some reason i cannot have a movie clip on the main timeline tell the _root to go to a specific frame, i can only tell it to play();
I have the statement on a onenterframe event....i also tried makeing a function and calling it, nothing happens again, i also tried putting the call to the function on the movieclip's timeline, still same result but if i change the function to play(); it works fine...
is there an easier way to make the _root. go to a specific frame depending on the value of a variable ?
Stop Ctrl + Enter From Going To Next Frame On _root's Timeline
How do I stop Ctrl + Enter from going to next frame on _root's timeline.
In my rpg i have a secret and you havet to hold Ctrl and press enter. And when i tested it (exported to desktop and tested) it when to the next frame on the main time line. (There are only two.)
Why Won't A Reference To A Frame On The _root Timeline Work With A Preloader?
I’ve have got a simple 3 frame movie that gives preloader info on the loading of a video that is contained within it.
So on frame 1 I have a dynamic text field (Instance name dym_txt) a simple blue bar called “preloader” & the following script
Code:
var amountLoaded=_root.getBytesLoaded()/_root.getBytesTotal();
preloader._width=amountLoaded*200;
dym_txt.text=Math.round(amountLoaded*100)+"%";
Frame 2 is blank with the following code:
Code:
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.gotoAndPlay(3);
} else {
gotoAndPlay(1);
}
Frame 3 has the video on it waiting to start.
Now where I’m having problems is getting the movie to “_root.gotoAndPlay(3);” The preloader works great but as soon as it is done loading it just reports “100%” an will not play the movie.
I did by accident use a reference to the preloader bar in the address as in “_root.preloader. gotoAndPlay(3);” which for some reason did play the movie & also if I give the video an instance name & use that as an address as in “_root.video.gotoAndPlay(3);” that will work.
What’s wrong with using “_root.gotoAndPlay(3);” the frame to be played is the 3 frame of the main timeline so what’s wrong?
[F8] _root.gotoAndPlay(2).. Dont Flick Past Frame 1
On the root I have 2 frames. Frame 1 is the preloader and frame 2 name is a movie clip with the instance name of big that has animations inside of it. At the end of the animations in big I have this AS:
_root.gotoAndPlay(2);
At the end of the animations inside big it goes to frame 2 on the root but it flickers past frame 1 and then goes to frame 2.
Please can someone tell me how to get this to go straight to frame 2 and not to flick past frame 1?.. So at the end of the movie clip big I want it to go to frame 2 on the root without flicking past frame 1.
I have also put this AS at the end of mc big:
_root.gotoAndPlay("noflicker");
and then given frame 2 on the root the frame label noflicker
but yet it still flicks past frame 1..
Obviously I have a stop(); on frame 2 of the root..
I am bamboozled here! Please can someone help me!!??
_root.gotoAndPlay(2) - Dont Flick Past Frame 1
Click here to download the .fla
If you play the flash movie and don't interact then it will play three movies which can also be triggered by the three buttons (red, green and blue).
The problem is when it plays the last movie clip (blue button). If you click on the blue button it will play a movie clip with the instance name ggsr and inside this movie clip I have this code:
_root.gotoAndPlay("ems");
ems is on frame 2 of the root.
So when ggsr is finished it will go back to frame 2 (ems) on the root but right now it flicks past frame 1 to get to frame 2....
I have typed the word flick on frame 1 to show what I mean.
Let test.fla play more then once and you will see what I mean. At the end of the last movie clip it will flick past frame 1 and then it goes to frame 2. I need to stop the flick!!
Please can someone help me?
_root.mc.gotoandstop ("frame Label") Not Working
I have a button inside a movie clip, that is inside another movie clip. Not that it should really matter!
Anyway, I have a seperate mc on the main time line that I need to control from the said button. This code:
on (release) {
_root.mc.gotoAndstop("label");
}
doesn't work!
I've tried checking everything: frame labels, instance names, spelling, layer order, EVERYTHING!!
I have no idea why it's not responding. It should be relativiley simple, right? Can anyone help?!
telekin:
Loading A Frame In _root And Also Loading An External Movie Problems.
First of all, hello everyone and nice to meet you
I have been hacking at a problem for a couple of days now and I am in need of help to solve it. Please excuse my noobishness, but I have a lot to learn when it comes to flash.
Here is my scenario:
I have my main movie (_root)
In the actions layer of my main movie I have:
Code:
this._lockroot = true;
I have a button that loads a new external movie at the end of which I want to load a particular frame in the main movie. I call this from the external movie:
Code:
on (release) {
_root.gotoAndPlay(610);
}
Everything up to here works brilliantly....But my problem arises when I also try to load an external movie onto level 5 at the same time as I am instructing the main movie to play frame 610 from an external movie. I want the external movie to call frame 610 in main, and also load a new external movie on level 5 in the main movie. I have tried about every way of loading movies that I can think of but I can never get the external movie to load along with frame 610 of the main movie. I even tried _root.loadMovieNum("myexternalmovie",5) right after my first root call, like this:
Code:
on (release) {
_root.gotoAndPlay(610);
_root.loadMovieNum("myexternalmovie",5)
}
Is that possible or do I have to approach this entirely differently? Thanks for any responses
_root.gotoandplay("Scene", Frame); ?
I have a button which is within a movie clip which is within a movie clip. The button has _root.gotoandplay("Scene", Frame);, in the following syntax.
ActionScript Code:
on (release) {
_root.gotoAndPlay(AdvancedButtons,1)
}
I know, having separate scenes is a bad thing. However, I'm going to have so many different "Tutorials", that I need to separate them so. Can someone tell me what the best way to skip to another scene in this fashion is?
The design is lousy, and it is basically an exercise on Advanced buttons. All the different buttons will ultimately be different. The code you need to get in is A346. It is not case-sensitive.
The entire animation is here:
http://www.mediahug.com/home/index.p...d=22&Itemid=46
_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();
Hiding A Scripted Frame Behind A Layer
hey gang, im really bad at scripting so i thought i'd give it a try...
i tried to make rain and it worked out pretty well but i have an issue, i want my rain to fall behind some layers, but it always appears on top so is there anyway i can get it behind the layer?
thanks,
travis
_root.mc1.button.mc2 ...?
what is the correct term when using the _root. syntaxt when refering to an mc inside a button inside an mc.
ie
_root.mc1.button.mc2
CAn it be done?
if not what is the best way to refer to the mc in a button?
Button In _root
Hi,
Is it possible to make a button function that only 1 part of a movieclip loads again?
Let me give you an example.
If you have a full flash movie, an you have on you left side a fridge and on the right side a tv. And in the fridge are bottles of beer that function as an button. And when i click on a bottle of beer only the tv must change with text, or an other movieclip in it.
Is this thing possible?
If so, can someone post a script here for the buttons
Thx in forward
greetz sander
_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.
_level Hiding Movie Once Change Frame
Right now I have 2 files. The main.swf which will load from the start. On the first frame of main.swf I do a loadMovieNum ("projects.swf", 1); .
Now the first frame of projects.swf is blank and has stop(); so nothing appears and it all seems to work good. Frame is called "start"
What the problem is when I use my menu to call parts of project.swf, such as _level1.gotoAndStop("utility");. It loads fine but once I leave that frame how do I get the projects.swf to go blank or hide without unloading it?
My main.swf menu is setup so it moves to different frames on the timeline and the frame loads the file (_level1.gotoAndStop("utility"); is on frame "menu3")
So I need a statement that tells it once I leave from "menu3" to put _level1 back to frame "start" (which is a blank frame). Or another idea of how to do this.
Thanks in advance.
_root. And Button Help With Loadmovie
I think I'm having root problems!!
My main movie is doing a loadmovie("menu.swf", menu_holder_clip)
My menu.swf does a loadmovie("random.swf", _root.random_holder_clip) upon rollovers on my buttons and works fine within the menu.fla.
The problem is it doesn't work in the main movie...I know it has something to do with _root.
THANKS a MILLION
Aloha
Andrea
_root Button Problems
I hope someone can help:
I have buttons in one movie clip and i wish them to 'gotoandplay' frames in a different movie clip. Usually i use _root gotoandplay'instance' but this doesn't seem to work.
Help please!
cheers
Button (opposite Of _root)
ok, so you know the _root refers to the main timeline, what would be the opposite? how to reference a button in an external movie.
or wait... how to reference a button in an external movie in general.
[F8] Button _root. Question
I have the mcl actions on the main scene frame 01, however my button is located within several movies. Can you please tell me what is wrong with this part of the script. When I press the button, nothing happens.
thanks
navClip.mc_navbar_01.btn_about_me.onRelease = function() {
_root.loader._visible = true;
mcl.loadClip("new_movie.swf",holder);
}
As you can see, the button is located within other mc.
MC Button Controling _root MC?
Here is what I have:
On my stage I have a movie clip with content on it. Within that movie clip there are two MC's, one for "Next" and one for "Back". I want to make it so when the user hits "Next" it goes to the nextFrame()l and "Back" to go to prevFrame. The MC that this content and the buttons are on has an instance name of processContent. This is the code I have, on the next button MC, that does not work (nor the back button).
Code:
onClipEvent(load){
this.onRollOver = function(){
this.gotoAndPlay(2);
}
this.onRollOut = function(){
this.gotoAndPlay(11);
}
this.onReleaseOutside = function(){
this.gotoAndPlay(11);
}
this.onRelease = function(){
_root.processContent.nextFrame();
}
}
The rolovers work great, it's the onRelease that does not seem to control the MC. I have also tried it without the _root. The spelling/capitals on the instance name are correct, I directly copied them to make sure.
Can someone instruct me as to what I am doing wrong? Thank you.
|