[MX04] Stopping A Movieclip From Main Timeline
Does anybody know of any actionscript to put on a flash button that will make a movie clip stop playing when rolled over (not an offstate in the clip) but separately on the main timeline? Kind of like a stopallsounds but for a specific movieclip? I have something that is making me crazy!!
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-14-2006, 02:34 PM
View Complete Forum Thread with Replies
Sponsored Links:
[F8] Stopping/Starting Movie Clip Via Main Timeline
I want to play a movie clip from the beginning at a certain point on the main timeline (let's say frame 10), stop the movie clip at frame 50 (of the movie clip), let the main timeline play for say another 10 frames, then start the movie clip again from frame 51 (of the movie clip).
This would enable me to play the movie, pause it and show something else for 10 frames, then resume the movie instantly.
I don't want buttons. This should be simple. The movieclip is called "InfernoT" in the library.
Thanks a bunch,
Mike
View Replies !
View Related
[MX04] Getting Instance Variable In Main Timeline & Arrays
i just thinking of making like 10 boxes and having a value in each. ie each is a boxbutton movieclip and in each
after it saves the times its been clicked.
then after clicking there is a button to finalize where it counts up each of the clicks from each box and shows 3 clicks for box1, 2 for box2 etcetc
just wondering if i could turn the movieclip into some sort of array like box[1],box[2], etcetc and how to use like _root.box[1].boxbutton.boxen
in boxbutton i have:
boxen = 0;
ive successfully set like _root..box1 = watever from boxbutton symbol in library but i need it to be kinda local to that symbol and the maintimeline to call each symbol's specific variable
thanks a tonne!
View Replies !
View Related
Main Timeline Var In Movieclip
Hi--
I'm setting a variable on the first frame of my main timeline and need to read that value from the first frame of a timeline inside a movieClip. How do I do this?
trace(this.parent.vid);
Code:
trace(this.parent.vid);
doesn't work!
Help!!
Thank you!
:grimey
Code:
trace(this.parent.vid);
View Replies !
View Related
Help With MovieClip Call From Main Timeline
I am trying to get an instance of a movieclip placed on the main timeline to go to frame 9 of the movieclip instance that is residing on my main timeline, but it doesn't seem to work for me. Here's what I am doing.
I placed a movieclip on my main timeline and gave it an instance name of bob.
Then on the main timeline (on a frame# => where bob is), I placed an action that says:
bob.gotoAndPlay( 9 );
According to the MM docs, this should tell the instance to go to frame 9 of the instance of bob and play. Within the "bob" movieclip there is a stop command at frame 10 so it should go to frame 9 and play 9 and 10 (which is what I want it to do).
Am I overlooking something?
Thanks for your help.
Topearn
View Replies !
View Related
Controlling Main Timeline From Movieclip
I've inserted a button within a movieclip, and I need it to control the main timeline, specifically jump to a different scene.
Here's the script...
on (rollOver) {
gotoAndPlay ("1");
}
on (rollOut) {
gotoAndPlay (23);
}
on (release) {
gotoAndPlay ("Brief", 1);
}
It's the last one thats the problem. "Brief" is a scene on the main timeline. But it's just not working. Any ideas?????? (the first two, "rollOut" and "rollOver" are on the movieclips timeline)
Thanks!
View Replies !
View Related
Movieclip Preview On Main Timeline?
This may be a very stupid question - even more stupid because I've been using Flash for 6 years. anyway..
I downloaded a FLA the other day from one of those cheesy template emporiums - there was a cool effect, and I was just curious to see "how they did that" etc...,
Nothing was really impressive, except for the fact that as I'm scrolling through the main timeline, the movieclips were going through the motions of their own timelines, in relation to the main timeline. I've never seen this before - in my files, all my movieclips just sit at their first frame when scrolling through the root timeline.
I looked all over in Preferences, and couldn't find anything that looked like what I was looking for.
Is this one of those things that everybody knows about but me? HAHAH. If you know what I'm talking about, please let me know, because I'd love to enable it.
Thanks!
View Replies !
View Related
How Do I? Content In Movieclip On Main Timeline
I've decided that since my entire movie is going to be so small there is no point in making multiple swf's and load the content from them. I would much rather just put the content into individual movie clips that I place on the main timeline. That would also allow me to have the main timeline be no more then 3 frames long including the preloader. I have seen this done but I am not entierly sure how to do it. More spesifically how do I program my button to load and unload the spesific movieclips that I create?
thx in advance.
View Replies !
View Related
[F8] Targeting Main Timeline From Movieclip
Does anyone know how you would target the main timeline from a movie clip placed on the main stage? I have one of those news / text scrollers as a movieclip placed on the main stage with buttons inside of it—I want to have that button load a .swf into a container on the main timeline outside the movieclip, is this possible? Thanks for the help.
View Replies !
View Related
Referencing The Main Timeline From A Movieclip
So I have a movieclip on frame1 of the main time line.
Once the movieclip as finished playing I want to add a line of code that tells the playhead on the main time line to gotoandplay frame 2.
If I add
Code:
gotoAndPlay(2);
predictably the movieclip repeats itself, how do i reference the main play head. I tried
Code:
_root.gotoAndPlay(2);
but it didnt like it
Any ideas?
Many Thanks
View Replies !
View Related
[CS3] Stop Main Timeline From Movieclip
Hi, first time here, and going crazy with a problem: I'm trying to stop the main timeline from a movieclip.
The main timeline contains a movieclip called "copy" with the instance name "bodytext". The "copy" timeline contains the script line :
root.gotoAndPlay(24);
and I get the following error:
1061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.displayisplayObject.
I have no clue what that means.
Any help would be greatly appreciated! Thanks for your time!
-Jon
View Replies !
View Related
How To Reference Movieclip Var From Main Timeline
so i've been googling like crazy trying to figure out something that of course was very simple in as2. I don't understand classes, packages, etc. Is there any other quick fix to this:
Main Time line:
if (ready ==1)
{
do something;
}
movieClip1 Time line:
_root.ready = 1;
from the main time line I am loading an external swf into movieClip1, and am trying to catch when a certain condition is met by changing a variable. Problem is I can't reference the variable in the movieClip1 from the main time line. Any suggestions?
View Replies !
View Related
Animating A Movieclip From The Main Timeline
need help on this.
i have the following instances on the stage of the main timeline.
1. a movieclip of a ball instance name: ball_mc
2. an input textfield speed_txt
3. a button. play_btn
by clicking the play_btn I want to move ball_mc across the stage with the speed equal to whatever is in speed_txt. how do i do this?
View Replies !
View Related
:: | Control Main Timeline From Within A Movieclip | ::
I am having no luck getting my main time line movie clip to play. I have a control box movie clip that has a play button on it. The control box movie clip is dropped onto the main stage, in layer 1, and draggable. The play button is embedded in the control box movie clip that's now on the stage, and draggable. In frame 1 of layer 2 of the main stage I have my movie clip, "Animation1b" which I dragged from the library, waiting to be played. I cannot figure out how to get the play button on the embedded movie clip, (that's now on frame 1 of layer 1 of the main stage) to play the movie clip "Animation1b" that's on the second layer of the main stage. This should be pretty simple, I just have never done this before.
//script currently on the play button that's inside the draggabe control box movieclip.
_root.on(Release){
gotoAndPlay("Animation1b");
}
I have tried variations of the above script, but I can not figure it out. It's pretty much just a remote control movie clip that needs to play a movie clip on the main stage. I need to make sure that the remote is still visible ont op of the movie "Animation1b" as it is playing. Can someone please help me out?
Thanks in advance!
View Replies !
View Related
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
View Replies !
View Related
Can I Create A Movieclip Of The Main Timeline?
I've just spent a few hours making this frame by frame animation across a number of layers, all existing on the main timeline in flash.
I've just decided, I would rather this animation be housed in a movieclip, so I can move the whole thing around easily. Is it possible to make a movieclip of the main timeline, that keeps the layers and frames as they were?
Any hints, much appreciated
p.s.
I'm using Flash8
View Replies !
View Related
Control Main Timeline From A MovieClip
I'm trying to control when the main timeline advances from a mc on a layer, but it doesn't seem to work.
First, I'm loading an external SWF into the mc on the layer. Then, when the external SWF is loaded, I'm trying to advance the main timeline.
Code:
bkgpicblur.loadMovie("m"+_root.nRnd+"_blur.swf",0);
bkgpicblur.onEnterFrame = function() {
tBytes = this.getBytesTotal();
lBytes = this.getBytesLoaded();
rBytes = tBytes-lBytes;
pDone = int((lBytes/tBytes)*100);
if (pDone >= 100) {
// gotoAndPlay(3);
// _level0.gotoAndPlay(3);
// make the main timeline play frame 3!!!
}
else {
gotoAndPlay(2);
}
}
Help??
View Replies !
View Related
Can I Make A Movieclip Of The Main Timeline?
I've just spent a few hours making this frame by frame animation across a number of layers, all existing on the main timeline in flash.
I've just decided, I would rather this animation be housed in a movieclip, so I can move the whole thing around easily. Is it possible to make a movieclip of the main timeline, that keeps the layers and frames as they were?
Any hints, much appreciated
p.s.
I'm using Flash8
View Replies !
View Related
Urgent Please Help Load Swf Into Main Timeline Movieclip
I have a movie Clip on the main timeline. "mc1"
Inside this movie clip is my target movie clip. 'mc2"
I have a swf movie loaded into level 10 that needs to tell a separate movie to load into the target movie (mc2) inside the mc1 on the main timeline.
basically i need to load a movie into a MC inside of a MC on the main timeline.
Is this possible.
Please help very urgent.
I was thinking something like but no luck.
on (release) {
loadMovie("01.swf", _root.mc1.mc2);
}
Thanks
Andrew Kramer
View Replies !
View Related
[F8] Loading .swf Into Main Timeline By Action In A Movieclip
On my main timeline, I have an empty movieclip instance called "container" which I am loading external .swf files into. While on the main timeline, this action works fine:
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip("template.swf", "container");However, I have some buttons located within another movieclip on the main timeline. If I want those buttons to load .swf files into the same "container" instance, what do I need to add... a "_parent" somewhere?
View Replies !
View Related
Move Main Timeline Playhead With AS From A Movieclip
Hi, going crazy with a problem: I want to move the playhead of the main timeline from a movieclip.
The main timeline contains a movieclip called "copy" with the instance name "bodytext". The "copy" timeline contains the script line :
root.gotoAndPlay(24);
and I get the following error:
1061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.displayisplayObject.
I know in AS2 you simply inserted the line _root.gotoAndPlay(); in a movieclip on the stage. I thought in AS3 you would just remove the underscore, but that seems to not be the case.
Any help would be greatly appreciated! Thanks for your time!
View Replies !
View Related
Targeting A Movieclip's Frame From The Main Timeline
Hello,
As stupid as it might seem. I am having a lot of trouble in targeting a movie clip's(that is placed within the main timeline, scene 1) specific frame from a bottom that exists in the main timeline.
I have created a button, and I want to make the button(placed on the main timeline, scene 1 - not nested) simply to goandplay a movie clip. Yet somehow nothing occurs.
Here is the code for my button. "movieClip1" is the name of an instance of my movieclip called "Intro". the number 115, the frame I want it to start at.
on (release) {
_root.movieClip1.gotoAndPlay("115");
}
Can someone please help me?
Thank you
Jaime Nacach
jaimenacach@yahoo.com
View Replies !
View Related
Unloading MovieClip And Playing The Main Timeline
Hi
I seem to be having issues contolling the main timeline from a child timeline. I'vr poked around on the forms to the point of confusing myself.
Here's the sequence of events I'd like to occur:
1. Child MovieClip that's loaded into the maintime on level 12 unloads itself once a button is pressed on the child's timeline.
2. On the last frame on the the child's timeline it tells the parent movie to go to frame 12.
Here's the code I placed on the last frame of the Child's timeline.
_parent.gotoAndPlay(12);
this.unloadMovie()
Right now the Child mopvie unloads successfully but it does not go back to frame 12 of the parent ( main) timeline???
Any suggestions?
View Replies !
View Related
Playing A Nested Movieclip From Main Timeline
I'm creating a website and my knowledge of actionscript is pretty limited so I am asking for help on what is pretty basic stuff.
I have a movieclip called mc_manikin which contains another movieclip called manikin_arm. On Rollover of mc_manikin I want the movielip manikin_arm to play frame 2.
So far I have this:
function wave (e:Event){
manikin_arm.gotoAndPlay(2)
}
mc_manikin.addEventListner(MouseEvent.ROLL_OVER,wa ve);
My function is called wave I'm not sure how to pick out the movieclip inside mc_manikin (something to do with parent and child?)
Help!
View Replies !
View Related
How To Talk To Main Timeline From Movieclip Listener
I'm working on on animated navigation. Each button is an instance of a PrimaryButton class. When each button is rolled over, I want it to trigger a function on the main timeline, but I'm having trouble doing so. I tried:
Code:
private function trigger(evt:MouseEvent)
{
root.testParent();
}
but that gives me an error of:
1061: Call to a possibly undefined method testParent through a reference with static type flash.displayisplayObject.
What is the appropriate way to let the main timeline or Document Class know when an instance on the timeline has had its MouseEvent triggered?
Thanks for any help!
View Replies !
View Related
Nested MovieClip Conflicting With Main Timeline
Well, I have a fla that's broken into 2 frames on the main timeline, the preloader(frame 1) and the content(frame 2).
Code:
stop();
onEnterFrame = function(){
var total:Number = _root.getBytesTotal();
var loaded:Number = _root.getBytesLoaded();
if (loaded >= total && loaded > 0){
//trace("loaded");
delete onEnterFrame;
play();
}
}
This code works correctly and once the entire swf has loaded it plays to frame 2 where I have a stop(); which also works.
Where I run into trouble is when my content comes up. I have 4 different 'destinations', each runs while setting declarations and comes to a stop(); frame with the following code:
Code:
stop();
var nInterval = setInterval(Play, 7000);
function Play() {
if (!_root.paused) {
clearInterval(nInterval);
gotoAndPlay("2nd");
}
}
The gotoAndPlay changes based on where you happen to be in the content, but the identical setInterval code is used, including var/function names.
Running on autopilot like this shows zero problems. The trouble comes from the buttons I have assigned to navigate these 4 frameLabels. On the same frame the buttons navigate to I have a clearInterval set, so regardless where you click to or from the interval is cleared.
The symptoms I see is that, when I am on the first of the four sections of content and I navigate to the fourth, my declarations are set, I can trace and prove that it is reading every bit of code, yet it goes and completely ignores my stop(); command in the nested clip and the MAIN timeline suddenly starts looping and so ignores the stop(); command on the second frame of the main timeline.
The code it sees upon navigating there is no different than on the first/second/third.
This is the frame it sees immediately on release of the button:
Code:
modIterator = 4;
_root.firstLoad = false;
clearInterval(nInterval);
btn1.gotoAndPlay("off");
btn2.gotoAndPlay("off");
btn3.gotoAndPlay("off");
btn4.gotoAndPlay("on");
And then 9 frames later it sees:
Code:
stop();
var nInterval = setInterval(Play, 7000);
function Play() {
if (!_root.paused) {
clearInterval(nInterval);
gotoAndPlay("1st");
}
}
I can trace at any point in either frame and confirm that it is indeed getting there, but it completely ignores the stop(); . The only difference between this content and the others, is that nested further in is an XML Loader, throughout the rest of the swf there is FLV components, combo boxes, etc. all pulling in data dynamically so I don't see that making any difference.
Any ideas whatsoever would be appreciated, been trying ALOT to get this sucker working today.
View Replies !
View Related
Gotoandplay From Button In Movieclip To Main Timeline
Hey,
Perhaps a simple question, but I just can't find the answer on the internet.
I have movieclip, that contains several movieclips and one of those movieclips, contains UIloaders. Now when the picture is loaded I want to be able to click on that picture followed by a gotoandplay back to a frame on the main timeline.
What code is need, since the simple gotoanplay(2) won't work. This will redirect you to frame 2 within the movieclip.
View Replies !
View Related
Converting A Layer On The Main Timeline Into A Movieclip
I'm not really sure how to properly describe this so please bear with me.
Say you create an animated action on your main timeline with a symbol. Then you decide you want to take that action and put it into a movie clip so that it migrates across the screen. Since it is already on your main timeline, how do you take that layer, and convert it into a movie clip?
I hope I've described this clearly enough.
View Replies !
View Related
Navigating The Main Timeline From Embedded MovieClip
I somewhat new to Flash and am using CS3. Not sure why this isn't working. I have an animation that I want to play in between navigations. Here is the code that I am using. The first part is the code within the animation and the second chunck is what I have in the main timeline.
these are the errors i get:
1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:DisplayObjectContainer.
Attach Code
parent.gotoAndStop(parent.nextSection);
var nextSection:String;
homeButton.addEventListener(MouseEvent.CLICK, homeClick);
function homeClick(evt:MouseEvent): void
{
nextSection = "home"
boxAnim_mc.play();
}
View Replies !
View Related
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
View Replies !
View Related
Loading Movieclip Over Main Timeline From Other Clip
I'm not sure if this is possible.
What I would like to do is make a fake window and have it play over the main timeline (but not erase what is already playing there)
I would like to be able to do it from another movieclip
I know how to make the fake windows - I just need to know how to make it play over the main movie
View Replies !
View Related
How To Reference Main Timeline Form Movieclip
I am trying to create a simple interface where the buttons from my interface will change a variable in the main timeline and thus change an objects color speed etc... My problem is the communication between the movieclip and the main time line. I am not getting any errors but am instead finding that the dots which should be created at a set speed are instead not being created at all or are at least invisible. When I set the variables withing the main timeline code everything works fine. But I need to be able to set them from the movieclip.
Thanks for your help!
Here is a link to the fla: http://www.filedropper.com/luetkep1a5
Here is my code:
Code in movieClip:
var speedx:Number = Number(parent);
var speedy:Number = Number(parent);
speedx = 10
speedy = -10
Code on Main Timeline:
//Placing and moving dots
var speedx:Number
var speedy:Number
var xDirection:Number = speedx;
var yDirection:Number = speedy;
var newDot:MovieClip
var colorT:ColorTransform = new ColorTransform();
var scaleDot:Number
bg_mc.addEventListener(MouseEvent.CLICK, makeDots);
function makeDots(event:MouseEvent):void
{
newDot = new GreenDotMC();
addChild(newDot);
this.addEventListener(Event.ENTER_FRAME, moveDots);
scaleDot = Math.round(Math.random() * 10);
colorT.blueOffset = Math.round(Math.random() * 510) - 255;
colorT.redOffset = Math.round(Math.random() * 510) - 255;
colorT.greenOffset = Math.round(Math.random() * 510) - 255;
newDot.width = scaleDot;
newDot.height = scaleDot;
newDot.transform.colorTransform = colorT;
newDot.x = this.mouseX;
newDot.y = this.mouseY;
}
function moveDots(event:Event):void
{
if(newDot.x <= 0)
{
xDirection *= -1;
}
else if(newDot.x >= bg_mc.width - newDot.width)
{
xDirection *= -1;
}
if(newDot.y <= 0)
{
yDirection *= -1;
}
else if(newDot.y >= bg_mc.height - newDot.height)
{
yDirection *= -1;
}
newDot.x += xDirection;
newDot.y += yDirection
}
View Replies !
View Related
Accessing TextBox In MovieClip From Main Timeline
Simply put, I am unable to access the information in my input textbox from my main timeline which is embedded in a movie clip.
here's a snip of my code...
if (formOK) {
// Form processing goes here
message.from = this.nameBox_MC.nameBox_txt.text;
where nameBox_MC = instance name of movie clip which holds textbox placed on main timeline.
nameBox_txt = input textbox instance name placed on timeline of nameBox_MC.
this should make sense, otherwise I'll be more specific.
View Replies !
View Related
Calling A Specific Frame In A MovieClip From The Main Timeline
I have a movieClip named (both as an object and as an instance) vertRotatingBackground sitting in my main timeline. I also have a button in my main timeline that on(press) I want it to advance the frame of the vertRotatingBackground by one. I've tried using gotoAnd... functions, targetPath function, etc and can't same to find a way to properly call the movieClip and reference a frame within that movieClip. Any suggestions would be appreciated.
View Replies !
View Related
Button Inside Movieclip Cannot Control Main Timeline
I come accross a reoccuring problem, where a button nested inside a movieclip cannot control the main timeline, in terms of skipping to certain scenes or frames. I've tried
_root.gotoAndPlay("Scene2");
_level0.gotoAndPlay("Scene2");
but this action doesn't seem to affect the main timeline. Does anyone know how to select the main timeline as the object?
Kind Regards,
Scott Lahney
--
James Cook University
Townsville, Australia
View Replies !
View Related
How Do I Get A Button In A Movieclip To Link To A Scene On The Main Timeline?
How do I get a button in a movieclip to link to a scene on the main timeline?
I took a button I had on the main time line that was linked to goto another scene on release.
I copied and pasted that same button into a movieclip but when you click on the button nothing happens.
Is my path to the movieclip different?
aboutus is the name of the scene
I tried: _level0.aboutus
I also tried: _root.aboutus
as well as:
/aboutus and aboutus
Thanks ahead for help,
-Line
View Replies !
View Related
Loaded MovieClip Calling A Function On The Main Timeline.
HELP!! I'm going out of my mind on this - I can't get it to work, and I've not been able to find a solution posted here, or anywhere!
Here's my situation:
From the main timeline, I am using createEmptyMovieClip to create a movieclip on _level1. Then I am loading a movie into that newly created movieclip. This works fine, no problem.
The problem comes when from WITHIN that new movieclip, a button is clicked, and needs to call a function on the main timeline. I have tried _level0, _root, _parent, just about anything you can think of to address the function on the main timeline that I need to have the movie call. It will not do it - no matter what I try!
PLEASE HELP!!
Thanks in advance,
MultimediaGuy
View Replies !
View Related
Accessing 2nd Frame Movieclip Button From Main Timeline
I have a movieclip placed on the stage called splashScreen. Inside this movieclip i have a button called easy_btn on the second frame but every time i try and access this button from the main timeline using actionscript i get the message
TypeError: Error #1009: Cannot access a property or method of a null object reference.
I'm not sure why because i think i have referenced it properly. Here's my code -
splashScreen.easy_btn.addEventListener(MouseEvent. CLICK, chooseEasy);
function chooseEasy(evt:MouseEvent):void{
for (var i:int = 0; i < 5; i++)
{
etc.....
Can anyone help?
View Replies !
View Related
|