[help] Using Buttons In Clip To Control Main Movie
Newbie Flash MX Actionscript question. Kinda new at programming.
Constructing main movie (lets call it "main"). Constructing a movie clip within the main movie (lets call it "navbar"). Inside the clip are various buttons set to take me to different scenes in the main movie on release. Problem is, they're not working. Actionscript applied to the buttons within the movie clip reads:
on (release) { gotoAndPlay("Scene 2", 1); }
have also tried on (release) { _root.gotoAndPlay("Scene 2", 1); }
and on (release) { _parent.gotoAndPlay("Scene 2", 1); }
Any idea what I'm doing wrong? Any help is greatly appreciated. Thanks.
Ultrashock Forums > Flash > Flash Newbie
Posted on: 2004-01-02
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Control Main Timeline From Within A Movie Clip? Help
Please help...
I have a video game on the main timeline of a scene. The scene label is "Game"... before the game starts, I have frame 1 of the main timeline attach the movie clip "Instructions" and play it. Once instructions reaches the end, I have Flash remove the video clip(works) and I want it to go back to the main timeline(Game) and play frame 2. What command do I use to have it do this? I tried:
Game.gotoAndPlay(2);
_root["Game"].gotoAndPlay(2);
BUT it Doesnt Work! I assume because "Game" is the Scene name, not a movie clip name... Any ideas on how to do this??
THANK YOU!
PLEASE HELP - Movie Clip Control Of Main Scene
Hi,
my problem that is driving me crazy:
I have a movie clip playing on a stopped frame on my main scene, what I need is for when the movie clip within the scene reaches the end frame for the main scene to gotoandplay another frame,
I keep trying variations of _root.goToAndPlay("Scene 1",2) on the last frame of the movie clip but it doesn't work. please please help,
Thanks
Control Main Timeline From Within A Movie Clip
Is it possible to control the main timeline from within a movie clip without a button? Basically what I am doing is, I have snow using Actionscript on the main timeline, actually I have two snow effects. One is just regular snow, the other is snow that "sticks" and plies up when it hits a MovieClip.
Then, I have a couple other movie clips on the main timeline as well. One is a changing background and the other is snow at the bottom of the screen piling up.
I have 3 frames on the main timeline that keep looping to produce the snow, then inside the movieclips I have about 215 frames. Now, at the end of one of those movie clips, I want the one that was piling up snow to fade out, along with the snow effect that was piling on top of it. What I did was created another scene. However, I can't get to that scene from inside of a movie clip without a button, can I?
Thank you very much in advance.
How Do I Control Main Movie From Nested Clip? Help
I KNOW i'm just getting some punctuation mark wrong, right?
I have a dozen sub-movie clips nested in my main movie clip (Scene 1) and I would like to set up action frames in these sub-movies that tell the playhead in the main movie to gotoframe, etc... can someone send me the simple gotoframe script?
when i use gotoframe("Scene 1", 5) or gotoframe(_root.5) ... 5 being the frame i want to jump to... Flash tells me it contains no errors, but it just wont work!
thanks!!!!
jason
Can A Movie Clip Control The Main Timeline?
ok, heres the deal, im making a game in which if you hit the movie clip (path_mc) you go to the next level (the next frame). The script is on the player.
heres what my script looks like:
onClipEvent (enterFrame) {
if (this.hitTest(_root.path)) {
//action to get to timeline{
nextFrame()
}
}
}
i need a way to preform an action from movie clip to timeline
i tried _parent.timeline, _root.timeline is there any way i could set timeline as a variable?
please help.
thanks in advance.
Fast Forward And Rewind Buttons To Control Movie Clips AND Main Movie
I am creating a software training movie in Flash (MX). The main movie has text, sound and animations directly on the main timeline, and also includes external swfs (video screen captures) that are loaded dynamically into a movieclip target.
loadMovie("bkr_openpgm.swf", "mc_finvideo");
I'm not importing these videos because they can be quite large after importing (my video capturing software can export as swf and avi). I will never play more than one movieclip at a time (so I use the same movieclip to load all movies: mc_finvideo), and there can be many frames in between movie clips where there's only non-movieclip stuff going on on the main timeline. After I finish playing a movie clip , I unload the movie from the movieclip using the following on the frame on the main timeline where the movieclip should end
mc_finvideo.unloadMovie()
I have play, pause, fast forward and rewind buttons on the main timeline that control the main movie just fine. The play and pause buttons also control the movieclip fine.
However, I'm having problems with the rewind and fast forward controlling the movieclip. The button logic works fine (moves play ahead or back 100 frames) UNLESS I click the rewind button at a point within 100 frames AFTER a movie clip has unloaded. Then (assuming the last movie clip was at least 100 frames long), the movie goes back to a frame where there should be a movie loaded, but of course there isn't, since the frame that loaded the movie clip wasn't hit.
Here's the code for the rewind button's on release event:
intCurrFrame = math.round(_currentframe);
intMCCurrFrame = math.round(mc_finvideo._currentframe);
//if the movieclip is closer than 100 frames
// to the beginning, go back 100 frames
// otherwise unload it
if ((mc_finvideo._currentframe - 100) > mc_finvideo._totalframes) {
mc_finvideo.gotoAndPlay(intMCCurrFrame - 100);
} else {
mc_finvideo.unloadmovie();
}
this.gotoAndPlay((intCurrFrame - 100));
The fast forward button is similarly problematic -- if I click fast forward within 100 frames of a frame where a movie clip will load, the frame that the movie fast forwards to has no movie clip playing because the frame that loads the clip was skipped over.
Can anyone help me make this work? (Maybe I'm going about this whole thing the hard way?)
I can post a sample fla if it will help clarify.
Thanks
Control The Play On The Main Timeline From Within A Loaded Movie (not A Movie Clip)?
Question... I have a movie (main movie) that loads another movie (movie 2) automatically. Movie 2 contains a button that loads yet another movie (movie3). Now I’m having trouble with this next part... When movie3 loads I want "main movie" to stop where it’s at in the timeline and stop all other loaded movies until the user clicks another button where upon movie 3 will go away and "main movie" will resume. Movie 2 is like the paper clip guy in Word and movie 3 is my help movie. Therefore, it can be accessed at any point during the main movie and I don’t want to use a goTo command to jump to a frame label or scene. Does anyone have any idea how to control the play on the main timeline from within a loaded movie (not a movie clip)?
Control Main Timeline From Clip Inside Movie
Have a movie clip on my timeline(its a button)
_root.home.onRollOver = function(){
_root.home.gotoAndPlay("over");
_root.home.back = false;
_root.home.play();
}
_root.home.onRollOut = function(){
_root.home.gotoAndPlay("out");
_root.home.back = false;
_root.home.play();
}
_root.home.onRelease = function(){
gotoAndPlay("main", 1); }THIS IS WHAT I CANT GET TO WORK
When I click the button nothing happens. Ive tried..
_root.gotoAndPlay("main", 1);
gotoAndPlay("_root.main", 1);
gotoAndPlay(_root."main", 1);
Ofcourse none of theese worked.
Main Timelline Control With Button In Movie Clip
I'm trying to make a photo gallery site with a dropdown menu. Within the menu are buttons to jump the main timeline to the corresponding scene, each scene will have a different group of pictures.
I can get the buttons to work only if I don't have a 'rollover' and 'rollout' control on the dropdown menu (ie if the menu movie clip is NOT animated).
I'm pretty unfamiliar with actionscript so I would love some help.
http://www.missouri.edu/~bdlhb9/menutest.html
Here is the link to what I have. As you can see the buttons are not working but the movie clip is. How can I tell the buttons to work?
Thanks.
Control A Dynamic Movie Clip From The Main Timeline
Hi everyone,
Here is the problem, I have two .swf files
one of them is the base movie that loads data about a template, and then loads the template (2nd movie) inside an empty movie clip on stage. Now I want to load an image inside a movie clip which is inside the template(2nd movie) using AS from the main timeline (base movie).
Thanks is advance
Ameretat
Make Movie Clip Control Main Timeline
i just got a navigation menu from someone but i am having a problem using it. it is done in movie clips and not buttons, so how do i get it to control the main "timeline" or "movie" with which it resides?
i am using flash 8.
any help would be greatly appreciated!
matt
Need Control Over Main Mc From Final Nested Movie Clip
I have created a flash promo banner for my site but am having trouble controlling the loop of the entire movie. I am fairly new the to AS so it may be a very simple solution that I am just missing. I have nested 3 Mc (wd_mc, pd_mc, id_mc) and am having trouble returing to the main MC wd_mc
I have used:
_root.gotoAndPlay()
this.parent.gotoAndPlay(1)
wd_mcgotoAndPlay(1)
All in the last Action frame of the final nested MC.
And none have proven to be any success. There is a link below to my website with the animation playing, as you can see it only plays once and the final Mc continued to loop itself. I want it to loop from the Main Mc (wd_mc) as this will look more professional. Can anyone offer any ideas. The actual file is also posted if you need to see inside of the fla. for any clerification.
[url="http://www.msu.edu/~townse85/is2k.html"]
Please help...been at this for three days.
Thanks
Control External Movie Clip From Main Swf - Works In FP6, Not In FP7 - Why?
Hi,
I'm loading an external clip into the main swf, and then endeavouring to control it from the main swf. If I publish as Flash Player 6.0 it works. If I publish as Flash Player 7.0 it doesn't work.
Why? I'm using the correct variables syntax etc...This is driving me mad!!!!
I need it to be FP 7.0. The images should scroll left to right depending on what button is pressed.
Files attached - please take a look...
Control External Movie Clip From Main Swf - Works In FP6, Not In FP7 - Why?
Hi,
I'm loading an external clip into the main swf, and then endeavouring to control it from the main swf. If I publish as Flash Player 6.0 it works. If I publish as Flash Player 7.0 it doesn't work.
Why? I'm using the correct variables syntax etc...This is driving me mad!!!!
I need it to be FP 7.0. The images should scroll left to right depending on what button is pressed.
Files attached - please take a look...
Buttons In One Movie Clip Controling Main Clip
I have a movie. In the center on the movie there are a set of four buttons. Instead of the hassle of making 5 or 6 extra layers on the main movie, I made them on their own clip. Now, if I press a button on that clip, can I make a play action work for the main clip? It seems to just make the buttons play again.
When it plays the button clip goes away and a tween moves the background around to the next step. The button sets a variable which determines which movie is loaded thereafter.
Thanks ahead of time! :^)
Using Movie Clip To Control Main Movie
i have a movie clip sitting on my stage. the movie clip is just 4 buttons
they are : skip back, replay, continue, and skip foreward
when i click (for example) the continue button, i just want the main movie to play.
this is what i have on the button in the movie clip.
Code:
on (release) {
tellTarget ("_root") {
play();
}
}
but its still not telling the main movie to play.
help please
Controlling Main Timeline From Movie Clip Buttons
Hello,
I have a drop down menu that is a movie clip, when you mouse over it, It drops down and 5 buttons are displayed. So when i put action scipt in it to make the main timeline go to a different flag, It doesn't work. this is what i have tried so far.
Code:
on (release) {
gotoAndPlay("_root", "dorms");
}
Code:
on (release) {
gotoAndPlay("Scene 1", "dorms");
}
Code:
on (release) {
gotoAndPlay("dorms");
}
Anybody help me
Back Buttons Returning To Main Movie Clip
I have created a small movie with 1 scene containing some movie clips activated by buttons. In frame 1 of scene 1 is text, a background, and the buttons. In frame 2 there is the background and buttons but the text is missing so that the movie clip can show its text without overwriting the text in frame 1. When the new movie clip loads how do I get it to return to frame 1 so the text reappears? I have inserted and on mouse event command and a goto and stop scene 1 frame 1 but it always goes back to frame 2,and tried to name frame 1 in the movie but nothing works! attached is my movie.
Getting Movie Clip Buttons To Work Within Main Area
Hi, Ive just started to design a Flash web page that I'm having difficulty in getting working as far as the drop down menu is concerned. The site consists of the main stage which has all of the pages with buttons that work and link to the relevant frames on the timeline. Then On one of the buttons I have a movie clip (which from reading about paths etc means it resides on its own timeline, this movie clip is a drop down menu. I've read up a bit on action scripting but still cant seem to implement the code I need (Im not a very codey person)
Basically the buttons in the movie clip of the drop down menu need to link to the relevant frames on the main stage. Does this mean I have to put a code in taht links the movie to the main stage fram whatever on release or is it the other way round does the movie clip need need to be loaded into the main stage.
Might be a lame question but I cant figure out what I need to type.
I've posted a link to the site, just incase I make no sense. Basically with in the MEDIAMOV movie clip on FRAME 6 the image and sound buttons appear. IMAGE needs to link to the main clip and play frame 14, and the sound button needs to go and play frame 18. Ive organised the pages into layers on the main timeline.
http://www.benhealy.com/FLASH/SITE_PAGES.fla
Thanks
Main Movie With Buttons Link To Movie Clip
Basically, in Scene 1 (my only scene), I have buttons that call certain parts of a movie clip.
I've pulled the movie clip into the scene where I want it, and named the instance.
The movie clip has different things happening along the time line that relate to the different buttons. Each one has a stop action, as needed.
I placed the action of onrelease, tell target for each button to go and play the correct scene. Which it does - the first time. If the user hits one button, it goes to the right frame of the movie clip, etc, but if you hit the same button twice, then it jumps to a different button's place.
If there are only two buttons, it keeps switching back and forth.
If there are more than two buttons, only the last button is the messed up one - and if you hit it twice in a row, it goes back to the first button's frame of the movie clip.
Make sense? Any ideas of how to stop this. I even followed an example of this in a book EXACTLY and I get the same problem.
Thanks.
Buttons To Control Movie Clip?
This is a very basic question, but it has eluded me for a while. How can I get a button to play a movie clip that is in my library? I'm just trying to have a menu button activate a submenu movie clip, I've tried onMouseEvent and loadMovie and it keeps giving me an error saying it can't find URL. I really need to be walked through it. I am a moron, I know.
How To Control 1 Movie Clip With 2 Buttons?
Do you know how to control 1 movie clip with 2 buttons?
Example:
Have movie clip (instance name MC) with 10 frames.
stop() on frame 1 and 5.
Have 2 similar buttons with opposite action.
BTN1
If movie clip is on frame 5 than play it from 6
If movie clip is on frame 1 than nothing.
And opposite action on second button:
BTN2
If movie clip is on frame 1 than play it from 2
If movie clip is on frame 5 than nothing.
So button action is affected by currentframe of movie clip.
I try to use this code:
BTN1.addEventListener(MouseEvent.MOUSE_DOWN, down1);
function down1(event:MouseEvent):void {
if(MC.currentframe == 5) {
MC.gotoAndPlay(6);
} else {}
}
And it doesnt work.
It seems that function cannot work with MC.
How can i do it?
How Do Use Buttons To Control Movie Clip?
hi ppl, i am flash newbie, i am trying to use buttons to stop, play, go forward, go backward and go back to start and i cant seem to make it successful. help anyone?
Control Movie Clip Using Buttons
Hello,
I am new to Action Script or any kind of programming language, but determined to try and understand it.
My question is probably very simple, all I am trying to do is control "myMovie_mc".
I have created four buttons "up_btn", "down_btn" etc.
I can get the movie clip to move each time I rollover a button.
How do I get continuous movement when I keep my cursor over a button?
Thanks in advance for your help.
up_btn.onRollOver = function() {
_root.myMovie_mc._y -= 10;
updateAfterEvent;
}
How Do Use Buttons To Control Movie Clip?
hi ppl, i am flash newbie, i am trying to use buttons to stop, play, go forward, go backward and go back to start and i cant seem to make it successful. help anyone?
Buttons To Control Separate Loaded Movie Clip
I have a slideshow with two versions -- one auto-advance and one manual-advance. I need to make some buttons in the main movie to control the slideshow movie clips separately, but in the same space. I made a new movie for the auto-advance one that plays straight through. So I think I can write the code for that one.
The manual advance one, however, is a little bit trickier for me. I have a series of keyframes with an image on each keyframe. I've done this before, but not quite like this. The one I did before was self-contained with the buttons in the same movie. For this one, though, I need to set it up so that depending on which set of buttons is clicked, either the auto-adv or the manual-adv will load in the same area (I have a masked layer behind a TV screen). For the one I did before, this is the manual button code:
For the forward button
Code:
on (release) {
if (this._currentframe == this._totalframes) {
gotoAndStop(1); }
else {
nextFrame();
}
}
and for the back button
Code:
on (release) {
if (this._currentframe == 1) {
gotoAndStop(this._totalframes); }
else {
prevFrame();
}
}
I hope this is clear. How do I apply the above code to my desired scenario? Any assistance or direction will be greatly appreciated.
Summarah
Control Main Timeline From A Clip?
I'm sure this is a simple syntax thing - and seems like a very basic thing to know - but I don't :-(
I have a very simple movie (slideshow style)
I'm creating 2 movie clips within my main movie which will be different lengths.
So clip 'a' is 90 frames, clip 'b' is 125 frames.
I have 2 frames in my main movie - each with one of the clips on it and each with a stop(); action.
***
I want to add a script to the end of my clip 'a' that says "go to and play frame 2 in the 'MAIN MOVIE' timeline" so that it will play clip 'b'
***
I tried using goto("scene1", 2) but it didn't work - would just restart clip 'a'
NOW - I do realize that I could simply space the movies out on my main timeline so it would just run its course and remove the stop so it would continue to clip 'b' but thats probably not the 'clean' way to do it - and then when my clip 'a' changes in frame count for whatever reason I have to go move everything - so I don't want that solution.
I'm looking for the way to move the main timeline to the next frame (or any given frame) from within the clip - either that or from the main timeline - if it can simply detect when clip 'a' has finished...
Sorry I think this is long winded for a simple question. Thanks for any help on the matter! --bp
Buttons In Moviclips. Can They Control The Main Timeline?
does anyone know of any actionscript that can be applied to a button that is
IN a movieclip so it can navigate the main timeline INSTEAD of just the mov
ieclip's timeline?
I've tried applying this script to a button in a movieclip:
on (press) {gotoAndPlay("scene1","1");
}
this doesn't seem to navigate the maintimeline at all though.
I would really appreciate any help
Pause And Play Buttons To Control Main Timeline?
i have multiple "scenes" with no movie clips in them. i would like to add 2 buttons (one to pause and one to play) to control the timeline throughout the piece. how do you create buttons that control a timeline that is not a movieclip???
Loading Movie Into Main Timeline From Movie Clip Within Main Movie
Hi there,
I'm having major difficulties loading external SWF's into my main movie. The button actions are in a movie clip within the main movie. I've used the following AS to load in my external SWF files on higher levels:-
mybutton_bn.onRelease {
loadMovieNum("two.swf",1);
unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
}
Similarly, my external text files are not loading!
myLoadVars = new LoadVars();
myLoadVars.onLoad = function() {
my_txt.htmlText = myLoadVars.myHTMLdata;
}
myLoadVars.load("textfile.txt");
All works fine until I upload to the server. It's really driving my around the bend. Any suggestions will be gratefully received.
Many thanks
Q.
MC And Control Of Main Movie
Sorry for the seemingly inept question, but I cannot figure out the answer....
I have a movie clip within the main movie that I want to use to control where the user goes (sort of a menu system). Well, that's actually what it is......
Anyways.....
How do I tell the buttons with the movie clip (menu) to go to a certain scene within the main movie? I have tried several different combinations, but the closest I have gotten is being able to access the very first scene of the main movie; which starts the whole problem over again.
Thanks for saving the remaining few hairs on my head, before I pull them all out.
Control MCs From A Main Movie--please Help
I am still pretty new to Flash and I have a problem with a web site.
(using Flash 5)
I have a main movie that basically only shows buttons for navigation and a "box" in which movieclips should be loaded on button-click.
I created that main movie which has one frame so far (only showing the buttons and the box). I also have two movie clips so far, one is named "company", the other one "editorials". Let's stick with these two for now.
My problem is, I really don't know where in my main movie I should place these movie clips. Do I put them in frame 2 and 3?? And what action should the buttons have to load and unload these movies?
If someone wants to help me here, please make it foolproof...I really need help!
THANKS!!
How To Control The Main Movie?
From a movieclip in my main swf, I load an external movie using this code:
loadMovieNum("gallery.swf" ,1)
While the 2nd external movie(gallery.swf) is playing, you can still here the music and the movie still keeps playing in the background from the main swf. Which is O.K., except when I unload the 2nd movie, I want it to go back to the very beginning of the main movie. But while experimenting, I keep getting overlapping sound loops.
My question is:
Is there a way to unload the main swf or clear it, while # 2 movie plays, then restart it (preferably without the preloader) after unloading movie #2?
Control Main Movie From LoadedMovie
I have loaded an .swf on to my main movie ("menu"). The loaded .swf has a button that unloads it when pressed, but I would also like this button to reset the main movie ("menu") back to its start.
All help appreciated.
Control Main Movie From External Swf
hello all,
When i load an external swf into my main movie, how would I get a button inside the external MC to back and play something on the main timeline?
for instance if i have a home button in the ext. MC and want it to go play the frame labeled "home" in my main movie?
*note: using FMX2004
Thank you
Control A Movie From The Main Stage
Ihave a mc on my main stage however when a button is pressed on the main stage i wish the mc to return to a certain frame of the mc.
I have seen people post about this before so know it can be done and no doubt its relatively easy coding, however it avaids my knowledge..
Any Help Gratefully appreciated
[F8] Control The Main Movie From An External Swf
I have an external .swf loaded into in my main movie and I would like to direct a script that when the external swf is unloaded it goes to a specific frame label in the main movie. Is it possible to control the main movie from an external swf?
Thanks
Loaded .swf And Main Movie Control
hey guys simple question needing answered
i have a flash file where the .swf files load in on to the stage (this works fine). but basically what i need to know would be how to edit the follwing code so that when a button is press in the loaded .swf it will go to a certain frame on the main flash file
if (Username_txt.text == "admin") {
gotoAndStop("admin_page");
}
i've tried adding _root, _parent to the start but that doesnt work is there any other code i should try
thanks in advance
Control _level From Main Movie
When the movie loads, it also loads a movie onto level 1. When a button in the main movie is pressed, I would like the movie that was loaded on level 1 to gotoAndPlay(1);.
Any thoughts on how I can do this?
Thanks in advance
Control Movie Clips Inside Main Movie
Please help me! Maybee it's a stupid question?
I'm trying to create an animated movie. I created 4 movie clips inside my main movie (10 frames in each movieclip) I would like to play first movie clip when it's finished start to play the second, then third, fourth.... and I placed each movieclip in the single frame on the timeline. But when I played movie I only see the last (fourth) movieclip and don't see first 3 clips. Maybee somebody can help me with ActionScripting, or maybe can tell me where I can find some information.
Thanx.
Simple?: How Do I Control Main Movie With Movie In A Different Level?
Hi,
I have a main movie (on level 0)with other movies getting loaded into other levels. I want to be able to target a specific scene in that main movie from the movies in the other levels. How do I do this?
Any help is greatly appreciated. The sooner the better.
Thanks in advance,
D
Control Function In Main Movie From Loaded Movie
I have a main movie (securityGrid) setup. It is a form for adding and updating user information for an application.
I have a second movie (empSearch) that allows me to search the user database, so I can add a new user to the application. I want to use this movie as the default search movie in other movies
I have an empty movie clip (holdMovie) in the main movie (securityGrid) that loads (empSearch) using a on press function with a button. It also passes in parameters from (securityGrid) to tell (empSearch) what the output parameter is and that it is a movie and not an HTML call. This part works fine.
loadMovie(empSearch + varString,_root.holdMovieMC);
After I use (empSearch) to find the person I want, I click a button to send that information back to (securityGrid). This part does not work. I've tried many methods of getting this work.
Set a global
outputResults = itm.empName + "," + itm.loginId
_global[outputVariable] = outputResults;
This works, but I can't find a way to trigger a function in (securityGrid) to unload (empSearch) and then fill in the add row form in (securityGrid).
_root.getAddUserForm(outputResults);
Does anyone have a simple example of what I am doing, so that I can possibly figure out what I am doing wrong? The movies and database are on a Intranet, so I can't post an example.
|