Forward And Backward Buttons Problem
I have a chronological timeline for a historic site. There are a series of buttons (chronological dates) that change the x position of the timeline_mc.
At either end of this series of dates, (buttons which reference the array i established for the timeline x position) I have forward and backward buttons that determine what array index number I'm at and then proceed to next index number respectively.
What those fwd/bckwrd buttons don't do, which I'd like help with, is cycle through the down state look of the date buttons.
I've also attached my fla file to help clear up confusion.
Code: //finds current x pos and sets speed to new x pos Movieclip.prototype.scrollme1 = function(xPos) { cX = this._x; difX = cX-xPos; this._x = cX-(difX/5); }; Movieclip.prototype.scrollme2 = function(xPos) { cX = this._x; difX = cX-xPos; this._x = cX-(difX/6); }; stop(); //variable starting value arrayIndex = 0; //timeline stopping postions timeline1Xpos = new Array(2800, 2100, 1400, 700, 0, -700, -1400, -2100, -2800); //scrolling animation timeline1.onEnterFrame = function() { this.scrollme1(timeline1Xpos[arrayIndex]); }; stop(); //variable starting value arrayIndex = 0; //timeline stopping postions timeline2Xpos = new Array(2800, 2100, 1400, 700, 0, -700, -1400, -2100, -2800); //scrolling animation timeline2.onEnterFrame = function() { this.scrollme2(timeline2Xpos[arrayIndex]); }; //buttons that scroll the timeline to specific x positions //but1 controller_mc.but1.onRollOver = function() { this.frameHold = this._currentframe; this.gotoAndStop("over"); }; controller_mc.but1.onRollOut = function() { this.gotoAndStop(this.frameHold); }; controller_mc.but1.onRelease = function() { arrayIndex = 0; for (var mc in this._parent) { var thisHold = this; if ((this._parent[mc] == thisHold) && (this._parent[mc]._name.indexOf("but") != -1)) { this._parent[mc].gotoAndStop("on"); } else { this._parent[mc].gotoAndStop("off"); } } this.frameHold = this._currentframe; }; //There are actually 7 more buttons here, see the attached file for full code }; // //timeline forward and backward buttons controller_mc.goForward.onRelease = function() { if (arrayIndex<7) { arrayIndex++; } }; controller_mc.goBack.onRelease = function() { if (arrayIndex>0) { arrayIndex--; } };
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 02-05-2007, 05:08 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Browser Forward/backward Buttons
Hey all, I have been out of the world of Flash for a couple of years and I know there has been major improvements in capabilities since V.5. However is there a way to set a single flash movie to go foward and backward using browser buttons. Thanks
-Fleep
Need Stop/forward/backward Buttons
hi all,
I have a flash file of a bottle rotating, and what I want is do is to let the user stop the bottle, or rotate it forwards or backwards.
Do I need to have 2 flash files, one rotating one way, then take a copy and reverse it to go the other way, and link them to separate buttons, or is there an easy way to do this
Forward And Backward Buttons On Movie
well what i am trying to do is move between 2 text boxes through a motion tween. but thats not going to work because you can't tween backwards. so what would be the best thing to do?
this has probably been posted before but i have no idea where it is. i tried the sliding menu tute but that didn't work. i'd appriciate any help.
dave
Forward And Backward Buttons On Movie
well what i am trying to do is move between 2 text boxes through a motion tween. but thats not going to work because you can't tween backwards. so what would be the best thing to do?
this has probably been posted before but i have no idea where it is. i tried the sliding menu tute but that didn't work. i'd appriciate any help.
dave
My Buttons Working Only Forward Not Backward,
i need tutoring for how to create a website with follow instructions:
1- contain a minimum of 4 interactions events triggered by the viewer
2- contain at least 1 vector animation ( can be shape or motion tween but must be vector, meaing you drew it)
3- contain a video ( it would be nice but video does not need to relate to the project)
4- button sounds and background sound (that I can turn off and on for bonus points)
5- use at least one built -in component- you must "skin" to fit your site design.
7- use states as navigation - (frame Labels)
8- load an exteranl swf or image
9- load one external text file ( bonus for using HTML and Styling with CSS)
i created a website for above, but somehow i have a problem with activation my buttons properly, somehow i can only go to one page and after i click home page, it won't activate my next button. i have close and start over. also my video won't attached. can somebody help http://ceweb.uml.edu/kcher116/components/cake%20factory/cake%20factory.html
Buttons Work Forward Not Backward
please see my http site, just add http:// and in the end .html
ceweb.uml.edu/kcher116/components/cake%20factory/cake%20factory
i created a website for above, but somehow i have a problem with activation my buttons properly, somehow i can only go to one page and after i click home page, it won't activate my next button. i have close and start over. also my video won't attached. can somebody help
need tutoring for how to create a website with follow instructions:
1- contain a minimum of 4 interactions events triggered by the viewer
2- contain at least 1 vector animation ( can be shape or motion tween but must be vector, meaing you drew it)
3- contain a video ( it would be nice but video does not need to relate to the project)
4- button sounds and background sound (that I can turn off and on for bonus points)
5- use at least one built -in component- you must "skin" to fit your site design.
7- use states as navigation - (frame Labels)
8- load an exteranl swf or image
9- load one external text file ( bonus for using HTML and Styling with CSS)
Forward And Backward Buttons For A Music Soundtrack.
hey all. can someone help me create forwards (play next track) and backwards (play previous track) buttons that I could use for a music soundtrack. I would like to load each track as a separate .swf file. Is there an easy way? arrays???..... thanks a BUNCH.
Creating Forward And Backward Control Buttons
I was wondering if someone could point me in the right direction to info or provide info on how to create buttons that will control a movie clip and make it play forward or backward.
I plan to import a series of images or avi.. not sure which one yet... into a movie clip.. so lets say for example there are 20 frames in the movie clip. and each frame has a slightly different version of an image.
I want to have buttons that the user can put their mouse over and when they hold down the mouse button the movie clip will move forward or backward, depending on which button they choose... ( in other words I will have a forwards and a backwards button) when they let go of the button the movie will stop on whatever frame it is on.
I am fairly new to actionscripting and using flash mx.
Does anyone have any ideas on where to start?
Thanks
ExtraB
Easing Movement From Forward And Backward Buttons.
Hi
I am trying to set up a long horizontal movie clip which will be eased to different points from a forward and a backward button.
I would love to have this done simply via targeting x axis values, but realize this may be best just with "advancing forward" a set number of frames.
But, I still need easing.
How can I code the button to move set amounts of x axis with easing?
Thanks for any help
Challenge – Action Script Buttons Forward/backward
Converted to Flash MX (from MX 2004)
Please help me – I’m pulling out my hair!
In this movie, I made a drop-down menu with seven buttons. Only button 1 and 3 work at this point. When you click on 1 or 3, the content will be displayed in the holder MC (black box).
You may also type into the input box the terms “one” or “three” which will also display this content inside the holder MC.
What I would like to have is for my Back / Next (previous/forward) buttons to work but I still have not found how to make them work ! At this point, the user only has the choice of 7 terms or 7 buttons to choose from but I will add much more content in the future. I’m trying to get these buttons to work first.
This project will be for a small database to be distributed on a CD-Rom (no html) only Flash Player.
Please – Can a Flash GURU lend me a hand with this?
Many thanks,
Luke
Creating Movieclip Buttons To Play Forward And Backward
I have a 16 frame movieclip (MC labeled animation) that i'd like to have 2 buttons control so when you rollover the forward button it plays the movieclip forward(and loops from frame 16 to 1) and the MC stops on the current frame when you rolloff.
The same with the backward button - when you rollover the button it plays the MC backwards (and loops) and stops the MC in the current frame when you rolloff.
Below is the code I have for the forward button (which works fine) it plays the MC (labeled animation) when you rollover the forward button and stops in the current frame when you rolloff.
However I can not get the backward button to work. I've tried a number of things with no success.
Forward button code:
on (rollOver) {
_root.animation.play()
}
on (rollOut) {
_root.animation.stop();
}
Code in the Back button (which does not work):
on (rollOver) {
_root.animation.prevFrame();
}
on (rollOut) {
_root.animation.stop();
}
I also have this code in frame 1 of the root timeline to stop the animation movieclip from playing when you first enter the movie. It goes to "start" which is frame 1 of the animation movieclip:
tellTarget("animation")
gotoAndStop("start");
Any assistance would be greatly appreciated.
Controlling A Movie Clip (playing Forward & Backward) With Multiple Buttons
Hey guys, i started tinkering around with actionscript a few weeks back. Hence, i don't really know the more complicated syntax. However, since i was learning programming (C, VB etc) a looong time back, i figured i'd be able to work out the underlying logic.
Problem: I can get a movie clip to play forward and backwards with two buttons. However, when i'm adding more buttons, which are supposed to get the movie clip to start playing from wherever it is, and to come and stop at x frame, i'm hitting a roadblock.
My stage currently has 3 buttons, with the following code:
BUTTON 1
Code:
on (release) {
_global.newLink = 1;
_global.buttonValue = "one";
}
BUTTON 2
Code:
on (release) {
_global.newLink = 2;
_global.buttonValue = "two";
}
BUTTON 3
Code:
on (release) {
_global.newLink = 3;
_global.buttonValue = "three";
}
My movie clip has the following script on it:
Code:
onClipEvent (load)
{
stop();
_global.currentLink == 1;
_global.newLink == 1;
_global.buttonValue == "none";
}
onClipEvent (enterFrame)
{
stop();
if (_global.currentLink - _global.newLink < 0)
{
_global.dir = "fwd";
}
else if (_global.currentLink - _global.newLink > 0)
{
_global.dir = "bkw";
}
else
{
_global.dir = "stay";
}
// FOR FORWARD MOTION
if (_global.dir == "fwd")
{
if (_global.buttonValue == "two")
{
if (this._currentframe == 15)
{
stop();
}
else
{
this.nextFrame();
}
}
else if (_global.buttonValue == "three")
{
if (this._currentframe == 24)
{
stop();
}
else
{
this.nextFrame();
}
}
}
// FOR BACKWARD MOTION
else if (_global.dir == "bkw")
{
if (_global.buttonValue == "two")
{
if (this._currentframe == 15)
{
stop();
}
else
{
this.prevFrame();
}
}
else if (_global.buttonValue == "one")
{
if (this._currentframe == 1)
{
stop();
}
else
{
this.prevFrame();
}
}
}
else if (_global.dir == "stay")
{
stop();
}
}
Where am i screwing up?
Forward And Backward
PHP Code:
onClipEvent (enterFrame) {
if (this._currentframe == 1) playMe = true;
if (this._currentframe == this._totalframes) playMe = false;
if (playMe == true) this.nextFrame();
if (playMe == false) this.prevFrame();
}
PS: I've seen this asked a few times in some forums... I thought I should share my way.
Forward/Backward Animation
I have animation in legth of 5 frames, it is opening drawer, so to reuse this 5 frames i would also like it to close..how should i simply do that in AS, just to go back to frame 1??
Random Backward Forward
hi, i need a script, that makes:
on the main timeline the movie plays backward and forward one frame randomly and looping forever. I mean on each frame should be an action sript that randomly decides where to go: backward or forward.
Scrolling Nav Forward And Backward
Hello, I'm new and am just past the beginner stage of flash.
I have a question. Take a look at this site:* www.fabianocom.com
Does anyone know how the flash on this site is done. It can scroll backward and forward on the timeline.
any help would be appreciated, thanks, robw
[F8] Forward And Backward Button
I'm doing a school project in Flash, and I have it so that it shows a description of a picture. I made buttons and I need a script so that I can go forward one frame and stop, and another button to go one frame backwards and stop. Please help!
Play Forward Then Backward
Hi, please anybody help.
I need to create an small SWF flash video. Everything is ok, but I just want that when the video come to end then begin to play backward and then foreward and then backward, etc...
I need this kind of loop.
Animate Forward And Backward?...help Please
hi there! I have a small problem.
I have a button. on rollover, I want a mc in another location to animate, not a problem, but when I roll out, I want the mc to animate bacwards. can someone help rewrite this code, I found on flashkit, so it will work with what i am trying to do?:
ActionScript Code:
onClipEvent (enterFrame) { if (this.hitTest(_root._xmouse, _root._ymouse, true)) { this.nextFrame(); } else { this.prevFrame(); }}
I tried this:
ActionScript Code:
on (rollOver) { if (this.hitTest(_root._xmouse, _root._ymouse, true)) { _root.mc.nextFrame(); } else { _root.mc.prevFrame(); }}
but it did'nt work out right...
any help will be much appreciated!
thx!
Navigating Forward/backward
Hello,
I have a small actionscript error.
I have a short .fla movie
I want to be able to move forward and back through it, stopping and restarting at predefined intervals.
I have created a "Marker Layer" which has keyframes at the interval points. Each keyframe in this layer is labled chapter1, chapter2 chapter3 etc.
I have written the following code in another new layer.
ActionScript Code:
chapterCount = 1;
keyListener = new Object();
keyListener.onKeyDown=function(){
if (Key.isDown(Key.RIGHT)){
gotoAndPlay ("chapter"+chapterCount);
chapterCount = chapterCount+1
trace ("chapterCount"+chapterCount);
}
else if (Key.isDown(Key.LEFT)){
gotoAndPlay ("chapter"+chapterCount);
chapterCount = chapterCount+1
trace ("chapterCount"+chapterCount);
}
}
Key.addListener(keyListener);
I would expect to get the following trace if I pressed the Right keyboard key 4 times.
chapterCount2
chapterCount3
chapterCount4
chapterCount5
Instead I get this:
chapterCount2
chapterCount2
chapterCount3
chapterCount2
chapterCount3
chapterCount4
chapterCount2
chapterCount3
chapterCount4
chapterCount5
Can anyone please see what I have done wrong?
Thank you much.
Tim.
MC Forward And Backward(2 B Used For A MENU)
I got a MC to move backwards and forewards over a number of frames. However, I would set up buttons that tell the MC to move to a certain frame within itself, moving backwards and forewards.
Movie Clip - Forward And Backward
Hey,
Does anyone out there know how to set this up?
2 buttons (a) and (b)
I have a movie clip with 10 frames in it.
I want button (a) to make the movie play forward
and (b) to play it backward from the place that
(a) left off. When your not on either button the
movie stops.
I don't think its very hard but I can't seem to
figure it out and can't find any tutorials on it.
I know how to make buttons that 'slide' a movie
up and down or left and right, but what I want is
for the buttons to play the movie.
Thanks to anyone who can hook me up.
Forward And Backward Movement With Ease In
hi,
i'm putting together a slide show that consists of four images of equal dimensions. the user has control over four buttons, each corresponding to one of the images. the images themselves have been aligned side by side and consolidated into a single graphic symbol named "imageSet". i've then created a mask layer so that only one image from "imageSet" is visible at any given time.
here's how i'd like the whole thing to work...
the slide show begins with image 1 visible behind the mask layer. if the user presses button 4, "imageSet" should quickly move horizontally to the left and come to a gradual stop when image 4 is visible behind the mask. if the user presses button 2, "imageSet" (now stopped at image 4) should quickly move horizontally to the right and come to a gradual stop when image 2 is visible behind the mask.
i can get this work if i leave out the part about "imageSet" coming to a gradual stop. in other words, it's the "easing in" that's screwing me up. so long as we're talking about a straight tween with no ease in, i can do it.
but how can i do this with an ease in in either direction?? with two or three images, i guess i could create a tween for every single combination (1 to 2, 2 to 1, 1 to 3, 3 to 1, 2 to 3, 3 to 2), but with four images, the number of combinations increases significantly.
there's gotta be a better way to do this. anyone know how?
thanks!
Scroll Movie Forward Backward Etc
Hello, a novice here. Wanting to learn how to have the cursor control an embeded quicktime movie. The cursor movements control the forward and backward direction the movie plays in. By the way the movie has linked buttons in it. I have a poor version worked out but is awkward...
Any help would be grand Cheers...Taksman
Button Problems Forward Backward - Please Help.
Converted to Flash MX (from MX 2004)
Please help me – I’m pulling out my hair!
In this movie, I made a drop-down menu with seven buttons. Only button 1 and 3 work at this point. When you click on 1 or 3, the content will be displayed in the holder MC (black box).
You may also type into the input box the terms “one” or “three” which will also display this content inside the holder MC.
What I would like to have is for my Back / Next (previous/forward) buttons to work but I still have not found how to make them work ! At this point, the user only has the choice of 7 terms or 7 buttons to choose from but I will add much more content in the future. I’m trying to get these buttons to work first.
This project will be for a small database to be distributed on a CD-Rom (no html) only Flash Player.
Please – Can a Flash GURU lend me a hand with this?
Many thanks,
Luke
How Do I Make A Timeline Appear To Go Forward AND Backward?
I'm creating a picture gallery that transitions forward but if I want to make it so that if the viewer wants to go back, the same transition happens backwards?
a good example can be seen in any of the portfolio sections of http://www.zacwittedesign.com/rives/
What would be your suggestion in setting this up?
Forward/Backward With Skipping Stops ... ?
Guys, I would really appreciate if you could point me in a good direction here.
I want to make a pretty simple flash site. Basically a sequence. One scene. The sections are progression of a movie. For example.
NEWS(frame 50) BIO(frame 100) ABOUT(frame 150) CONTACT(frame 200)
The whole thing will be like a movie, so there will be transitions and animation between every section of the site. Remember it's all one scene.
What I want to be able to do is playing whole sequences.
For example I'm on CONTACT(frame 200) page and I press to go into NEWS section. I'd like to play backwards all the way through and up to NEWS (frame 50) without stopping. Or if I'm in BIO and want to go to CONTACT page, I'd like to be able to play through the ABOUT page without stopping?
Also, is there any examples/guides to how to make transition structures similar to http://mikeshard.com/ ?
Thank you
[F8] Move Forward And Backward On Timelin
Hi flash genius!
I am trying to do something similar to www.eminem.com, in a much more simpler way.... instead, in fact it is a gallery page with still images, and each time the user select a thumbnail, it plays all the frames until it reaches the selected image.
I have set a variable and then each keyframe assess if it has to stop or not. Simple. But I can only get it to go forward in the timeline, and I would like that, when a previous thumbnail is selected the timeline would go backward until it reaches ths appropriate image. I tryied prevFrame and nextFrame, but it doesnt seem to work? Am I clear!?
Any help would be appreciated
merci!
Sandra
I Have A Forward And Backward Button How Do I Get It Working?
Heres an example of my button script, I just copied the parts for my button. How would I get it to go to the second page of my animation?
btn_Moon.addEventListener(MouseEvent.CLICK, buttonClickMoon);
public function buttonClickMoon (e:MouseEvent)
{
page1.gotoAndStop("Moon");
Handling Events In Forward/Backward MC
I'm trying to make a basic horizontal menu system where a bar slides under the link that you hover on. I'm doing this using an MC for the slidingbar (because it will eventually follow a very strange path) and play it forward/backward depending on which link is moused over. Currently the bar slides to the respective link, however, if I mouseover another link while the MC is in motion, it stops dead never to move again (I have to wait until the bar has reached the designated location THEN mouseover another link).
Hoping an expert can point out my beginner errors. Cheers.
The first 4 para's are protos for MC forward and backward motion.
ActionScript Code:
MovieClip.prototype.reverse = function(from:int,to:int):void{
this.rev_from = from,this.rev_to = to;
this.gotoAndStop(from);
this.addEventListener(Event.ENTER_FRAME,rev);
}
function rev(e:Event){
if(e.target.currentFrame>e.target.rev_to)
e.target.prevFrame();
else{
e.target.stop();
e.target.removeEventListener(Event.ENTER_FRAME,rev);
}
}
MovieClip.prototype.forward = function(from:int,to:int):void{
this.for_from = from;
this.for_to = to;
this.gotoAndStop(from);
this.addEventListener(Event.ENTER_FRAME,forw);
}
function forw(e:Event){
if(e.target.currentFrame<e.target.for_to)
e.target.nextFrame();
else{
e.target.stop();
e.target.removeEventListener(Event.ENTER_FRAME,forw);
}
}
home_button.addEventListener(MouseEvent.MOUSE_OVER,function(e:MouseEvent){
if(slide1.currentFrame>10)
slide1.reverse(slide1.currentFrame,10);
else if(slide1.currentFrame<10)
slide1.forward(slide1.currentFrame,10);
else;
});
gal_button.addEventListener(MouseEvent.MOUSE_OVER,function(e:MouseEvent){
if(slide1.currentFrame>40)
slide1.reverse(slide1.currentFrame,40);
else if(slide1.currentFrame<40)
slide1.forward(slide1.currentFrame,40);
else;
});
Forward/Backward Button Function
How can I adjust the code below to just have a forward button (displaying the next image) and backward button (displaying the previous image)? Images are in sequence and named image1.gif, image2.gif, image3.gif and so on.
________________________________________________
// About us Button
but1.onRelease = function() {
_root.trig.xposnew = -(_root.imagewidth);
};
// Products Button
but2.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*2);
};
// Services Button
but3.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*3);
};
// Clients Button
but4.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*4);
};
// Contact Us Button
but5.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*5);
};
________________________________________________
Code used is from this tutorial
Layers Fading Forward And Backward
Hello all, i am very new to flash and have what is probably a very advanced question. I am wondering if it is possible to have two overlapping images on a flash page and click a button on the top image and make the bottom image fade to the front. As it is, i have the top image linking to the bottom one by loading another html page, which brings the bottom image to the front. For further insight into what the heck i'm talking about visit my site:
http://people.ku.edu/~tzen/bottlefort.html.
just click the tabs around the outside and notice the various circle come to the front.
thanx for the help-
Scrolling Forward And Backward Issue
I have a movie in FlashMX that I am using an actionscript to scroll the scene forwards and backwards that I got from monitoring posts on this forum (thanks, I usually solve my problems and learn just from searching posts).
The script follows:
onEnterFrame = function() {
if (this._currentframe == 1) {
playMe = true;
}
if (this._currentframe == this._totalframes) {
playMe = false;
}
if (playMe == true) {
this.nextFrame();
}
if (playMe == false) {
this.prevFrame();
}
};
The problem I encounter is that the scene will scroll down and back then stop, rather than continue to scroll back and forth continuously.
I believe the reason has to do with the fact that I have this script on the first frame of the second scene of the movie. The first scene plays then has a goTo action on the last frame to go to frame 1 of the second scene. However, I don't what to do to fix it.
Help is appreciated. If you want to see the .fla file, let me know and I will post it.
Thanks.
Play Mc Forward And Backward Using Classes And Set Interval
Hey guys I posted a question a couple of weeks ago and couldn't find that post. I wanted to show ya'll a great peice of code you helped me make. I can fade any mc with this code. I have also made it as a class. my next step is to make a button subclass as well as a transition sub class. If you want to see a working example using set interval here is one.
Thanks again I couldn't have done this without Flash Kit
Sincerely,
Quince wyss
Peak Studios - web design and Development
I have tried to attach the zip file if it didn't work here is a link where I posted it.fader.zip
Complex Navigations. Playing Backward/forward.
Guys, I would really appreciate if you could point me in a good direction here.
I want to make a pretty simple flash site. Basically a sequence. One scene. The sections are progression of a movie. For example.
NEWS(frame 50) BIO(frame 100) ABOUT(frame 150) CONTACT(frame 200)
The whole thing will be like a movie, so there will be transitions and animation between every section of the site. Remember it's all one scene.
What I want to be able to do is playing whole sequences.
For example I'm on CONTACT(frame 200) page and I press to go into NEWS section. I'd like to play backwards all the way through and up to NEWS (frame 50) without stopping. Or if I'm in BIO and want to go to CONTACT page, I'd like to be able to play through the ABOUT page without stopping?
Also, is there any examples/guides to how to make transition structures similar to http://mikeshard.com/ ?
Thank you
GotoAndStop Only Moves Forward Along Timeline, Not Backward?
Ok, this is kinda weird... I have pretty standard buttons and then just tell the timeline to go to a specific label. But it only moves forward along the timeline, not backwards. I have the below ActionScript on the first frame @ "Home", and its the only key on that layer for the whole time, so I assume that all these buttons should work no matter the current frame along the timeline. If I click on Btn_2ndThing, nothing happens when I then try to click on Btn_1stThing, but if I click on Btn_1stThing FIRST, then it will go to Btn_2ndThing. make sense?
Actionscript at Home frame:
onEnterFrame = function(){
Btn_Home.onRelease = function()
{
gotoAndStop ("Home");
}
Btn_1stThing.onRelease = function()
{
gotoAndStop ("1stThing");
}
Btn_2ndThing.onRelease = function()
{
gotoAndStop ("2ndThing");
}
}
The names of the buttons is also consistant throughout the timeline..
Help!
Play Forward & Backward True Timeline
I made an animation in After Effects and rendered it into a .jpg sequence. With flash i want to make this animation interactive. Every frame holds a jpg file.
I want to have 3 buttons (1 in the top, 1 in the middle and 1in the bottom). These buttons control if the movie plays forward, backwards or stops. So far this works but the stop and the change of direction is too sudden (direct), i want this with a smooth transition.
Someone recommended me to use tween but as for as i know this is only affecting the movement of a movieclip?
Code i have so far:
Code:
stop();
var kant:String = "forward";
forward_btn.onRollOver = function(){
this._parent.direction = "forward";
}
rewind_btn.onRollOver = function(){
this._parent.direction = "rewind";
}
stop_btn.onRollOver = function() {
this._parent.direction = "stop" ;
}
this.animation.onEnterFrame = function(){
if(direction == "forward"){
this.nextFrame();
} else if(direction == "rewind"){
this.prevFrame();
} else if(direction == "stop") {
this.stop();
}
}
Moving Backward/forward With Prev/nextFrame
hi. im trying to make animated hover effect. simply, i have a bit long animation and i wanted to play it forward when rollOver, and backward when rollOut.
so i wrote down this code into each frame of new layer above animation
Code:
if (mouseover) {
nextFrame();
} else {
prevFrame();
}
*mouseover flag is a boolean based on rollOver, rollOut
this "works", but instead of playing animation, it instantly jumps to its end, bth forward or backward direction (imho some "chain-reaction" of keyframes with same code written above)
any idea how to fix this? or other way to do it?
my .fla file
thx
Running Scrolling Text Forward And Backward
I want to create a window with scrolling text where one button moves a list of items down to the bottom and an another button moves the list from it's current location up to the top. I don't want the clunky scroll bar, just two buttons. I've been able to get the text to move up, but to move it down it jumps to the end of the list first. I want it to scroll forward and back from the spot where it stops.
Playing Forward And Backward A Movie Clip
Hello friends, I was hoping someone could enlighten me on this.
I have a movie clip and some buttons on the stage. Depending on the button I press, the movie clip will either have the frames moving forward or backward.
Let me illustrate :
Movie Clip : total 30 frames
6 buttons (A, B, C, D, E,F)
Actionscript : Stop() at frames 5,10,15,20,25,30
If frame is at 1 : will move to frame 5.
At frame 5 :
Button A does nothing
Button B moves movieclip to frame 10
Button C moves movieclip to frame 15
Button D moves movieclip to frame 20
Button E moves movieclip to frame 25
Button F moves movieclip to frame 30
At frame 10 :
Button A moves movieclip backwards to frame 5
Button B does nothing
Button C moves movieclip to frame 15
Button D moves movieclip to frame 20
Button E moves movieclip to frame 25
Button F moves movieclip to frame 30
At frame 15 :
Button A moves movieclip backwards to frame 5
Button B moves movieclip backwards to frame 10
Button C does nothing
Button D moves movieclip to frame 20
Button E moves movieclip to frame 25
Button F moves movieclip to frame 30
etc etc... you get the idea
Can anyone please detail out how this is possibly done ?
Thank you very much for your kind assistance
Add Backward/Forward Button To Xml Photo Gallery
Hi, I need to add a backward and forward button to a photo gallery I am working on, but not sure how to do it.
Here is the code:
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
name = [];
description = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
name[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
link[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
} else {
content = "file not loaded!";
}
imageGallery();
//loadMeBaby();
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("template.xml");
/////////////////////////////////////
////SMOOTH XML IMAGE GALLERY TEMPLATE
////////////////////January 2007
// tween class
#include "lmc_tween.as"
//easing style
var easeStyle:String = "easeOutQuad";
//gap between page numbers
var pageNumGap:Number = 24;
//_y postition of page numbers
var yPos:Number = 252;
//_x postition of page numbers
var xPos:Number = 400;
// margin of buttons from edge
var margin:Number = 126;
// width of images
var imageWidth:Number = 559;
// preloader
var que = new Array();
var timeout = 100;
var loading = false;
var interval;
var ic;
// Adds files to the load que
function addFile(item, target) {
que.push({url:item, mc:target});
}
// load next que item
function loadFiles() {
if (que.length && !loading) {
loading = true;
ic = 0;
item = que.shift();
item.mc.loadMovie(item.url);
interval = setInterval(watchLoad, 40);
item.mc.num = i;
var galleryItems_array:Array = new Array(xmlNode.childNodes.length);
//number of page numbers generated
var pageNumbers:Number = galleryItems_array.length;
thisThumb = item.mc.num - pageNumbers;
item.mc._alpha = 0;
this["square"+thisThumb].alphaTo(100, 0.5, easeStyle,0);
holder_mc["thumb"+thisThumb+"_mc"].alphaTo(100, 0.5, easeStyle,thisThumb);
this["square"+thisThumb].enabled = true;
for (i:Number = 0; i<=item.mc.num; i++) {
//item.mc.alphaTo(100, 1, easeStyle,i*0.5);
};
square0.loading.alphaTo(0, 0.25, easeStyle,0);
}
}
// track load progress
function watchLoad() {
// get bytes loaded and total of image
var bl = item.mc.getBytesLoaded();
var bt = item.mc.getBytesTotal();
// if files has been found...
if (bt>0) {
// get percent loaded
var pct = bl/bt*100;
// if loaded then clear the interval and load the next file in the que
if (pct == 100) {
loading = false;
clearInterval(interval);
loadFiles();
}
} else if (bt == -1) {
// if timout occurs then clear interval and try the next file in the que
if (ic++ == timeout) {
trace("Error: timeout, file not found");
loading = false;
clearInterval(interval);
loadFiles();
}
}
}
// set the imageHolder, set depths and mask.
this.createEmptyMovieClip("holder_mc", 10);
holder_mc._x = 0;
holder_mc._y = 0;
contentContainer.swapDepths(11);
shadow.swapDepths(12);
holder_mc.setMask(contentContainer);
// Where the real action's going on..
function imageGallery() {
// xml array
var galleryItems_array:Array = new Array(xmlNode.childNodes.length);
//number of page numbers generated
var pageNumbers:Number = galleryItems_array.length;
// for each image in the gallery,
for (var i:Number = 0; i<=pageNumbers-1; i++) {
// create a movie clip,
clip = holder_mc.createEmptyMovieClip("thumb"+i+"_mc", i+1);
// call the addFile function, pulling the correct image in from the xml
addFile(link[i], clip);
// and set the postion of the image within the holder to
// be that set by the individual number of the clip,
// mutliplied by the image width variable, set above,
// and give it a little padding.
holder_mc["thumb"+i+"_mc"]._x = (i*imageWidth)+5;
}
// call the preloader function
loadFiles();
// set the header text on the right to be the first from the xml
textHolder.headerText.text = name[0];
// likewise, set the main text to be the first
textHolder.mainText.text = description[0];
// for all the images in the gallery
textHolder.urlText.text = url[0];
// for all the images in the gallery
for(i:Number = 0; i<=pageNumbers-1; i++) {
// attach little square buttons, at their respective depths
attachMovie("square", "square" + i, this.getNextHighestDepth());
// set this particular button to a variable.
currButton = this["square"+i];
// set its unique numerical identifier
currButton.num = i;
// set each button's intial x position, calculated by the margin set by the constant, xPos
// plus that particular button's number multiplied by the gap between it and other buttons
// minus the amount needed to fit snug within the banner, calcuated by the gap required between buttons,
// multiplied by the amount of buttons.
currButton._x = xPos+(i*pageNumGap)- pageNumbers*pageNumGap;
// y position of the buttons
currButton._y = yPos;
// the actual number of the buttons, starting from 1, not 0;
var realNum:Number = i+1;
// if the number is less than ten
//if(realNum<10) {
//give it a zero on the front
//currButton.number.text = "0" + (realNum);
//} else {
// otherwise, let it be
currButton.number.text = (realNum);
//};
//make the buttons fifty percent visibility
currButton.alphaTo(10, 1, easeStyle, 0);
// on clicking this button
this["square"+i].onRelease = function() {
//make this button go back to the left, selected, initial position
this.tween('_x', 10*this.num, 1, easeStyle, 0);
// shift the image gallery by the amount set by the number of the button clicked
holder_mc.tween('_x', (this.num)*(-imageWidth), 1, easeStyle, 0);
// bring the alpha of the text panel down to sero for a second..
textHolder.alphaTo(0, 0, easeStyle, 0);
// for all the buttons
for(i:Number = 0; i<=pageNumbers-1; i++) {
currSquare = ["square"+i];
currSquare.num = i;
// if the button is greater than that clicked
if (i >= this.num) {
// shift it to the right
this._parent["square"+i].tween('_x', xPos+(i*pageNumGap) - pageNumbers*pageNumGap, 1, easeStyle, 0);
} else {
// otherwise, move it to the left
this._parent["square"+i].tween('_x', (i*pageNumGap) + margin, 1, easeStyle, 0);
}
// give all other buttons an alpha value of 75
this._parent["square"+i].alphaTo(75, 1, easeStyle, 0);
// set them to be selectable
this._parent["square"+i].enabled = true;
};
// for the button clicked, move it to the left
this.tween('_x', this.num*pageNumGap + margin, 1, easeStyle, 0);
// set its alpha to full
this.alphaTo(100, 1, easeStyle, 0);
// don't make it selectable (it's just been selected)
this.enabled = false;
// bring the text holder to full alpha
textHolder.alphaTo(100, 0.5, easeStyle, 1);
// set its header text to be that equivalent to the content of the number of its name tag in the xml
textHolder.headerText.text = name[this.num];
// and likewise, for the main text description, do the same
textHolder.mainText.text = description[this.num];
///hhh
textHolder.urlText.text = url[this.num];
};
};
// setting of initial button x position
square0._x = 126;
// set the first button to be fully lit
square0.alphaTo(100, 1, easeStyle, 0);
};
Any help would be really appreciated!
How To Activate 'forward' And 'backward' Option From Menu?
We have a Flash Movie and if we right click on the flash movie and click on forward button the flash movie freezes and does not work. We are trying to fix this. What is the way to move 'Forward' and 'Backward' in a Flash MX movie? Do you need to write script to achieve this function. Please help !
Can I Get A Flash Movie To Play Forward Then Backward?
Is it possible to have a flash movie play forward, then once it reaches the end starts to play backward? I would really like to accomplish this so that I can have a seamless, looping animation that will still be small in file size. Any help is appreciated.
Thanks
Garrett Reese
Moving Forward And Backward Callout Wise
Hi,
I have designed a slider component containing play,stop,last,first,prev,next buttons and slider control.
I am using this control in my flash presentation. The presentation contains callouts (bubble text). I want to use the prev and next button to move to the prev callout and next callout repectively. Currently the prev and next buttons are used to move forward and backward part by part.(the complete movie is divided into 10 parts)
Can use the layer names in actionscript
can we refer to the keyframes using names (something like layername.keyframe).
This will help me to write the code and do the required action
Please help
Regards,
Narendra
Forward And Backward Animation Control Of Film Strip
I have looked all over for help on this and cannot find it.
Here is the deal:
I have a graphic that i have animated on the main scene. The graphic is my main page. It looks like a film strip. I am wanting to create buttons to go to each box of the strip that represent each part of my page: home, about, pixs, ect. I have 6 sections. I need to be able to animate from each of the 6 sections to any and all of the others. Ex. from 1 to 6 or from 2 to 3. I am cool with getting them to go forward, but i am stuck on getting the animations to play backwards. I could create another set of animations that make the film appear that it is moving backwards, but i would like to use the same animation to move the film backwards.
If section 1 animates to section 2 from frame 10-30 I am wanting the animation from secion 2 to 1 to reverse from frame 30 and stop at 10
am i out of my mind or can i do this? I have a fair working understanding of actionscripting, i just cant get my head around this one. I just started using mx and am not sure if it has something that will make this possible.
Thanks in advance for looking at this long post and any help you could offer.
-john
Control Movie Forward/backward With Mouse Movement
I've got a movie clip that I would like to control with the mouse. Wherever the mouse goes the movie will either go forwards or backwards depending on where the mouse is in relation to the center of the screen.
Also, I have 9 buttons across the top of this. How can I control the movie that when I click each button the movie continues to play up to a specified label. Then if I click another button it will move on to that specified label. All can get it to do is gotoandstop label"first". That just jumps it to the label. I want the movie to play through until it gets to the label and stop. Also, is there any way to make the movie run backwards? Like if I clicked frame label 9, then clicked frame level four that it would play backwards from 9 to 4. Know what I mean?
On Release Play Forward Or Backward To Frame Label
I am trying to create a site that has six different sections. Each section has a background that zooms in and fades into the next image. For example if the user clicked the button for image 3 it would animate through image 1, then 2 and stop on image 3. If the user were to then hit the link for image 1 the animation would play backwards through to the first image passing image 2 along the way. Of course if the user hit image 6 from image 1 it would play through all the transitions in between.
I could do a hack (no actionscript) version of this but it would take 36 seperate animations which seems like overkill. What I need is to be able to play through to specific points in the timeline to my destination. In a perfect world the speed of animation would increase the longer the distance, Say 1 to 6 would play fast, but 1 - 2 would play slow ,but for now just navigating through the timeline would be a great step forward.
if there was something like on (release) {playTo("image3"); }
my life would be easy, but playTo doesn't exist.
This post is for MX 2004:
Need Advice: Moving Forward/backward Thru Sequence Of Images
I'm putting together a product viewer, which will rotate a product for viewing depending on where the user drags their mouse - similar to Quicktime VR, but instead of panning around a scene, the viewer will remain fixed and the product will be rotating as if on a turntable.
The sequence is 72 frames - one frame per 5 degrees of rotation. The animator can provide either a movie or a sequence of still frames. I'm trying to work out the best way to animate it.
My first inclination is to create a 72 frame movie clip with one image per frame, and step through forwards or backwards one frame at a time at different rates depending on where the mouse is positioned. I don't think I can play a video forward and backward from just any old point (e.g if the user stops while looking at the back of the object and then starts spinning it the other way). Seems much more straightforward to be able to just step sequentially through the frames, in either direction, from any point (wrapping around when it gets to the end).
Does that sound like a good approach?
- Bob
Play Moviclip Automatic Forward And Backward In A Loop
hey there =)
ive import a quicktime movie with clouds
http://nbeyond.nb.ohost.de/
everythings fine so far! but it dont looks very nice when the movie jumps back to the first frame after it´s finished
so i want that it plays the movie backward to the first frame and than play again to the finish! on the finish back again and so on
so that it´s always a smooth movement in the sky
plz someone can help me?!
|