Button To Play Main Timeline?
Hi, I have a button that I want to continue playing the main timeline and I cant seem to get it to work From my understanding it should be pretty simple.
FlashKit > Flash Help > Flash General Help
Posted on: 04-15-2005, 03:08 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pause/Play Button Referring To Main Timeline...
I'm working on a site that includes a button that says "pause" - when the viewer clicks it, it switches to say "play." Right now, it's a two-frame movie clip that has one button on each frame. I know I need to specify that the Pause/Play action refers to the main timeline (possibly using "_root"?) but I have no idea where to place that. Here's the script for both frames:
Frame 1:
on (release) {
stop ();
}
on (release) {
this.nextFrame();
}
Frame 2:
on (release) {
play ();
}
on (release) {
this.lastFrame();
}
Am I on the right track? Would _root go before or after the command? It's switching from "Pause" to "Play" and back perfectly....
Thanks for your help....
Julia
Button To Play MC & Goto Point On Main Timeline
Hi
I have a button on my scene. When clicked on, I would like to play a MC and go to a specific point on the main timeline.
However, the MC it will play will depend which frame the movie is on, when the button is pressed. I have the script, which will help to explain my question: -
on (release) {
if (frame = 10) {
_root.About.play();
_root.gotoAndPlay("Overview");
}
if (frame = 20) {
_root.Client.play();
_root.gotoAndPlay("Overview");
}
The script doesn't work! Can anybody advise?
Thanks
MERRY CHRISTMAS!!!
Making Main Timeline Play From Button Inside MC
Hello,
i think the title says it all.
I have done this a million times, but for some reason I seemed to have missed something.
My button is inside a movie clip, the AC on the button is this...
on (release) {
gotoAndStop(6);
_root.play();
}
_root.play(); isnt working....
Play Movie In Timeline But Keep Main Timeline In Place
Hello,
Scenerio: You are at frame 1 of the timeline and it's stopped, you hit a button and it jumps you to frame 20 and then at frame 20 a movie clip plays.
Question. Can I have that movie play for however long I want (let's say it's a 100 frame movie) BUT have my main timeline still sit on frame 20? And then when the movie is done playing it goes to frame 21 of the main time line? Currently I have to make my main timeline be the same length as any movie I have in it, and so my main timeline ends up being an absurdly long.
Just a general answer will help - which action scripts would I be looking to use (I'm using Flash 8 Pro)?
Thanks
How Do I Play One Frame From The Main Timeline From An MC ?
as the title sais , i am in a movie clip and when i click on this button i wanna gotoandstop a frame that is on my main timeline. I cant put this
on (release) {
_root.gotoAndStop (framenumber);
}
because i want it to go to the main timeline in the second scene , but when i put _root... it goes to the root of the whole prject i want it to go to the root of the second scene
Unload Mc And Play Main Timeline?
I have a main movie "main.swf" and in an empty movie clip (instance name "empty") on that timeline, I have it loading another movie ("continue.swf") that takes you to the end of the presentation...
This is the action on frame 1 of "empty":
loadMovie("continue.swf", 1);
I need the entire presentation to loop. I have a frame labeled "startsite" where I need the movie to start over from on "main.swf"
So at the end of "continue.swf" I need an action that tells it to go to "main.swf" and play frame labeled "startsite," right?
I've tried:
_parent.gotoAndPlay("startsite");
I've tried:
_root.gotoAndPlay("startsite");
I've tried unloading the movie clip "empty" from the main.swf with:
this.removeMovieClip()
but everything I try only loops the "continue.swf"???
Can someone please help?
Play/Stop Flv From Main Timeline?
http://studio34design.net/aleks/aleks_chem3.html
about 30 seconds into this flash, there is an FLV of a computer screen. The problem is, when I pause the swf, the flv keeps going. How do I get around this?
1. Is it possible to convert the flv to swf?
OR
2. Is it possible to control the flv from the main timeline?
thanks people!
Action On MC To Play A Frame On Main Timeline
Flash 8
I'm trying to get a Movie Clip (in the 1st frame of the main timeline) to end by going back to frame 10 of the main timeline in Scene 1. I put an action in the MC's last frame
gotoAndPlay("_parent", 10); but nothing happens
I also tried "scene 1" " _root1" "_level1
Is there a way to navigate from the Movie Clip to the main timeline of Scene 1??
Thanks
Loadmovie On Main Timeline, Play, Then Continue...
Work on my Flash site is going great, but like most newbies it feels like I'm literally pounding this thing into shape with a sledgehammer.
I've got a simple question (aren't they all), and I swear I've searched the forum but to no avail. The answer is out there, but for some unGodly reason I can't find it.
I've got a main timeline with, say, 55 frames. There's a brief animation tween in the first 10 frames. At frame 11 I'd like to stop the main timeline, load a movieclip called mcPort (SWF would be fine as well) and have it play AUTOMATICALLY, and then restart my main timeline at frame 12 once mcPort is finished.
mcPort is basically a long slideshow type movieclip. I plan on adding 1 or two others of this type into my main timeline. I realize that I could just do all of this slideshow animation stuff within my main timeline, but it just gets unmanageable.
I gotta think this is possible. My search reveals people wanting to do the same thing, but always with a button action. My hunch is that a container is used, but I've not used one yet.
Thanks much
Play A Movieclip Once, Then Go To The Next Frame On The Main Timeline
Hello, I'm sorry for the long topic's title.
I have an animation I'd like to use as an INTRO in my flash movie. I will joint it inside a movieclip, giving it the istance name "INTRO". And I position it in the first frame of the main timeline.
How can I make possible that played once my intro (my movieclip) the player jumps to the second frame of the timeline, named by the istance "HOME".
Is it possible?
Thankyou very much for your help,
and great things.
Stebianchi
Making Main Timeline Play From Inside Mc In AS3
Hi
I'm primarily a motion graphics guy but am helping out a friend with some Flash web work. I have CS3 now but haven't touched the app since MX so Actionscript 3 is taking me some time to get to grips with - not that I was any more than a dabbler anyway.
I am simply trying to make the main timeline play when an MC on the stage reaches the end of its animation. I have tried variations of root.play("menu") or parent.play("menu") in the last frame of the MC but I get:
"1061: Call to a possibly undefined method play through a reference with static type flash.display:DisplayObjectContainer."
Also it breaks the previously ok code and the 'stop' on the 2 frames of the main timeline are now ignored.
Then I see stuff like this -
MC Instance On Main Timeline Play In Order
I don't know if my title is clear enough, but I'll try to clarify.
I have one MC on the main timeline, and duplicates of the same MC one after another. So basically 8 of the same MC lined up beside eachother.
Now the tricky part. I want halfway through the original MC, to jump to the second MC instance and start from frame1. Now the dilema is, that if I make an actionscrpit on the MC, it affects all the MC lined up together, because they are an instance of the original.
Could I use the duplicateMovieClip command, and how?
MC Instance On Main Timeline Play In Order
I don't know if my title is clear enough, but I'll try to clarify.
I have one MC on the main timeline, and duplicates of the same MC one after another. So basically 8 of the same MC lined up beside eachother.
Now the tricky part. I want halfway through the original MC, to jump to the second MC instance and start from frame1. Now the dilema is, that if I make an actionscrpit on the MC, it affects all the MC lined up together, because they are an instance of the original.
Could I use the duplicateMovieClip command, and how?
HOW TO MAKE INDIVIDUAL MOVIECLIPS PLAY ON MAIN TIMELINE
I have been making individual movieclips for my flash website intro so as not to have long framelengths on the main time line. But, how do I make them play one after the other? I am trying to get familiar with onClipEvent and use frame labels, but just cant make it work. Please Help!!
Movie Clip Symbol Won't Play On Main Timeline
Hi everyone,
I've created a movie clip symbol with it's own animation on its timeline. I've placed this symbol onto the first frame of the main timeline but when I test it, it doesn't play. There's no stop actions or anything on either timelines so I'm not sure why this is happening. I thought that the animation in a movie clip symbol will automatically play (i.e. if you test in a browser) once it's on the main timeline - is this right? Or am I doing something wrong. Maybe I need to tell it to play?
Appreciate any advice.
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???
Tell Movie Clip To Play/stop From Main Timeline?
I have a main timeline that has a movieclip called "Clock". At one point in the main timeline I want the movieclip to play and at another point I want it to stop. I can't get script to control the movieclip.
Any tips?
Thank you so much for your time.
Please Help First Website Movie Clip Placed On Main Timeline Wont Play
Hi! if any one could please help me it would be greatly appreciated!
So im trying to make my first website in flash and ive ran into a problem. I have the main movie, my main time line. I have a few animations going on in this that were all created in that main time line. those work fine. however, i created two new movie clips (still inside the same .fla file) and animated them with thier own time line. I then thought you could just drag and drop these movie clips onto your main time line and they would play inside the movie. but when i press ctrl + enter, the dont play!
here are some points of intrest.
my main movie (the main time line) is 130 frames.
the movie clips i made inside the same .fla file are between 400 and 600 frames.
i placed both new movie clips on the 130th frame in the time line with their own layers.
also there is a layer for actions on the 130th that has stop();
i thought that maybe the time line had to be as long as those movie clips i created and so i extended it but they still didnt play.
im thinking action script is involved? please help me im getting pretty frustrated and im sure there is something simple to achieve this.
here is a link where you can download the source files im using. if you open the file the two movie clips i created are called front two and front one and are layers with the same name.
this board wont let me fully post my link cause the last word in it is s*h*i*t* so youll have to type it in your browser. its http://public.me.com/matts*h*i*t* (just remove the asterisks)
also i noticed that my file is huge. i used photoshop to create everything and them imported it into flash. is there a way i can reduce this size?
thank you sooo much! please help!
-Matt
Telling Main Timeline To Play Backwards From Movie Clip
Hi,
I am trying to tell flash from within a movieclip to start playing a specific frame within the main timeline only after it has finished playing the movieclip backwards. I can get the movieclip to play backwards fine but it's getting the main timeline to start from frame 1 which doesn't work. I have the following code on the first frame of the movieclip (which is called video) but it doesn't seem to do anything
onClipEvent (enterFrame) {
if prevFrame == 2 {
_root.gotoAndPlay(1);
}
else if {
_root.video.gotoAndPlay(2);
any suggestions?
How To Reference Subbottons In A Drop Down Menu To Play Content On The Main Timeline?
Hi,
I have created a drop down menu placed in a movie clip with an instance name "how_menu".
The are 4 sub buttons which should play the content placed on the main timeline, referenced by frame labels, e.g. 2.01.0, in scene called 'names'.
How do tell the subbuttons in the movie clip to play the content on the main timeline, in scene 'names', from frame labelled 2.01.0?
I am using Flash MX 2004.
Thanks!
gayeta
How To Sequentially Play/Load External Video Clips (in SWF Format) In Main Timeline?
Hi,
Does anyone know how to sequentially play external SWFs loaded into the main timeline?
I have several SWF files with short videos embedded in them. I wish to load these external SWF files into my main timeline as follows:
User Presses Button -> Play Video Clip in External SWF#1 -> Once Video Clip in External SWF#1 has Finished -> Play Video Clip in External SWF#2.
I tried achieving this by adding: “var endmovie:Boolean = true;” to the end of each video clip inside the external SWF’s (e.g. “1.swf”) then cycling through an if statement in the main timeline to see when this condition was meet:
ActionScript In Main Timeline:
Code:
var mc_Loader = new MovieClipLoader();
mc_Loader.addListener(this);
this.createEmptyMovieClip("Container", this.getNextHighestDepth())
Container._x = 0
Container._y = 0
button_mc.onRelease = function () {
mc_Loader.loadClip("1.swf",Container);
function onLoadInit(target_mc:MovieClip) {
myInterval = setInterval(cycle,30);
function cycle() {
if (Container.endmovie == true){
mc_Loader.loadClip("2.swf",Container);
}
}
}
}
To my surprise, this code does actually work - until you add the "button_mc.onRelease = function () {" part!
How is the best way to go about achieving this? Am I on the right track? (By the way, using .FLV files or one long external SWF file is not really an option due to long loading times...I think...)
Please Please Help!
Button In MC To Main Timeline
Hey,
OK... I have a movie with an image scroller that contains buttons which when clicked should load an external .swf file into a target. Everything works fine when the buttons are on the main movie timeline but when I put them into the image scroller MC they don't work. I suspect that I have to somehow tell the button to load the movie into the target on the main timeline...but I don't possess the wetware to achieve this...please help!
Many thanks in advance!
Button Not In Main Timeline
Hello All,
I am fairly new to flash and would greatly appreciate some help with this... I have many buttons that I need to attach event handlers to but they are embedded within layers of movie clips, and if I write the handler code in the main timeline's 1st frame they are nowhere to be found because they are no yet displayed. If I write the handler code in the movie clip that a button is contained in, and my action is to gotoAndPlay a frame of a different movie clip, that movie clip also not be found. My guess is that I need to write the code within the movie clip that the button is contained in and somehow call up the mainstage and then reference the movie clip that is to be played by the buttonClick event through its respective path... something like (in words):
"look to stage" then...
function buttonClick(speakevent:MouseEvent):void {
portal_mc.logomov_mc.gotoAndPlay(63)
};
speak_btn.addEventListener(MouseEvent.CLICK, buttonClick);
can anybody tell me how to point back to the stage? or some other way of doing this? surely it is possible. any comments would be much appreciated.
thanks, sander.
Button In MC, Moving BG On Main Timeline....
Can someone help me?...I have a MC that contains all my buttons....I dragged it to the stage. What I want is for when I click on one of those buttons..the background on the main stage/timeline to scroll to a certain "X"location to match the button...I have tried everything I know..I even tried to look at a .fla ...but the code was not right for mu movie...(buttons were on main timeline....)
Please I have been seeking HELP for WEEKS!!..I really need to get this done..before I can move on! Thanks
-whispers- I will/can send my .fla to anyone who CAN help!
whispers007@hotmail.com
Mc Button Controlling Main Timeline?
I have to utilize a button within a MC which tells the main timeline [scene 2] to go to frame 2, but when I use:
On Release{
gotoAndStop ("Scene 2", 2);
}
Nothing happens.
Any advise appreciated.
Stop Main Timeline From Mc Button
I have buttons in a movie clip in a timeline. The movie clip rotates. I would like onRollover of the buttons to stop the movie clip rotation; onRollout of the buttons to restart the movie clip rotation.
The timeline looks like:
2 layers, one of them actionscript with three frames. Frame one sets var r to 0;
frame two:
box._rotation = r;
r +=.5;
(where r sets the speed of the rotation)
frame three:
gotoAndPlay(2);
Also, how can I keep the buttons 'upright' as they rotate?
Any input or direction to tutorials is appreciated.
Kevin
Contolling Main Timeline From Button In MC
Ok, I've been out of Flash for quite a while now, but a recent project is throwing me back in.
I'm having a problem controlling my main timeline.
The setup:
A Movie Clip contains a button with this action:
Code:
on (press) {
gotoAndPlay("MovieStart", "SelectALid");
_root.cupstyle = 1;
}
The "MovieStart" is my first scene, and "SelectALid" is the frame label. The global variable 'cupstyle' is being set correctly, but when the button is pressed, it only plays the movie clip again, and doesn't go to the proper place in the main timeline.
What am I doing wrong?
For giggles, I tried:
Code:
on (keyPress "Enter") {
gotoAndPlay("MovieStart", "SelectALid");
}
. . . and it worked! Unfortunately, I want the user to click the button, not press enter.
Any advice?
Thanks
__________________
-Craig
http://craigtown.com
Button In A Mc Not Communicating To Main Timeline
I have a button in a movie clip that is about 4 movie clips into the main timeline. The button's action is to goto a certain frame label on the main timeline, when released. but nothing happens. I am using flash mx 6. Here are some of the codes I've tried with "design" being the targeted frame label on the maintimeline:
on (release) {
_root.gotoAndStop("design");
}
on (release) {
_root.gotoAndStop."design';
}
on (release) {
_level0.gotoAndStop."design";
}
Can anyone help?
Targeting Main Timeline From Button In Mc
I need help. I am constructing a web site in MX. I place a drop down menu in a movie clip to keep it from affecting the main timeline . I am unable to successfully target frames lables in the main timeline from the movie clip.
[F8] Accessing Mc In A Button From Main Timeline
Hey guys, so i have two buttons on the main timeline, button1instance and button2instance. This code is attached to button2instance that is to trigger the behavior inside button1instance:
on (rollOver) {this._parent.button1instance.mc1instance.gotoAndP lay(2);}
where mc1instance is the instance of movieclip mc1 on button1's stage in the 'over' frame.
well, it's not working
this approach works when i access mc's in the same timeline. for example:
on (rollOver) {this._parent.somemovieclipinstanceonsametimeline. gotoAndPlay(2);}
so what am i doing wrong? is it that i'm trying to tell a movie clip in a button what to do? any suggestions on how to get this working?
MC Button To Stop Pan On Main Timeline
I have a MC that uses Actionscript on the main timeline to pan left and right. inside that MC is a button. What actionscript would I use to temporarily stop the panning effect upon rollover of the button?
here is the code on the main timeline:
PHP Code:
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _xmouse/Stage.width;
var mSpeed:Number;
if (dir == 1) {
mSpeed = mousePercent;
} else {
mSpeed = 1-mousePercent;
}
target.destX = Math.round(-((target._width-Stage.width)*mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
};
}
Button In Mc To Target Main Timeline
HI
I put a button in a mc and would like that button to target a frame or frame label in whatever scene.
This all works fine if the button is outside of the mc on a layer above it.But that is not what I want I am just pigheaded lol and would like the button to do what I want it to do.
It does perform actions such as stop all sounds or change the visibility or whatever or go to any frame Within the mc. I just wondered if I could as I say target from this button outside of the Mc.
Thanks
MrGruff
Button In Movieclip To Main Timeline
I have a button(A) that opens a movie clip which contains a button (B). I want button B to go to and play a frame on the main timeline, NOT a frame in the movieclip. Is this possible?
If not, what I am aiming for is a menu of buttons, that are rollovers from which another menu pops up with buttons you can click.
Help!
Thanks
Button Refer To Main Timeline
Okay so I am unfortunatly new to AS3, so I apologize if there is a very obvious answer to this question.
Okay Say I have a movie Clip on my main timeline and with in that movie clip is a button. That button has a CLICK event that I want o go back and refer to a "frame" on the main time line. How would I go about doing that?
Here is what I thought I should do
import flash.events.MouseEvent;
WebSitesBtn.addEventListener(MouseEvent.CLICK,WebDesignBtnClick);
function WebDesignBtnClick(event:MouseEvent):void{
_parent:gotoAndStop("Web Design");
}
"Web Design" is the Frame Label which I want to refer too
Any ideas on what I am missing or how I can properly refer to the main time line?
Thanks
Button Control Over Main/sub Timeline
i hav 2 scene, using button to swap in between file.
if the button is in maintime line i can swap in between
but my button is inside a movieclip in overview.
After i click it reload the overview_scene,
and my script on button is
********
on (release) {
nextScene();
}
********
is it using
_root or
this.(dot)
.
Button Control Over Main/sub Timeline
i hav 2 scene, using button to swap in between file.
if the button is in maintime line i can swap in between
but my button is inside a movieclip in scene_1.
After i click it reload the scene_1,
and my script on button is
********
on (release) {
nextScene();
}
********
is it using
_root or
this.(dot)
.
Moving AS From The Button To The Main-timeline
Hi guys.
I am so frustrated now - I'm trying to clean up my code, but I just don't understand this issue.
I understand that on(release) { becomes btn_name.onRelease = function () {
- But there are two things I just don't manage to convert;
1) How do I move the following from the btn_volumeSlider to the main-timeline?
ActionScript Code:
onClipEvent (enterFrame) {
_root.global_sound.setVolume(_root.volume*2);
}
2) And how do I fix this? I don't understand what to put in front of the onEnterFrame - I am a bit troubled by these things... I have tried both the button-instance, _root and mc it's addressing, without any results;
ActionScript Code:
btn_chapters.onRelease = function () {
// Works when functionality is triggered from the button, but not from the main-timeline.
delete this.onEnterFrame;
gotoAndStop("index");
} // end btn_chapters.onRelease()
Very eager to hearing your suggestions.
Button Control Over Main/sub Timeline
i hav 2 scene, using button to swap in between file.
if the button is in maintime line i can swap in between
but my button is inside a movieclip in scene_1.
After i click it reload the scene_1,
and my script on button is
********
on (release) {
nextScene();
}
********
is it using
_root or
this.(dot)
.
Flickering Main Timeline Frame And Button With MC
I have a problem with a button which when hit should go to a movie clip. The clip has only one frame in it as well as the the main timeline. I have put a stop action on the main timeline and one on the mc, the button on the main time line stage has a GoToAndStop ("name_mc") action (there are more buttons to press on the MC), the labels are made with the correct instance names and attached to script etc....the problem is that when the button is hit the MC and the main timeline frame flicker back and forth between the each other's two frames. Any suggestions?
Button In Moviclip Playing Main Timeline?
can i make a gotoandplay statement from a button in a movieclip to the main timeline, where this movieclip is placed?
goal: i want my menu (which is a movieclip on the main timeline) to slide out from the stage when button in the menu is pressed, in its current position of its own timeline.
tweens: frames 1-30 menu slides in [stop]. frames 31-60 menu slides out [stop].
Having Trouble Getting A Button To Do A Command On The Main Timeline
Hi,
On a button I've got this script:
on (release) {
_root.homeTarget = true;
}
On the main timeline (on scene 3) on frame 60 I've got this script:
if (_root.homeTarget == true) {
gotoAndPlay(61);
}
stop()
Now, if I'm right, then after I click on the button the playhead should go straight to frame 61. Right? Wrong. Why is that???
Now I don't want to have to name the frame label (61) a name so the button will go to the specified frame name. Reason being, because I don't want to have 4 different sets of buttons that have actions with different targeted frame names on each of them.
Can anybody help me???
Thanks.
Blastbum
Button Inside MC Controlling Main Timeline
Hello,
I have a movie clip on Scene1 of my timeline and inside that MC is a button, how can I set it up so that when that button is clicked the main timeline moves ahead one frame? Everytime I try to advance the main timeline one frame it only moves the MC ahead one frame!
Thanks!
Targeting A Frame Within An Mc On The Main Timeline From A Button In Another Mc
I'm sure you all find this quite simple, but I just can't figure it out!
Please Help!
I have two mc's on the main timeline
In one mc(agendaClip)I've got a button
In another mc (navLoopOnOff) I've got two frames
Now I would like to point to the second frame in the mc "navLoopOnOff" from the button within the mc "agendaClip".
How do I do that?
(I'm using flash MX 2004 pro)
Thanks a bunch!
Leoni
Sound Button Separte From Main Timeline
Can someone point me to where I can learn more about creating a button that controls (start and stops) a sound independent of the main timeline which I want looping and always playing. I tried to search for it but had little luck.
|