Determining The Frame Of A Movie Clip (question 2 Of 2)
Life will be a lot easier if there is a way to have flash detect what frame a movie clip is on. I'd like to be able to use that for a game that I'm working on. I'd like something similar to the following:
set variable "x" = (the current frame of MC "y") - 5
begin tell target "/y"
goto and stop (x)
end tell target
Does anyone have an idea as to how this can be achieved? Thanks for your help!
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-22-2001, 08:56 PM
View Complete Forum Thread with Replies
Sponsored Links:
Determining Loaded Movie Length And Current Frame
I am loading a textfx into an empty mc holder. I need a sound to play when the loaded mc plays frames 1, 60, and 120. I also need the movieclip to be stopped at the last frame when it is finished playing and tell the main timeline to continue playing.
I am currently using the loaded mc's _currentframe and _totalframes to determine it's length, and when it is finished playing to stop it on the final frame as determined by the length. [This lets me import effects created by textFX software and have them stop at the end, even though I cannot place actions directly in the generated text effects.]
Currently I check for the current frame versus total frames using a two frame loop. However this prevents me from using an if then to determine the curent frame and play a corresponding sound e.g. if _root.loadedclip._currentframe ==x play sound. For some reason the condition is never met or constantly plays a sound.
Can someone please suggest a one frame "for" or "while" loop that could get the loaded movie clips length, have it stop at the last frame number when it is done playing, and play a soundfx when the clips current frame hits certain frame numbers.
Thanks for any help as I have been playing with this for several hours and can't seem to get/find any answers on other forums.
View Replies !
View Related
[F8] Determining Movie Clip Frames
Is there a way to determine what frame a movie clip is on? Lets say I have movieClip1_mc on the main timeline spanning across many frames and on frame 12, I have both movieClip1_mc and movieClip2_mc. I would like both of these movie clips to play in sync. Meaning if when I navigate to frame 12 and movieClip1_mc is playing frame 20 then I want movieClip2_mc to start playing on frame 20 as well.
Does anyone know if this is possible? If so could you point me in the right direction?
View Replies !
View Related
Making A Movie Clip In A Movie Clip Go To The Next Frame Of The Original Movie Clip
I have a movie clip (for simplicity I'll call it movie_a) in movie_a I have another movie clip movie_b.
in movie_a i have a button that when pressed makes movie_b play (it has a stop frame every once in a while so the button acts as a "next" button)
I want it so that when i get to the last frame of movie_b and press the button, it will go to the next frame of movie_a
I hope that doesn't confuse u and u can help me solve this problem, as i am stumped and I've tried everything I could think of (which isn't that much as I'm not too good with actionscript)
thnx
View Replies !
View Related
Determining Frame With Script
OK, here is a real newbie question for ya...
Within an action script, I want to tell the swf to go to the frame + 50... thats it.
I have tried:
Go to and Play (frame + 50)
Course, that didnt work... Oh and i cant use frame labels at this point... any help is GREATLY appreciated..take care
chris johnson
xehod@hotmail.com
View Replies !
View Related
Determining Frame Number Of MC From A Different MC?
Graphic designer will little scripting background seeks help!
here is the product:
http://maskar.com/testing/sourceflash/
Upper frame is Flash navigation, lower frame is HTML.
built in F5, using a bunch of movie clips & tell targets. Once scene, only one frame in main scene..plenty of layers with separate symbols)
I need a reliable way to determine on any button click, if any of the three *navigation movies* are in the *up* state. If they are, i want them to go to the frame where they turn down.
I currently have a button behind the movie clip that tells the movie to scroll down when you roll off of it. the problem with that is if you move off the movie too fast, it does not work.
I know what i want the code to do, i do not know how to actually code it.
i imagine that it would look something like this:
---
on release, if 'about' is on frame label 'up' go to and play frame label 'down'.
(repeated for each of the movies)
---
I don;t know if i should place this script on the main scene as a function, and call it from each butrton (makes sense to me to do that, but how would i code it)
If i need to make my .FLA available, please let me know.
TIA,
Jac
[Edited by darth maulata on 03-14-2002 at 12:58 PM]
View Replies !
View Related
How To Address A Button On The 5th Frame Of A Movie Clip With Action Script Located On The First Frame Of The Main Time
I'm trying to make a button appear on frame 10 of a movie clip and write actionscript on the main time line that addresses that frame 10 button. I'm not sure of the method I need to do to get that frame 10 button to get a url. I tested the same button when put on frame 1 and it worked, but I'm not sure how to address buttons and other symbols that appear as a result of the playhead moving to different places on movie clip time lines.
Can anyone help, or give me a link?
Thanks
Dennis
Attach Code
//works
_root.buttons_mc.go_btn.onRelease = function(){
_root.mall_mc.gotoAndPlay(1);
//a stop action is placed on frame 10 of the mall_mc movie clip
};
//this button is inside the mall_mc movie clip on frame 10
//doesn't work
_root.mall_mc.url_btn.onRelease = function(){
getURL("http://yahoo.com");
};
//An instance of the same url_btn is dragged on to frame 1 of the mall_mc
//movie clip and given an instance name url_frame1_btn
//works
_root.mall_mc.url_frame1_btn.onRelease = function(){
getURL("http://yahoo.com");
};
View Replies !
View Related
Cant Get Frame In Main Timeline To Play Frame In Movie Clip
Hi all,
Ok, I want a section of a movieclip to play up until a certain frame on the main, or _root timeline. Then I want a different section of the same movie clip to play. Now I have the movie clip all set up all fine and dandy, yet I cant get it to the frames or 'section' it is playing when it reaches the apropriate frame. I have the following code on the _root timeline frame.
Code:
gotoAndPlay("stop");
(I have a frame label "stop" where it should be) Is this the right code I should be using? It has worked in the past, but it has been in between an on (something) event/action (not quite sure of the correct termanology there)
Please help.
View Replies !
View Related
Flash Button To Take Movie Clip To The Next Frame Label Instead Of The Next Frame
I am trying to figure out how to create a button to take a movie clip to the next Frame Label instead of just to the next Frame. I have a slide show that I am working on with a fade effect from picture to picture. When I just use the nextFrame script it will literally take you from frame to frame on the fade in. Is there a script that will allow you to go to the next (or previous) Frame Label from where the movie was stopped?
Any help is greatly appreciated!
View Replies !
View Related
Can't Target A Frame Label Or Frame Number Within Movie Clip
Hi guys,
Can't for the life of me figure out why this is not working:
if (_currentframe==82) {
homefade_mc.gotoAndPlay("fadeup");
design_mc.gotoAndPlay("design_fade"); - this one is fine
}
- the first gotoAndPlay should be going to the homefade mc and then going to the "fadeup" frame label and play from that, but instead it does nothing. Any clues?
Chris
View Replies !
View Related
Determining The Current Frame/time Of Video
I'm using AS2 and would like to create a function to monitor the current
time of an FLV file in a swf. I'm using the swf in Director and using the
format sprite (1).flvCode.flvPlay () where sprite (1) is the location of the
swf, my AS2 code is in a movieClip with an instance name of flvCode and I
have a function (just or illustration purposes) of flvPlay ()
I'v looked in the AS2 reference but it's strangely absent of code that would
provide the current flv time or even the duration of the flv.
Craig
View Replies !
View Related
Link From One Movie Clip To Specific Frame Within Another Movie Clip
Hello,
I've been working on this problem on and off for weeks now, and am hoping I could get some assistance, as it is driving me batty and my deadline is quickly approaching. Here is the basic setup:
I am creating a Flash webpage. I created a Flash movie with 6 frames, with a movie clip on each frame, each movie clip being a single page of the website. What I would like to do is have button within one movie clip (say a button in the movie "contact" which is frame 5 of the main movie) link to a frame within another movie clip (say frame 3 called "project3" within the movieclip "portfolio" which is frame 2 of the main movie).
With all my efforts, I am only able to get the button to go to and play the called movie clip at frame 1, and no other frame number or label.
I have tried codes such as the following:
on (release){
this._parent.portfolio.gotoAndStop("project3");
}
on (release){
_root.portfolio.gotoAndStop("project3");
}
... and countless other options, but nothing seems to work. I would greatly appreciate any assistance with this matter. For the record, I admittedly do not know much Flash and am learning most of this on my own with a small base knowledge from a design class I took years ago using UltraDelv! Please let me know if I need to go into further detail.
Cheers!
View Replies !
View Related
Target Empty Movie Clip And Movie Clip Frame
I'm loading a random movie, reading in Shared Object data.
If the Loaded movie has been viewed playing it's 2nd frame.
How can I load the movie into an empty movie clip and target its 2nd frame?
Is it just a syntax issue?
Code:
filename = ["flashMovieA.swf", "flashMovieB.swf"];
path = "flash/";
i = filename.length;
k = Math.floor(Math.random()*i);
// get object if none just play
mindSO = SharedObject.getLocal("mindControl");
// Scan the mindSO for values
for (a in mindSO.data) {
trace(a+": "+mindSO.data[a]);
// if previously viewed play second frame
if (mindSO.data.movieName == filename[k]) {
// here is my targeting issue
loadMovie(path+filename[k], movieHolder_mc);
movieHolder_mc.movieName.gotoAndPlay(2);
} else {
// play whole movie
loadMovie(path+filename[k], movieHolder_mc);
setSOData();
}
}
View Replies !
View Related
[F8]Playing A Movie Clip From A Certain Frame To A Certain Frame With A Button
Hey guys,
im slamming my head in trying to figure this out.
I have an invisible button and only one mc, the mc loops 3x then stops, this is defined with as in mc.
Now i want to play the movie from the invisible button but only loop it once.
Which means i would like to play it from frame 1 to frame 215.
And also when u rollout i would like the movie to stop and go to frame 1.
this is my button code so far
Code:
on (rollOver) {
tellTarget ("loader")
{
gotoAndPlay (1);}}
on(rollOut){
tellTarget ("loader") {
gotoAndStop(1);}}
on (release)
{
getURL(clickTAG, "_blank");
}
Help please
View Replies !
View Related
How To Determining The Name Of Parent Clip?
I've got a number of dynamically generated movie clips that then load external SWF files. I'd like to be able to figure out the name of the containing movieclip instance from inside the loaded SWF but am not sure how to go about doing that.
Any help is greatly appreciated.
View Replies !
View Related
Determining Width Of Loaded Clip
Hi all,
Is there a way I can get and set the width and height of a loaded movie clip? I have created an empty movie, and then loaded a small swf file into the empty movie with loadClip. I now want to determine the width and height of this loaded clip, and scale it to the size of my movie dimensions. Can this be done? Although the movie loads fine, and I can position its x and y coordinates, the width and height show as zero.
Can anyone help me with this one? I'm using Flash Professional 8.
Thanks,
brayne
Edited: 04/19/2007 at 09:31:58 PM by brrayne
View Replies !
View Related
Control A Movie Clip Frame By Frame
Ok I know this is simple but I'm a simple person. I have two buttons - one forward, one back. I need to know how to control a movie clip frame by frame and not just play through. If there is a tutorial on how to do this please point me toward it. I want to learn how to do this myself and not just copy code if I could.
Carter
View Replies !
View Related
Determining The _x And _y Position For A Dragged And Dropped Clip
I'm trying to determine the _x and _y positions for several Dragged and Dropped movieClips so that i can recreate a new movieClip with what the user has just "Created" by dragging and dropping and then print it.
Does anyone know where a tutorial(i checked here, but couldn't find one) may be for flash to make a new movieClip on the fly based on the users' interactions with it?
an example of where this is used is here:
http://pbskids.org/arthur/games/alien/alien.html
where the user is able to make an alien, and then print it.
Thanks!
View Replies !
View Related
How Do I Link To Specified Frame In One Movie Clip From Another Movie Clip?
Hello,
I've been working on this problem on and off for weeks now, and am hoping I could get some assistance, as it is driving me batty and my deadline is quickly approaching. Here is the basic setup:
I am creating a Flash webpage. I created a Flash movie with 6 frames, with a movie clip on each frame, each movie clip being a single page of the website. What I would like to do is have button within one movie clip (say a button in the movie "contact" which is frame 5 of the main movie) link to a frame within another movie clip (say frame 3 called "project3" within the movieclip "portfolio" which is frame 2 of the main movie).
With all my efforts, I am only able to get the button to go to and play the called movie clip at frame 1, and no other frame number or label.
I have tried codes such as the following:
on (release){
this._parent.portfolio.gotoAndStop("project3");
}
on (release){
_root.portfolio.gotoAndStop("project3");
}
... and countless other options, but nothing seems to work. I would greatly appreciate any assistance with this matter. For the record, I admittedly do not know much Flash and am learning most of this on my own with a small base knowledge from a design class I took years ago using UltraDelv! Please let me know if I need to go into further detail.
Cheers!
View Replies !
View Related
Specify Frame For A Movie Clip Inside A Movie Clip
I'm working with a site completely out of flash and I'm having trouble with a button.
Just as some background, the site is layed out with the main stage, and on that stage is a movie clip with an instance name of 'pages'. Inside the pages movie clip is a timeline with all the different pages of my site with labels identifying each one, such as p1, p2, p3 etc. On the timeline in the p2 section I have another movie clip with an instance name of 'extrasbody' which is a 7 frame clip with each frame labeled and I'm using a second menu to control going to each frame.
My problem is that I need a button on the front stage to go to the correct page (p2) as well as load up the correct frame in 'extrasbody' which in this case is labeled 'terms'. It always just loads up the first frame and I have to use the second menu to get to the correct frame.
This is what I've tried.
PHP Code:
on (release) {
_root.pages.gotoAndPlay("p2");
_root.pages.extrasbody.gotoAndStop("terms");
}
I think it doesn't work because when that is called 'extrasbody' isn't loaded up yet so it just skips it.
What is the best way to tackle this? Maybe I need to setup a variable that is either set to 'off' or 'on' and the button turns it 'on'. Then on the 'extrasbody' page I have an if statement saying if that variable is 'on' then extrasbody go to 'terms' otherwise goto frame 1. Logically in my head that makes sense but I don't know how to code that.
Any help would be greatly appreciated. You can view a live form of the flash page here: http://www.foxreality.com/theacademy/
Click on the button for Academy Dictionary. It will take you to the 'extrasbody' page but to get to the dictionary you have to click on the 'academy dictionary' button on the right hand side.
View Replies !
View Related
Using A Movie Clip Inside A Movie Clip To Start A Frame Of An MC Inside A Movie Clip
Situation:
I have a movie clip inside a movie clip with a button inside of it.
This button on release goes to a different movie clip(svideo) in a different frame on the maintime. This movie clip has a movie clip(portfolio) inside of it.
Okay: I use an absolute path on the aforementioned button
on release
_root.svideo.portfolio.gotoAndPlay(60);
But, for some reason Flash won't go to frame 60 of the portfolio movie clip that is inside of the svideo.
I have tried numerous variations on reaching frame 60 of portfolio. Like going to the maintime line and going to the portfolio MC. Also, portfolio and svideo are the instance names and not the name of the actual movie clip.
If anybody could help, I would appreciate it. Thanks.
View Replies !
View Related
Movie Clip From Frame To Frame
hi!
I am trying to get my website to go faster and more fluid...a web master told me : instead of doing new pages for each button, i should make every page as a movie clip from frame to frame and label them..??? I've been looking for how to do this for about 3 days..Do u have an idea of what he's talking about??
Thanks for your help and sorry for my english.
the frog.
View Replies !
View Related
Set Movie Clip To Frame 1 When Cursor Leaves Movie
Each button in my navigation is as such:
I created a movie clip, the first frame of the movie clip contains my button and a stop(); command.
The button script (follow the cursor coords):
on (rollOver) {
play();
_root.go = 424;
_root.sub = 7;
}
when the button has been rolled over, it stops at frame 13 (to expose the drop-down navigation). Surrounding the button and sub nav I have an invisible button with this script:
on (rollOver) {
gotoAndPlay(14);
}
and then on the last frame of the movie, my frame script is:
gotoAndStop(1);
It works fine if the cursor exits the button on the left, right, or bottom, but it does not work if the cursor exits the button from the top. The reason this is happening is because the top of each button is at the absolute top of the frame.
Is there a way I can have my movie clip return to frame 1 when the cursor exits the button without using an invisible button? Or a way to call frame 1 when the cursor exits the movie?
Thanks,
Dan
View Replies !
View Related
How To Tell Movie Clip To Go To Another Movie Clips 62th Frame?
i have main movie clip named "remote".
and inside that there is another which holds the menu named "menu"
and inside the menu i have "symbol 8" which calls and external swf and also has to call the "remote"s 62 th frame.
no symbol 8 has thic action on it
on (release) {
_root.contents.loadMovie("stilllife.swf");//external swf
gotoAndplay(62) //here i must identify the movie clip "remote" i think
}
can you help mee?
View Replies !
View Related
Going To A Certain Frame In A Movie Clip?
Hi, I am trying to code a button to tell a movie clip to open at a certain labeled frame within the movie clip itself.. I am trying to create a calendar that has the 12 months as buttons on the left and when you click on a month it opens the days(movieclip) to the right. There is one movie clip that conains the 12 months' days on different labeled keyframes. I would simply like to script the button to open the movie clip and goto the correct key frame for that months' days. Thanks in advance
Bdunk
View Replies !
View Related
Tell Movie Clip To Go To Different Swf And Frame
Hello!
I am attempting to do a base swf, and the bottom half will load the different swfs to showcase a collection in level 1 or so on. The top part in the base swf is a menu pointing to different swifs. However, I have a question, I am wondering if I can put a button on the base(level 0, and have it tell to go to a certain frame in the in level 1(external swf)???
What I want to do is the "description" button is on a menu bar on the base. When I load a collection(a swf) into a movie clip, I want the description to go to a certain frame in the collection swf. Is it possible to do that? I know abt the _root.gotoandplay(for the main timeline), but is there a way to for the base movie to tell the button(on the base movie) to go to a different timeline(in the collection swf)??
Please help! I am using Flash 5.
SKy
View Replies !
View Related
Last Frame Of Movie Clip
Please some help:
I need to get to the last fram of my movie clip so that it doesn't replay...
Can anyone help?
I have coded this in my main timeline of my movie because if the user has already visited once, I don't want my Movie Clips to replay from the beginning...make sense?...The code for detecting the cookie works fine so that isn't the issue
************************************************** ***********
stop();
// create the local Shared Object
myLocalSO = SharedObject.getLocal("flashcookie" );
// Populate the text field if the SO already contains a name
if (myLocalSO.data.counter != 0) {
numVisits.text = "already visited";
gotoAndStop("lastly");
INTRO.gotoAndStop("lastly"); //<----NOT WORKING
} else {
numVisits.text = myLocalSO.data.counter;
myLocalSO.data.counter = 1;
}
myLocalSO.data.counter++;
************************************************** ***********
The last frame (lastly)in INTRO Movie Clip doesn't have any transitions just stationary photos, etc...why does the MC still run through the whole MC?
Thanks in Advance!!
Andrea
andrea@studioxmedia.com
View Replies !
View Related
[F8] From Movie Clip To Frame
I'm currently working in Flash 8 (ActionScript 2.0)
The problem I'm having is as follows:
I'm working on coding a game, in which I have a "cut scene" running. It's simply a movie clip set up with a boolean as follows:
code:
cutScene._visible = false;
I have a function that uses a hit-test to determine if it is or is not visible.
code:
if(player.hitTest(map.door1){
cutScene._visible = true;
}//end if
Now, here comes the problem... I am wanting to, at the end of the cutScene movie clip, have a way so that (when the movie clip is clicked) it disappears AND set the cutScene._visible back to false.
I hope that specifies the problem enough...
Thank you
View Replies !
View Related
[CS3] Movie Clip In One Frame
I made a 50 frames movie clip in flash.
I want to put that mc just in one frame and once it finishs playing mc and it will go to frame 2. I don't want to put those extra 49 frames just for it to play.
Does anyone know how to do that?
Thank you so much
View Replies !
View Related
Movie Clip In One Frame - HELP
I made a 50 frames movie clip in flash.
I want to put that mc just in one frame and once it finishs playing mc and it will go to frame 2. I don't want to put those extra 49 frames just for it to play.
Does anyone know how to do that?
Thank you so much
View Replies !
View Related
Movie Clip With 1 Frame?
Hi i wanne make a movie clip with just 1 frame that updates its information by use of action script.
Now when i use 2 frames it will call the action script and loop this. So that the information is updated making my movie WORK. But i want it to use 1 frame since frame nr 2 contains nothing but a copy of frame 1. If i remove frame 2 it wont loop anymore. Is their a way around this?
View Replies !
View Related
Go To Movie Clip Frame?
Quick question... I feel stupid but can't for the life of me get this to work (and I've searched and searched...)
I need to have a movie clip go to a certain frame upon getting to a certain frame in the main timeline. How do I do this?
Thanks!
View Replies !
View Related
If This Movie Clip...go To This Frame
Is there a way, using actionscript to tell a button to gotoandplay 1 of 2 different frames within a movie clip, depending on the conditions of an if statement?
For example, on a site I am doing, when a user clicks on the "photos" button, the background drops out, and the pictures load. If they click on "about" after looking at pictures, the background stays gone. I want the background to load back in if a user clicks on any of the nav buttons, after clicking on "photos", but only if they have clicked on photos first. If they go from "contact" to "about" the background stays in tact, so there is no reason for it to re-load.
Does this make sense??
View Replies !
View Related
Go To Movie Clip Frame?
Quick question... I feel stupid but can't for the life of me get this to work (and I've searched and searched...)
I need to have a movie clip go to a certain frame upon getting to a certain frame in the main timeline. How do I do this?
Thanks!
View Replies !
View Related
Getting Outside Of A Movie Clip To Go To A Different Frame?
Please Help Me out!!
I have a movie clip with an animation and at the end it has a button that i want to be able to click and get out of the movie clip a go to another frame(beginning of my site) for action script 3 what is the code
Here's the setup:
Movie clip with animation
animation plays and at the end a button shows up
i want to be able to click the button that says "enter my site" and go to the opening of my site which the frame right after the movie clip animation
basically the "enter my site" button leaves the movie clip animation and continues to the frame directly after that which goes to the rest of the site
I WANT TO BE ABLE TO GET OUTSIDE THE MOVIE CLIP IS IT POSSIBLE?
THANKS FOR THE HELP
View Replies !
View Related
Can I Make The Last Frame Of My Movie Clip Say "parent Next Frame"?
I am just learning flash so maybe I'm real stupid but I'm doing a slide show where each slide comes onto the stage in a different way so every pick has it's own animated mask layer in a movie clip which sits on the stage in a single frame on scene 1.
I want the last frame of the movie clip to say something like _parent, gotoandplay (scene 2);
I am using a load of tutorials but can't find any reference to this and thought it would be a pretty simple hack of some code I already used...
Any ideas?
View Replies !
View Related
|