Controlling a movie clip timeline
I am using a loaded movie clip in my movie. This script is on
a button:
loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);
Why can''t I control this loaded movie clip from a button in
another movie clip:
large1_btn.onPress = function (){
_root.largeWorks_mc.gotoAndStop(5);
quote:
Originally posted by:
Opera Rat
Yes, I'm loading largeWorks_mc into the target movie clip
_root.largeEmpty_mc.
Let me see if I can explain this better. If you look at the
old version (the one that loads the entire flash file at once), you
can see the different areas of the movie I am talking about. You
can see it at anthonysmithjr.com
There is nothing there for me.
and then view the gallery. I've just added about 50 new pics
and don't want to keep the gallery the way it is now - loading
everything at once. So each section of the gallery will load when
you go to it - large works and small works.
The thumbnails are a movie clip within the root movie. Then
the large version of the pics are another movie clip in the root
movie. So when your looking at the large work section your seeing
the main movie (the purple background and buttons) and 2 movie
clips (thumbnails and largeWorks). I no longer want large works
movie clip to load when the movie is opened because it takes too
long. So in a version that I have not put up yet I have the code:
gotoAndStop(6)
loadMovie("largeWorks_mc.swf",_root.largeWorksE_mc);
Ok.. this code will work just fine, but instead of having
both LoadMovie() and gotoAndStop() on the same frame, it might be
easier to simply have
gotoAndStop() on your buttons, THEN, on the frame that it
goes to and stops, have the loadMovie()
when you click on the large works tab. This loads the movie
clip of the large version of the pics and it also take you to frame
6 or the root timeline (where the large works thumbnail clip is
located).
So if you were to do what i suggested, on frame six you would
also have your LoadMovie() command.
When I click on a thumbnail in the movie clip
largeThumbnails_mc in the root movie it should tell the movie clip
that loaded next to it to go to the frame that contains that the
large version of that thumbnail.
yes you would use something like this to target it...
this. HOLDER . WHAT WAS LOADED . gotoAndStop()
im using that instead of your instance names because im still
abit fuzzy on what is loaded and when.
So I do want to control the only timeline in largeWorks_mc
(just 50 frames of pics) from the other movie clip in the root
movie. See the site and see if this is any clearer.
I really appreciate your help. I'm gutting my bathroom at the
same time I'm trying to get this thing to work and it's driving me
insane.
No problems.
________________________________________________
Similar Messages
-
Controlling flash movie clips...
I made a flash animation using timelines and broke my movie up into three clips. The clips run fine in their own time line. I was reading about clip.play() clip.stop() and it seemed like I could do this. I have a main timeline with three frames. Each frame has a movie clip symbol on it. Each movie clip symbol has a timeline a few seconds long in it.
I did this because I want to put a click event that will go to a different url depending on which clip the viewer is currently seeing. This swf file will be embedded into an html document.
When I run the resulting swf - the three frames on the main timeline zip along like crazy and the movie clips don't play at all. I've tried every combination of stop() and play() I can think of but this is just not working as advertised...
My movie clips have instance names of Clip1, Clip2 and Clip3. Can someone help me with
1) some sample code that works so that I can run these clips in consecutive order;
2) the appropriate onClick code to use in the main timeline frames for my url events
Thanks much.
BCI had to put this on hold to make a deadline and never really got back to it until just now - another similar request. So here is a modification to the code provided to me that I made and seems to do exactly what I wanted. I am not an expert at script but I haven't had a problem with this so I am going with it. If this helps anyone else - great! I never got a reply from the original poster on how to fix the problem where the script they provided looped around on my final movie clip.
This is the code I used in frame one to control the loop for the three movie clips:
var myMov:MovieClip
myMov = Clip1
this.stop();
// myMov.play()
this.addEventListener (Event.ENTER_FRAME, onEnterFrame); function onEnterFrame (event:Event):void {
// is "myMov" current frame, play head, at the end of "myMov"
if (myMov.currentFrame >= myMov.totalFrames) {
// if it is then move the main timeline on 1 frame
if (this.currentFrame == 3) {
myMov = Clip1;
this.gotoAndStop (this.currentFrame-2); }
else {
this.gotoAndStop (this.currentFrame+1); } -
Main timeline/separate movie clip timeline
I am trying to understand this by using example:
I have rectangle that i want to move from one corner of the stage to another. I will create tween for it. This will last 48 sec(stage is set as 24fps)
Now when this animation is done (main time line) I would want this rectangle to stay at that corner and I would want separate animation (inside my movie clip for this object) to start changing colors but not moving at all.
What is the frame that i should start this separate animation that should be independant of main timeline?
ThanksI played with it last night and I think I got it now. I wanted to understand amnimation within animation(i think they call it nesting as well). I implemented this file as a rectangle going over image and rectangle contains some text that has its own animation.
I really appreciate your help. I think I am ok now with multiple animation but I have now another question about mask which I will ask in separate thread. Hopefully you can give me some suggestions. -
Easy movie clip / timeline question... please help.
This is a pretty simple question about something I just cant
figure out.
I have a movie with 2 frames. On the frist frame are two
buttons. On the second frame is a movie clip. In the movie clip are
two labeled frames, "ball" and "box" for two parts of an animation.
One part plays a ball bouncing. The other plays a box rotating.
What I want to happen is when you click the ball button it plays
the movie clip and starts on ball. When you click the box button it
plays the movie clip and starts on box. The code for the buttons is
simple:
boxButton.onRelease = function ()
anim_mc.gotoAndPlay("box");
ballButton.onRelease = function ()
anim_mc.gotoAndPlay("ball");
The movie works fine as long as the movie clip and the
buttons are on the same frame, frame 1.
But if I move the movie clip to frame 2 it does not work.
Why!!!??? How do I point the button to play the movie clip on frame
2?
It will work if I just send the button to gotoAndPlay("2");
obviously, but what if I want to target specific frames?I tried this like you said:
boxButton.onRelease = function ()
_root.gotoAndStop(2);
zoom_mc.gotoAndPlay("box");
Thinking it would go to frame 2, then play the movie clip
starting on frame "box" within the movie clip. But it doesnt. Of
course, it plays frame 2, and the movie clip plays, but only on
frame 1 of the movie clip, it does not go to "box" which is in the
middle of the timeline of that movie clip.
I guess there is no way to do this?
Accessing labeled frames within a movie clip from a buttion
on the main timeline requires that the button be on the same frame?
This seems strange.. I guess..... -
Controlling a Movie Clip on the Main Timeline from a loaded SWF?
Is it possible to control a MovieClip on the main timelne from another loaded clip?
I see posts that control loaded clips, but most are all from the loader in the main timeline. I have a moviclip on the main timeline that I want to make visible or invisible depending on what keyframe is playing in another loaded swf.
If I try to call the movieClip from the loaded SWF I get "error #1119. Access of possibly undefined property...." because it doesn't exist in the loaded SWF, just the main timeline.
The old AS2 way just used "_root". Since "_root" doesn't exist any more, how do you control items on the main TimeLine from a loaded SWF?I am not clear what you mean because you are saying you are trying to target a movieclip that does not exist where you are trying to target it.
Try using a trace to see what you are targeting when you you target the MovieClip(parent.parent)....
trace(MovieClip(parent.parent));
The other approach I mentioned earlier is the more OOP-correct approach if you would rather try that way. Here's a rough outline of it...
AS3 - Dispatch Event
http://forums.adobe.com/thread/470135?tstart=120
Example:
Add something to trigger the event in the child (your loaded swf):
dispatchEvent(new Event("eventTriggered")); (
if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo. In the complete event handler, add a listener for the event on the loaded swf.
// event handler triggered when external swf is loaded
function loaderCompleteHandler(event:Event) {
MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
function eventHandler(event:Event):void {
trace("event dispatched in loaded swf");
// this is where your main file can set the visible property of your movieclip -
Controlling a movie clip?
i am new to flash and i have made an animation on multiple
frames and turned it into a swf movie.
how can i make the movie start when clicked on, play through
once ,then stop and not continue to loop?
also once the movie is finished it needs to continue to show
the last frame of the movie and not go back to the first frame when
the movie stops.
it is important for me that it can be done in only one frame.
thank you
EDIT: it is in actionscript 2ok - first you need to create a new layer on the timeline of
the MC, call it 'actions' - select the first frame of that layer
and open the actions panel - type in: stop(); then goto the last
frame of the animation, right-click select the frame (ctrl click on
mac) and then 'insert keyframe' - select the frame, open the
actions panel and type in another: stop();
now then, getting it to play when clicked is a bit more
involved, you need to create a 'invisible' button over the top of
everything that you can assign code to. so, create another layer,
(you should lock all other layers) using the rectangle tool draw a
box that covers the entire stage - any color will do, without a
line though. then right-click that box, and select 'convert to
symbol' - name it play_btn (or whatever) and select the 'button'
radio button, click OK. then with the box still selected, look in
the properties panel, on the left there is a input field that says
'instance name', type the name of the symbol into that field (ie.
play_btn) Now, double click the box, to go into 'edit' mode you
will see four 'frames' with labels - right click the 'hit' frame
and 'insert keyframe' - then select the first frame ('up') and then
hit delete - this will remove the box from the other frames, and
you should now be left with a box in the 'hit' frame. this is how
to create a 'invisible button'.
now, go back to the main timeline (use the bar above the
stage to nav to 'scene 1') then select the first frame once again,
after the 'stop();' type the following 'handler' for the button:
play_btn.onPress = function() {
play();
there you go :) -
Hi all,
I have a movie that loads other movies into it, one of which
is effectively a page footer. As some of my movies are different
heights (all pages conform to one of 2 heights), I want the footer
to animate it's y position to sit at the bottom of the content.
I am currently loading the footer into _level0, the content
into _level1 and the navigation into _level100.
One of the pages (loaded into _level1) requiring the footer
to change positon has the following AS on the first frame:
_global.isTall = true; // (For pages where the footer should
be at the normal height, this is false)
trace("This "+_global.isTall);
if(_global.isTall = true and _global.wasTall == false){
_level0.gotoAndPlay("TallPage"); // (The animation for the
footer to its new position)
_level101.gotoAndPlay("out");
The button (at _level100) relating to this page has the
following AS attached:
on(release){
_global.wasTall = _global.isTall;
trace("Last "+_global.wasTall);
loadMovie("cars.swf", 1);
This works as expected once, but if I press the button twice,
while already on the page, the trace tells me that _global.wasTall
is false, when previously on the same page it traced true.
Am going about this in a completely backwards way?
TIA,
PaulHi kglad,
Code pasted below. I amusing Flash 8, but haven't done any
Flash scripting for a while.
Thanks,
Paul
Default.fla - frame 1:
loadMovie("navigation.swf", 100);
loadMovie("sub navigation.swf", 101);
loadMovie("index.swf", 1);
stop();
Default.fla - frame 2 (label "TallPage") to frame 15
animation of footer moving down with stop action on frame 15
Default.fla - frame 16 (label "ShortPage") to frame 30
animation of footer moving back up with stop action on frame
30
Index.fla (Not a tall page) - frame 1:
_global.isTall = false;
trace("This "+_global.isTall);
if(_global.wasTall == true and _global.isTall == false){
_level0.gotoAndPlay("ShortPage");
_level101.gotoAndPlay("in");
Navigation.fla - attached to cars button (cars is a larger
page)
on(rollOver) {
cursorIsOver = true;
play();
on(rollOut) {
cursorIsOver = false;
play();
on(release){
_global.wasTall = _global.isTall;
trace("Last "+_global.wasTall);
loadMovie("cars.swf", 1);
Cars.fla (a tall page) - frame 1:
_global.isTall = true;
trace("This "+_global.isTall);
if(_global.isTall = true and _global.wasTall == false){
_level0.gotoAndPlay("TallPage");
_level101.gotoAndPlay("out");
} -
Simple Button to Control Movie Clip
Hello,
I was relatively comfortable with AS 2.0, but am having a
hard time warming up to 3.0. I feel that this should be something
simple to find help online with, yet I'm finding it difficult to
get a simple answer.
I have a button that is inside a movie clip within another
movie clip:
mainMenu_mc > whoBtn_mc > whoButton
This button appears to work fine controlling a movie clip on
the same timeline. This is the code so far (on an Actions frame in
WhoBtn_mc):
whoButton.addEventListener(
MouseEvent.CLICK,
function(evt:MouseEvent):void {
whoGlow.gotoAndStop("click");
I have another movie clip on the main timeline that I would
like to control with this button:
blackFadeBottom_mc
What would the code look like for this?
Any help is appreciated - Thank you.Thanks, I was able to place the code on the main timeline and
get a trace when I clicked on the movie clip instance itself. I
probably didn't explain what I was trying to do very well, so I
apologize.
What I need to do is to control this movie clip that is
physically placed on the main timeline (fadeBlackBottom) with the
button that is buried under two other movie clips
(mainMenu_mc>whoBtn_mc>whoBtn).
I would like the whoBtn to tell the fadeBlackBottom movie
clip to (what used to be)
_root.fadeBlackBottom.gotoAndPlay("play"); This will drop down a
box that will contain the content of my 'Who' link.
How can I accomplish this?
Thanks again,
Chuck -
Detecting Rotation Amount to Control Movie Clips
I created a movie clip consisting of a bar and a knob. When you click and drag the knob, the bar rotates through 360 degrees. I want to be able to detect the degree of rotation and use that metric to control other movie clips. The code to make the drag/rotate object work is...
handle.knob.onPress = function(){
handle.onMouseMove = function(){
var angle = Math.atan2(this._parent._ymouse-this._y,this._parent._xmouse-this._x);
this._rotation = angle*180/Math.PI;
this.knob._rotation = -this._rotation;
trace(angle);
trace(angle*180/Math.PI);
handle.onMouseUp = function(){
if (this.onMouseMove) delete this.onMouseMove;
I can trace the angle in radians and degrees but I don't know how to extract either value as a variable that can be used in a function to control a separate movie clip.assign a variable to have the value of the _rotation or angle in your onMouseMove function. and use that variable's value wherever you like.
-
Movie Clips Actions Get Out Of Synch With Audio
My movie is five about minutes long with audio and an offscreen timeline move clip containing action script to control other movie clips or play the root directory. After about a minute or so, movie clips get out-of-synch with the audio, apparently its getting bogged down.
My swf file doesn't seem that big, about 2.2MB and my move clips aren't that complex, although up to three levels deep.
My version is Flash 8 Professional and my laptop was on the high end about 18 months ago.
Am I missing something or expecting too much from Flash?
Thanks,
Mike (who seems to know enough to be dangerous) -
How to stop , play nested movie clips....
Hi all,
I'm calling a swf file in a container_mc, which is in
another swf file(Interface), by loadMovie() method. The Major
problem I've stucked with is that in the interface I'm having a
Play/Pause Button, which is not stopping the nested movieclips of
the external swf file which is loaded in the container_mc
movieclip.
The other major issue is that I'm not able to add a
progressbar(sliderbar) which runs according to the animation, to
this interface. Please help ASAPI have a similiar situation however the container_mc has me
puzzled, I'm not sure what that is - perhaps you can answer my
question:
I have a master swf called index.swf. The index.swf has a
main tool bar of buttons which load frames; each frame is named to
coincide with the main bar button (i.e. genInfo, setup,
mainentance, etc). This works perfectly. My problem is with Movie
Clips.
Each frame has a sidebar which loads external swfs (i.e.
genInfo.swf) - each external swf is made up of a series of Movie
Clips which run in succession along the timeline; each Movie Clip
belongs within its own frame (i.e. MCseg1 is in frame seg1; MCseg2
is in frame seg2, etc).
I need to pause and play each individual Movie Clip at will;
I have built two buttons (pauseBtn and playBtn) into a Movie Clip
called MCpausePlay. The first frame of MCpausePlay contains the
pauseBtn; this frame is coded with the global "stop();" In order to
move to frame(2) which contains the playBtn, the pauseBtn is coded
with -
on(release) {
gotoAndPlay(2);
The playBtn is coded:
on(release) {
gotoAndPlay(1);
When clicked, the MCpausePlay moves from pause to play.
That's all I have been able to get this to do.
How do I code MCpausePlay to pause and then play each
individual Movie Clip? (How do I get a Movie Clip to control other
Movie Clips?). Should I code the Movie Clip, the frames within the
Movie Clip, or each individual button within the Movie Clip? And,
does this MCpausePlay belong on the Index.swf file, or should it be
on each external swf? Or perhaps built in to every Movie Clip? I
have tried all and have not had any success. -
Movie Clip Button - Action Script issues
This is a two part question:
1. I have my movie clip button, "mcAboutus" then inside my
movie clip I have 5 layers: actions, labels, text, animated
rollover("mcAboutusover"), animated rolloff("mcAboutusoff"). On the
labels layer I have _up, _over, _off. On the _up is the text layer,
on the _over is a movie clip of the animated
rollover("mcAboutusover") which is 90 frames, and I want to loop as
long as the mouse is over the text. And the _off has the
"mcAboutusoff" movie clip.
So I was able to have the rollover work, but when I roll off
the rollover animation continues on until the end of the animation.
I understand it has to do with the fact that it's a movie clip, but
how do I point it to go into the movie clip and read the animation
and that on the last frame of the animation I have a
"gotoAndPlay(1);" to have the animation continue looping as long as
it's in a rollover state?
here is the code I have for the _root:
this.mcAboutus.onRollOver = function() {
mcAboutus.gotoAndPlay(_over);
this.mcAboutus.onRollOut = function() {
mcAboutus.gotoAndPlay(_off);
The other problem I am having is that once the I have rolled
over the animation once, the button dies and won't let me rollover
it again?
Aside from the "stop();" action in the mcAboutus movie clip
symbol, I don't have any other actions, should I put items in the
different movie clips I have set up?
ALSO.... The reason that I have the main movie clip button,
and two movie clips residing in the mcBtn is I wanted light rays to
be glowing from the text, and I was having a hard time getting what
I wanted from Flash, so I created in After Effects and exported two
.SWF files. So those .SWF files are the _over and _off states in
the mcBtn. I am having a very hard time controlling those Movie
Clips within the main MC Button. Please, any help would be greatly
appreciated.quote:
Originally posted by:
kglad
mcAboutusover should be a movieclip that has your over
animation and it should have a stop() on its last frame. it should
be placed on your _over frame in mcAbousus' timeline. you should
then use:
Ok, so I have my main timeline, in it has my
mcAboutus>> then inside that I have three labels. _up which
has the static text then on frame 5 I have the _over which has the
keyframe for the mcAboutusover, this animation is 90 frames, then I
have on frame 10, the _off for the RollOut state, and I have a 10
frame animation on that one. I still can't get it to continue on
after the initial rollover, the button still dies down.
I am going to redo everything in a presentation timeline,
based on Total Training and see if that helps my problem out any,
and will get back to you tomorrow with more info. Thanks -
How do I use a variable to set movie clip properties?
I'm building a simple contact page that allows users to
select a city from a comboBox. I'd like to pass the selected
comboBox data through a variable that controls a movie clip with
the same name. (already on the stage)
locationListener.change = function (loc_obj:Object) {
var loc_mc = loc_obj.target.selectedItem.data;
loc_mc._visible = true;
So far this hasn't worked. I've tested hardcoding the movie
clip instance name (Atlanta._visible = true) and it works, but I
can't figure out why using the variable loc_mc won't trigger
interaction with the movie clip.
Something simple, I assume. Thanks in advance for any
help.clbeech:
I tried using your suggestion, but for some reason it doesn't
recognize it as naming the movie clip instance. I traced the
variable and confirmed that the correct value (Atlanta) is being
passed.
I assume this is because the variable is not declared as a
MovieClip, but I can't figure out how to convert it inside the
function. -
Multiple click points for one button and movie clip
I am trying to make a single button into a multiple click
point. I have a movie clip on the stage and I have an invisible
button over it. The movie clip consists of a single timeline that
has an ambient animation running and looping intially. I have three
more labeled sections of that timeline that each contain a
different animated sequence as click point animations for that
movie clip. I want the user to click on the button on the stage and
the first labeled click point animation of that movie clip will
play. I want that action to be stored so that when the user clicks
again then the second labeled click point animation will play then
they will click for the third in the same way. In between user
clicks I want the ambient animation loop in the beginning of that
movie clip timeline to play. When the user has clicked the 3rd and
last animated sequence then the whole thing will reset and be
available again. Can anyone let me know how that can be
accomplished. I originally scripted it through tell target to play
the first but I don't know how to move forward. Thanks!What version of Flash are you using? Telltarget is very
old... try something like this:
// array of the animations
myAnims = ['firstAnim','secondAnim','thirdAnim']; // these
are also frame labels
// your current animation index in the array, arrays start at
0,
// so we start at -1 which is like before anything
currAnim = -1;
// function to play the next animation
function nextAnim(){
// add one to the current animation index
currAnim++;
// if you've reached the end of the array, start back at 0
if(currAnim >= myAnims.length)currAnim = 0;
// now tell the MovieClip to play based on the value of the
current array index
myMovieClip.gotoAndPlay(myAnims[currAnim]);
Then on the button you just put:
on(release){
nextAnim();
And at the end of each animation on the timeline, put:
gotoAndPlay(1);
And at the end of the ambient loop at the beginning I guess
you have that, too, so it loops.
Hope that helps -
Buttons in Movie Clips, Movie Clips in Movie Clips
Here goes. I have a scene with a button in the timeline, that
targets a frame in a movie clip, which is essentially the content
area of the layout. this is the code used:
on (release) {
textmov.gotoAndPlay ("challenge");
This works fine and dandy. Now the problem. Within this
"Content" movie clip, i have another movie clip with a button in
it. This clip is designed to tween in then upon clicking a close
button tween out. When I test it the button doesn't have rollovers
like and I can't get it to talk to the clip above it to play the
close tween.> I am still struggling with the fact, that upon testing,
buttons in movie clips
> do not exhibit their various states. Up, Over etc. I'm
relatively sure that you
> can have buttons in Movie Clips. I've also noticed that
any graphic symbols
> within a Movie Clip produce the hand, when the mouse
cursor is Over them, just
> like a button would. All of this happens, when testing
in the FlashPlayer.
is there any place you could kindly upload the source file
for me to check ?
> Do buttons operate independently of the Movie Clip
timeline they are placed in?
that is correct, button should work independently to movie
clip.
it only react to mouse upon entering the HIT state (which is
invisible to user)
and stops reacting once the mouse is off that state.
> I have one Movie Clip with a one frame time line, should
a Button symbol work
> it it?
of course it should work...
Try to upload the source, let us check it out for you, spare
you time on guessing :)
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami>
Maybe you are looking for
-
Apple TV connecting problem?
I bought a Apple TV ( Part number: MD199X/A) and Kanex airplay mirroring for VGA V2-CAF (Part number: H9139VC/B). My TV has VGA input. I connected HDMI from Apple TV to VGA from TV. But the error message "out of range" was showed on the screen. How c
-
How to I transfer my contacts from iCloud to my new iPhone sim?
Please help with the above! Thank you
-
Want to count the number of rows of analysis item in WAD Template
HI all, Detail Description: In my WAD report, i have a Export to Excel Option. But I want when I click on this button, one pop up will come only if no of rows of the Analysis Item is Greater than 10,000 ask for Do you want to proceed or not. Means 1s
-
Workflow not started on creating confirmation
Dear Experts, We are on a classic scenario using SRM 5.0 When we create a confirmation in SRM for a PO which was created out of a SRM SC, the workflow finds the requester partner function and works as expected. However, when we try to create a confir
-
ALBPM: creating a new process instance in response of a DB update
Hi, everyone. I am quite a newbie in ALBPM, but I want to make everyone a question: Is it possible to create a new instance of a process in response to the update or insert of a new row in a DB? I guess that the magic is in the Global Automatic Activ