Playing Only Next 5 Frames Without A Stop Action
Hello
Anyone ever tried getting a button to tell a MC to play the next 5 frames and stop? is that possible? I can't put a stop action in the movie clip because of how have this game/site set up.
any help or direction would be appreciated
cheers,
nigel
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-13-2002, 06:55 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Audio Playing After Stop Action
I have a stop action on a different layer, and have streaming audio which I would like to run throughout my movie, although when the stop action(which I have to have, because Im doing a presentation and I have different points of navigation which I need to stop at), but I want the audio to play in the background streaming?
How could I go about accomplishing this?
[MX04] [MX04] Action Script To Stop A Movieclip Playing
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!!
Looping First 38 Frames 7 Times, Then Playing The Whole 76 Frames And Stopping
Hi Guys, I have a movieclip that the first half has one set of movements, but the second half changes. I want to be able to loop this movieclip (instance on the root), so that it plays the first 38 frames 7 times...i.e., loops 7 times, and the 8th time, it plays the whole clip, then stips...the movie is 76 frames long.
I know it's going to be...make i=1 first time...add 1 to i each time...and if i=7, then play past frame 38...and put a stop(); at the end of the movie, but i don't know how that code would look, if I could please ask for more...basic (ugh...) help...
In other words, how do I write this (pseudocode) in AS:
i=1
play frames 1-38
i=i+1
if i is less than 8, play frames 1-38
if i is more than 7, play the whole movieclip, all 76 frames
Shawn
Strange Bug....won't Stop At Stop Action
My movie isn't stopping when there is a stop action. I don't know if its a bug in my site or if its a bug with flash MX. Here is the file home.fla. The error occurs when you click on one of the buttons under the Profile heading. If you look at the Profile Scene you'll see I have stop actions placed at the end of each labeled section. For some reason the philosophy section keeps repeating itself and won't stop even though there is a stop action. Can some please take a look and let me know what I can to fix this. Thanks!!
Playing Certain Frames
I have been trying in flash to play a certain amount of frames then for it to change scenes when i push a button. For example, if i were to click on a button it would play frames 240-250 and at frame 250 the movie would start playing scene 2
Ive tried everything i knew, but that doesnt seem to be enough ^_^. I would appreciate any help that you have.
Thanks
Playing Frames
Kind of carrys over from my last problem
I have multiple frames now with code in each of them
Ive done gotoAndPlay() to send the current frame to a new one, but it wont play untill ive right clicked and selected play, what could be the problem?
Playing A Few Frames Of An SWF
Hi, I have a problem that I suspect is easy to solve but I've had no success so far.
I have an SWF (created from an MPEG in Squeeze) that is divided into short bursts of static.
I have a number of buttons which when pressed should play an individual burst from the SWF (which is subsequently removed/hidden) before a new external movie is loaded.
For example button 1 plays frames 1 - 13 of the static SWF and then loads movieclip1.swf
button 2 plays frames 14 - 26 and then loads movieclip2.swf
etc etc...
Can anybody give me some pointers?
Thanks, in advance.
Playing Certain Frames
any ideas how to get a movieclip to only play specified frames, for example. i have a mc on the stage with 100 frames. I only want it to play 30-50. ???
Playing Frames Inside A MC
I want to make an action to a frame that when i press SPACE a MC changes from frame 1 to frame 5 for example.
in frame on of the scene comes the movieclip. I edit the mc so that there are 5 frames each one is different. I put stop () in each of the mc´s frames.
Now to the frame where the mc is located in i put the actionscript:
if (Key.isDown(Key.SPACE)){
//here comes the code that makes the mc go to frame 5 inside the mc. get it?
}
help!
Playing Random Frames
Argh. I used to have the string of code which plays random frames of a movie clip, but I lost it. And I can't remember what it was.
Help please...
Do any of you know this action script code offhand?
Playing Frames In Reverse
Hi all
Does anyone know how to add an action script to a button that plays a sequence of frames in reverse? At the moment I have one button that scrolls an image one way and I want to be able to have another button that reverses it the other way.
Probably something v. simple but am a bit of a Flash beginner!
Many Thanks
Mike
Frames Not Playing Righ
I posted this about 5 days ago, Gemein told me that the problem might be with the "release" include in my mouse event, but that didn't solve the problem. Please read on and post a reply if you know how to fix this. Thank you.
I'm not really good at describing my problems, but here goes.
I made a button roll over effects. The script for my goes like this:
on (release, rollOver) {
francais = "true";
gotoAndPlay (2);
}
on (release, rollOut) {
francais = "false";
gotoAndStop (1);
}
the action ends on frame 15 which has the following script:
if (francais = true) {
gotoAndPlay (2);
}
and I have another button with the following script:
on (release, rollOver) {
programs = "true";
gotoAndPlay (16);
}
on (release, rollOut) {
francais = "false";
gotoAndStop (1);
}
and on frame 30:
if (programs = true) {
gotoAndPlay (16);
}
The problem is, my "programs" button will play the effects correctly, but my "francais" button will play up to frame 5 instead of up to frame 15 and then back to 2.
Thanks for your time and efforts.
Really Need Your Help Playing A MC Or Frames Before Starting Another MC,
Except from the original button that instigated the process in the first place. So the 'intro' part cannot trigger the new MC, this has to be done from the original button, but how do you do this with Actionscript?
Picture this:
some thumbnails/buttons and a photo framework in which when clicking the thumb, the bigger image should appear.
still there?
ok.
I want the images to slide into the framework... but before a new image replaces the old one, I want the old one to slide away (basically just a square with the bgcolor sliding back over --- i'll refer to this as the slide-out), but this has to happen whenever you choose a new image....
so:
I click, image slides in and centers
I click thumb2, on top of current image a bgcolored square + line 'cover' the image till only the bg is again visable.
Image2 slides in.
and so on.
What would you advice me and how?
- either make a 'slide out' in a independent MC which can be positioned on top of the current image (and if possible, how do you position like layers in actionscript?)
- or create a slideout in the same MC as the slide-in + the actual image... the movieclip should be then something like this: slide in tween > the image > the slide out tween.
But how do you do that with actionscript, so basically after the image there is a stop action, but onclick of some other button, first the frames of the slide-out are being played, before Flash starts loading the next image MC.
And obviously it has to work that people can choose the image at random, so no fixed order
Is this easy or what
Thanks again!
Playing Frames Backward
I have an annimation with two buttons one goes to the next approaite frame the other goes backward.
For the forward buttons I am just using the GotoAndPlay fuction, but how do I make the back button play the frames backward?
Any help would be grand!
Cheers
Jemes
Playing Ramdom Frames Within One MC
Hi all, here is my problem.
I have a movie clip ('characters') with 5 frames. Each frame is a movieclip containing a certain animation.
When the 'characters' movie clip is loaded I want it to goto and play one of the first four frames at random. When that nested movie has finished playing I would like the 'characters' movie to then choose another of the first four frames at random. This process needs to go on forever.
However when a button is pressed (it sits within the character movie clip)I want this cycle to be broken and for the 'characters' movie clip to goto frame5. This is an information frame with an exit button on it. When the exit button is pressed I need the 'characters' movie clip to resume its random cycle......
All help is greatfully recieved as this problem has really got the better of me. I'm using Flash5.
Not Playing Clip At Certain Frames
ok, in the linked .fla, the "links layer" is supposed to bring out the menu in an appear/move motion. cept it's not working =-P any suggestions? also linking what it's supposed to do, this didn't happen till I added more frames for different menus in same clip, not sure if that's what the problem is or not tho...
Playing An MP3 Independent Of Frames
I am modifying the basic slideshow that came with MX. I would like to have an MP3 play along with the slideshow. However, if I attach it to the first keyframe everything is fine until the slideshow arrives back at the first frame at which point a second copy of the MP3 begins playing over itself. This also happens if I hit the back key and traverse the first keyframe. I tried adding a separate scene independent of the slideshow keyframes but that didn't work.
How do I load an MP3 to play independent of the current frame? Is there an "onload" function in Flash?
Thank you,
Seth
Playing A Range Of Frames
Hi
I am building a bar chart graph.
All is going well, I have built the graph - all the axis and bars are in place and all variables load in from my ASP page.
Each bar is a separate movie clip containing 100 frames, each frame representing 1% of the graph results. I have 5 bars and when the scene loads I want each bar to move to the frame corresponding to the value pulled in from the ASP file.
So if the ASP file values are 10 and 90 the first two bars will move to frame 10 and frame 90 respectively. I want the bars to move up the screen animated as in the motion tween, not just jump to that frame
The difficulty I am having is getting each bar to play until it reaches a specific frame, not gotoAndStop().
So if the value for the first bar is 50, I want the move clip called bar_1 to play until frame 50 and then stop.
As I said earlier I can load the variables fine, just need help making a movie clip play a specific amount of frames and then stop
At the present I have this for the actions on each bar, but using the gotoAndStop it will jump straight to the frame given, not play each frame upto a number and then stop:
onClipEvent(load)
{
loadVariables("poll.asp",this);
}
onClipEvent(data)
{
/* votes1 is the value from the asp */
var v1 = Number(votes1);
this.gotoAndStop(v1);
}
Thanks
Dean
Playing Frames In Reverse
Hi everyone,
I'm not sure how to attack the problem I'm having (I've considered a baseball bat...) so I was wondering if someone could help me out.
Here's the deal: I have a series of buttons, and above them is a navigation bar. As I hover over a button, I want a second bar to slide out from behind this top bar, with the mouseover text on it. When the user stops hovering over a button, that bar slides back from where it came. This happens with each button, with a different word on the bar depending on which button they're hovering over. I can do all of this, except I want the bar to slide back to its starting point from where it is as the time.
To clarify, I can make the bars slide out, but what happens if someone stops hovering before the bar slides out fully? I want it to retract from the position it's at, at THAT TIME. I have no idea how to achieve this and I'm assuming it involves ActionScript but I'm really a complete novice when it comes to any kind of programming.
I found this very hard to explain lol. But any help or questions for clarification would be appreciated greatly. Thanks.
Playing Frames Out Of Sequence
how would i go about creating a script to play frames that are not one after another..and not in any ordered sequence?
thanks,
deerfield
Playing Frames In Reverse.
Ave,
I'm trying to find a simple solution to this problem.
I have a Mask Layer and a couple of layers beneath it. Within a span of 600 frames, the animation is simple. Photos transition in and out of each other.
As it is a continous animation, all i want to do is that when the header reaches the last frame, it plays back in reverse. When it reaches back the first frame, i can always put "gotoAndPlay(2);" and thus forming a loop.
I "can" of course Copy all 600 frames, Paste them, do "Reverse Frames" and have a 1200 Frame animation. But i'm sure there is an ActionScript way to do this.
Any suggestions?
Thanks.
Playing Random Frames
I'm trying to make make my quiz game play ramdom frames and not play the same frame twice.
I found this on another forum but Im not sure how I can use it the way im doing things
this is written on the first frame,
-----------------------------------------------
Code:
[as:1:e3373511da]mc.onRelease = function()
{
this._parent.random_frame();
}
var frames = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ]
function random_frame()
{
var c = frames.splice(random(frames.length), 1)
mc.gotoAndStop(c)
trace(frames.length)
}
[/as:1:e3373511da]
My que to send the playhead to the next frame is at the end of an animation on the timeline.
Would I just use write the array and splice var then call it at the end of my animation? like
-------------------------------------------------
on frame one
-------------------------------------------------
Code:
var frames = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ];
function random_frame();
var c = frames.splice(random(frames.length), 1);
-------------------------------------------------
on my animation timeline que
-------------------------------------------------
Code:
_root.gotoAndPlay(c);
-------------------------------------------------
am I on the right track?
any help would be much appreciated.
Mark
Playing Back Two Frames?
Hello Everyone,
I'm currently using
stop();
_root.prevFrame();
to go back one frame. I've run into a situation where I want to go back two or maybe three frames. How would I script this?
Thank you,
Liz
Reverse Playing Frames
Hi-
I have a small flash movie that i actually need to play backwards instead of from frame 1 - 240 - it needs to play from frame 240 to 1 and stop.
this code is working, except it keeps looping and i can't figure out how to stop it after it plays from 240 to 1 once.:
forward = true;
onEnterFrame = function () {
if (forward == true) {
nextFrame();
} else {
prevFrame();
}
if (_currentframe == _totalframes) {
stop();
forward = false;
}
if (_currentframe = 1) {
forward = false;
}
};
gotoAndPlay(240);
Thanks in advance. It's a bizarre problem but this will save me alot of time if i can get it doing this.
Shawna
Playing Frames In Reverse.
I have been trying to figure out how to play a series of frames in reverse. Originally I had a movie clip, that was unwieldy at best so I broke it into frames. I'm still learning, so watch there be some ridiculously easy function like "playinreverse" or the like. Here is the code I have thus-far. The italic text is the function I'm working with, but I included the rest... just in case.
As it stands now I can click the button (only Podcast is coded at the moment) and it will reverse exactly 1 frame. Once I do this 29 times it gets back to the first frame and plays like it is supposed too. I'M SO CLOSE! grr.
Am I missing somethings simple.
gotoAndPlay("Main");
stop();
function playmain (event:MouseEvent):void
{
gotoAndPlay("Main");
}
function playpodcast (event:MouseEvent):void
{
var i = currentFrame;
var j = Math[currentFrame - 29];
if (i != j)
{
prevFrame();
}
else
{
gotoAndPlay("Podcast");
}
}
function playportfolio (event:MouseEvent):void
{
gotoAndPlay("Portfolio");
}
function playresume (event:MouseEvent):void
{
gotoAndPlay("Resume");
}
function playcontact (event:MouseEvent):void
{
gotoAndPlay("Contact");
}
Main_btn.addEventListener(MouseEvent.CLICK, playmain);
Podcast_btn.addEventListener(MouseEvent.CLICK, playpodcast);
Portfolio_btn.addEventListener(MouseEvent.CLICK, playportfolio);
Resume_btn.addEventListener(MouseEvent.CLICK, playresume);
Contact_btn.addEventListener(MouseEvent.CLICK, playcontact);
Playing Frames In Reverse
Hi=
i need this flash piece to playin reverse.
So it needs to start on frme 240 and play backwards 10 one. (reverse frames won't work in this instance)
Tis code is working, but it keeps looping. Can't get things to stop when it gets to frame 1.
help!
Shawna
Code:
gotoAndPlay(240);
forward = true;
onEnterFrame = function () {
forward ? nextFrame() : prevFrame();
if (_currentframe == _totalframes) {
stop();
forward = false;
}
if (_currentframe == 1) {
forward = false;
}
};
Playing Random Frames
I have a password field and a enter button. There are certain passwords that are specified in order to get to the secure area. I want the user to be able to click a get password button and one of the passwords is randomly displayed in a popup window. That is where the problem is. How do I randomly select frames in a moviclip by clicking a button?
Frames Not Playing Correctly
Hi!
I'm experiencing a strange phenomenon with my movie. Here's the scenario:
The main timeline has 3 frames. Each frame has a register button, a contact button and a home button.
Frame 1 contains a movieclip that initially runs and is triggered on release of the home button.
Frame 2 contains a movie clip that is triggered on release of the contact button.
Frame 3 contains a movie that is triggered on release of the register button.
I have stop(); statements at the end of the movieclips on frame 2 and 3. The movie clip on frame 1 loops.
Each button runs the correct movie clip when pressed the first time but when pressed a second time each button runs the next movie clip in "line".
eg. If I click contact it goes to contact movie clip and plays it and stops. From within contact_mc , if I click the contact button, MOVIE CLIP 1 on the main timeline plays!!!
I have specified _root.gotoAndPlay for each button event, so shouldn't it always play the corresponding frame on the main timeline?
I don't know if this is clearly explained, but I sure would appreciate some feedback.
Thanks!
-Vera
Playing Frames Only When Certain Criteria Are Met?
I hope I can explain this well.
First, here's the movie in question:
http://www.pseudodigm.com/testing/voip.swf
the fla is here: http://www.pseudodigm.com/testing/voip.zip
The concept is, you have this big picture and when you hover over a label the picture zooms in and you get a detail.
Problem is, say you're hovering over "Operations" then you just move your mouse down to "Customers". The movie sorta stutters over from Operations to Customers. What I would LIKE it to do is act as if I had removed my mouse from the button, THEN hovered over the next item.
Ie:
1. User sees big picture
2. User hovers over "Operations"
3. Movie Zooms In to Operations.
4. User hovers over "Customers"
key -->5. Movie zooms all the way back out, THEN zooms into "Customers"
so on...
I hope this makes sense.
So far I've tried to put a switch into the frames where the movie is zoomed all the way out. something saying "ok, we're ready to zoom in" then have the buttons say "if the frame says "we're ok" then we can zoom in". But that didn't work for me.
Help?
Pseudo
Playing Frames Backwards W/as
I'm making a new section tto my site and I'm adding a 3d object that rotates 1 way when you prees DOWN and the opposite when you press UP. I was made in Swift, so it is in frames. Basicly I want it so when the user presses down, it will play the frames normaly until it reaches a stop(); command and when down is pressed, it'll play the frame backward until it reaches a stop(); command.
Playing Specific Frames Only?
Hey all,
I'm trying to loop only five or so frames from an entire movie clip, and I'm not quite sure how to do this.
Basically I have a man walk in and sit down as an intro scene (frames 1-6), and then from there playing just looping the 'sitting' animations (frames 7-11) until the user does something with the interface. can someone point me to a tutorial or help me out?
Thanks.
Playing Backwards Through Frames
I'm having a bit of a problem with getting the timeline to play backwards through frames. I've tried doing something like the following and thought it should've worked but it didn't, and I need some help with this plz:
function onEnterFrame() {
gotoAndPlay(lastframe);
lastframe = _currentframe--;
}
Thanks
Playing Frames (images) With XML
I am working on this XML slideshow tutorial, and it only goes to the next frame when you use the next button, how would i change it that it goes to thenext frame automaticly?
what I am trying to achieve is a turntable which gets the images of the frames out of an external folder throug XML, but I cant even get this to work
Code:
next_btn.onRelease = function() {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
Frames Not Playing Correctly
Hi!
I'm experiencing a strange phenomenon with my movie. Here's the scenario:
The main timeline has 3 frames. Each frame has a register button, a contact button and a home button.
Frame 1 contains a movieclip that initially runs and is triggered on release of the home button.
Frame 2 contains a movie clip that is triggered on release of the contact button.
Frame 3 contains a movie that is triggered on release of the register button.
I have stop(); statements at the end of the movieclips on frame 2 and 3. The movie clip on frame 1 loops.
Each button runs the correct movie clip when pressed the first time but when pressed a second time each button runs the next movie clip in "line".
eg. If I click contact it goes to contact movie clip and plays it and stops. From within contact_mc , if I click the contact button, MOVIE CLIP 1 on the main timeline plays!!!
I have specified _root.gotoAndPlay for each button event, so shouldn't it always play the corresponding frame on the main timeline?
I don't know if this is clearly explained, but I sure would appreciate some feedback.
Thanks!
-Vera
Playing Frames Only When Certain Criteria Are Met?
I hope I can explain this well.
First, here's the movie in question:
http://www.pseudodigm.com/testing/voip.swf
the fla is here: http://www.pseudodigm.com/testing/voip.zip
The concept is, you have this big picture and when you hover over a label the picture zooms in and you get a detail.
Problem is, say you're hovering over "Operations" then you just move your mouse down to "Customers". The movie sorta stutters over from Operations to Customers. What I would LIKE it to do is act as if I had removed my mouse from the button, THEN hovered over the next item.
Ie:
1. User sees big picture
2. User hovers over "Operations"
3. Movie Zooms In to Operations.
4. User hovers over "Customers"
key -->5. Movie zooms all the way back out, THEN zooms into "Customers"
so on...
I hope this makes sense.
So far I've tried to put a switch into the frames where the movie is zoomed all the way out. something saying "ok, we're ready to zoom in" then have the buttons say "if the frame says "we're ok" then we can zoom in". But that didn't work for me.
Help?
Pseudo
Playing Frames On Dif Level
Can anyone tell me how to play a frame in a movie which is loaded on another level of my main movie. For instance: in my main movie I have movie2.swf loaded on _level1. Before i unload movie2.swf i want to play a few frames at the end.
Sorry if this is a really basic question - I'm still struggling with working with movies on dif levels.
thx in advance for any help.
Playing Frames Backwards
I have an annimation with two buttons one goes to the next approaite frame the other goes backward.
For the forward buttons I am just using the GotoAndPlay fuction, but how do I make the back button play the frames backward?
Any help would be grand!
Cheers
Jemes
Playing Multiple Frames
Hi, I was wondering, how do I get a button to play a frame label, then play a different one after that?
So it would be, 'User clicks on button' --> loads a frame I have labeled --> after that has finished playing, --> goes to a different frame I have labeled.
Hope this makes sence and someone can help me.
Cheers
Playing Frames In Reverse Order...
I would like to play a certain section of frames in my scene in reverse order after an "on release" action is initiated. Any comments would be appreciated.
Ben
Playing Only Specific Frames Problem
I've searched on the forums and have not found a solution so hopefully this isn't too much of a request for help.
On my main timeline I have a movie clip which within it consists of a 60 frame animation. Now on the main timeline are buttons which when clicked I would like to play that movie clip.
Now here is my problems or questions. If you press, say button 1 it will play the entire animation. Now if you press button 2 I would like for it to play only the first 30 frames and then stop and stay at frame 30 of the animation. From what I gather I don't think there is a stop command in the mc on frame 30 or the button 1 function would never play all 60 frames. I have the button 1 code to be:
on (release){
_mc.gotoAndPlay(1);
};
button 2?
on (release){
_mc.gotoAndPlay(1);
if(30){
stop();
}
};
Please help I am at a loss.
Playing Few Frames Of Movie Clip
i want to play only frames 5 to 12 of a movie clip on mouse click. how do i do that. how do i know when i am done playing those frames?
Playing Frames In The Revers Order?
Hi all
Is it possible in flash (or swish or any other application) to play the frames in the reverse order?
For example can we make a button which plays the frames beginning from 50 to 10?
Stop For Frames
ok a quick one this time....
i want to be able to hold a script for a number of frames.
eg. if frame in one movie is on 6 and a script is being executed from another movie at that same time..i want the script to hold itself untill the framehead is on 12 in the other movie
thankz people
How To Stop FLV After Going Different Frames?
Hi everyone!
I have three FLV files and I created a movieclip and put these FLV files.
My problem is that after viewing FLV and I go to different frames, then FLV is still playing. How to stop this?
This is how I wrote AS3:
stop();
function vid1(e:Event):void{
vidPlayer.source = "http://www.funrise.com/flash/BBQ.flv"
}
vid1_btn.addEventListener(MouseEvent.CLICK,vid1);
function vid2(e:Event):void{
vidPlayer.source = "http://www.funrise.com/flash/GAZOOKA.flv"
}
vid2_btn.addEventListener(MouseEvent.CLICK,vid2);
function vid3(e:Event):void{
vidPlayer.source = "http://www.funrise.com/flash/TYPHOON.flv"
}
vid3_btn.addEventListener(MouseEvent.CLICK,vid3);
Hope someone helps this.
Thanks,
Stop Playing
Hi,
What code can I used to tell a mc to stop playing once the button is clicked. My problem is that the mc is still playing once the button is pressed...I need to have it stop on command.
Thanks for your help!
Swf Won't Stop Playing
Hello I have an external movie that I am player in another swf.
I would like to stop the swf when its sequence finishes but it just seems to stick around and not finish. I.e when the movie is done it dosn't dissapear in the other movie clip. I know this should work because my other swfs work fine. The difference with this one is that it has a control bar inside it that is used to rewind, fast forward, ect.
I am not sure how to unload this clip inside the file itself. I cannot change the script in the main swf though this needs be done from the external file (the one with the control bar that is being loaded into the main movie).
Here is the script from the external swf with the control bar that is being loaded in. Any ideas?
Frame Actions:
_parent.stop();
faderbackground._width = width;
looping = false;
playing = false;
top = knob._y;
bottom = knob._y;
left = knob._x;
faderWidth = faderbackground._width-knob._width;
segmentWidth = faderWidth/_parent._totalframes;
right = knob._x+faderWidth-segmentWidth+1;
faderbackground._width -= (segmentWidth-1);
with (backing) {
_width = Math.abs(_x)+faderbackground._width+((_height-faderbackground._height)/2);
shadow._width = _width;
}
_parent.onEnterFrame = function() {
if (_parent._currentframe == _parent._totalframes && !looping) {
playing = false;
_parent.stop();
}
if (dragging) {
playing = false;
_parent.gotoAndStop(Math.ceil(knob._x/segmentWidth));
} else {
knob._x = (_parent._currentframe*segmentWidth)-segmentWidth;
}
//
playhilite._visible = playing;
loophilite._visible = looping;
//
};
//
// playback controls
loop.onRelease = function() {
loophilite._alpha = 100;
};
loop.onPress = function() {
looping = !looping;
loophilite._alpha = 0;
};
playButton.onPress = function() {
playhilite._alpha = 0;
};
playButton.onRelease = function() {
playhilite._alpha = 100;
playing = true;
_parent.play();
};
playButton.onDragOut = function() {
playhilite._alpha = 100;
};
playButton.onDragOver = function() {
playhilite._alpha = 0;
};
stopButton.onRelease = function() {
playing = false;
_parent.stop();
};
rewind.onRelease = function() {
playing = false;
_parent.gotoAndStop(1);
};
stepBack.onRelease = function() {
playing = false;
_parent.prevFrame();
};
stepForward.onRelease = function() {
playing = false;
_parent.nextFrame();
};
goToEnd.onRelease = function() {
playing = false;
_parent.gotoAndStop(_parent._totalframes);
};
knob.onPress = function() {
_parent.stop();
startDrag(knob, false, left, top, right, bottom);
dragging = true;
};
knob.onRelease = function() {
stopDrag();
dragging = false;
};
|