Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[F8] Advancing To The Next Frame



I have a stop action and a MC on my main time line.

what script can I attach to my MC so that the main time line stops till the MC finishes 1 cycle of it's animation, then the main time line advances to the next frame and plays?

Thanks



FlashKit > Flash Help > Flash ActionScript
Posted on: 11-03-2006, 06:16 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Advancing To Next Frame
i have a small presentation that i want to present in flash. I want to take 8 photos and allow the user to advance to the next photo in the next frame buy using buttons. I have no syntex error, so i must be doing something wrong cause it will not work in test.///I don't want to throw the entire computer out of the window in fustration - so in order not to see computercide please send any help u can. On the action button i am using the code:
on (rollOver) {
_root.move.prevFrame();
}
on (rollOut) {
_root.move.stop();
}


Sigh

Advancing To Frame Labels
Ok all you flash Gurus out there. I need help with ActionScript in MX. Now I am a flash "Designer" not a "scripter" so please bare with me.

I basically have a slide presentation. It is a self running presentation with graphics and sound. It needs to have previous and next buttons on it. The problem is how do you get the buttons to go to the next (or previous) frame label. I tried making an array but it goes to the first slide in my array. How do you capture the current position of the timeline and make it jump to the next (or previous) frame label.

Now i know the hard way of doing it. Make a button for each slide. But I have over 70 slides. There has to be a better way in actionScript.

Not Advancing To Next Frame. Cause=Movieclip?
I have a movie clip. It plays and stops, all nicely. Then the whole flash stops. Is it becuase of the moveclip? How do I get the movie clip to stop and stay on the screen, but still advance to the next frame, where I have a different layer doing stuff? Thanks. If this is a confusing question, tell me, and I'll try to rephrase it.

Smaug, the dragon

GotoAndPlay Advancing One Frame Too Many
I'm sorry if the solution to this problem is more obvious than I think, but this is for a project that's due quite soon, so I haven't researched it very much.

Basically, I'm making a menu system for this presentation. Just dealing with one level of the heirarchy, I have scenes for each chapter -- "menu10", "menu11", "menu12", et cetera. Each frame has an identical menu consisting of buttons for each scene. Each button has a gotoAndPlay action that directs the playhead to the respective menu scene. So on release, the button marked 11 executes a gotoAndPlay("menu11", 1); action. But instead of going to menu11, it goes to the next scene, menu12, and then stops. Every combination of inserting extra frames, stop actions, changing to gotoAndStop, etc, has not fixed the problem. It seems inconsistent -- sometimes it screws up one way, sometimes another, sometimes not at all -- but most of the time it's not working properly. Is there something I'm missing that would fix this obvious problem?

Advancing To Next Frame After Animation
I currently have this code that moves an object across the stage with easing:

var easing:Number = 0.2;
var targetX:Number = 245;
var targetY:Number = 200;

onEnterFrame = function () {

var vx:Number = (targetX - box._x) * easing;
var vy:Number = (targetY - box._y) * easing;
box._x += vx;
box._y += vy;
};


After the instance "box" reaches 245x,200y how can I get the movie to advance to the next frame? Having problems with this one.

here's the FLA:

http://josephryannasipak.com/script_ani.fla

and SWF:

http://josephryannasipak.com/script_ani.html

Preloader Not Advancing To Frame 2...
I have a preloader in frame 1 and my mc on frame 2 of the main timeline. After the preloader is finished, all I see is background, but if I click on a link or reload the page, I can see the animation in frame 2 start immediately.

This is the AS on my preloader itself:

onClipEvent (enterFrame) {
framesLoaded = (Math.ceil (( _parent.getBytesLoaded() / _parent.getBytesTotal()) * 100));
gotoAndStop (framesLoaded);
info.text = framesLoaded + "% completed";
if (framesLoaded >= 90) {
_root.gotoAndPlay (2);
}
}


This has been driving me crazy, and I can't figure out what the problem is!

Any ideas?

thanks!

Problem Advancing Frame
I am trying to get this movie clip to scale when someone rolls over it, then if you click on it, its supposed to move to the center of the screen and scales even bigger. If you rollout it scales down. When I run the movie it seems to be stuck on the rollover/rollout. What am I doing wrong?

thanks,
Sam

Advancing Through Frame Labels On Loaded Swf
on (press) {

count++;

theSample = this["sample"]+count;

_root.folioMovie.gotoAndStop(theSample);

}



Trying to advance through frame labels on a loaded swf file with a forward button on the main time line. The swf file was is loaded into a movie with the instance name of folioMovie. The frame labels on the loaded swf file are sample1, sample2, etc.

Don't know why the script above doesn't work to go from frame label to frame label. Probably an easy fix. Any help?

Problem Advancing To Next 'parent' Frame
Hi all.

I have a frustrating problem. I have a flash file that on click loads movie. This secondary movie opens without a problem...until the end. What I want to happen is once you get to the end frame of the 2nd movie, it advances the 1st file to the next frame.

I created a button which when placed on the last frame with the following code:

Code:
on (release) {

_parent.nextFrame();

}

and clicked, does exactly what I want and advances the original file to the next frame.

Rather than a button, I would prefer the advance to occur when you enter the last frame. Placing the following code:

Code:
_parent.nextFrame();

does not work.

Probably a simple thing, but what am I doing wrong??

Thanks guys...chaddy

Preloader Advancing To Frame To Quickly
I have 5 scenes in my fla so far. When I load my preloader the dynamic text shows the percentage and when it gets to about 60% (which is when the home scene is finished loading) it advances to the home page while still loading the following scenes. I need to figure out how to get it to load all scenes before advancing to my home page. Thanks in advance for the advice.

Advancing To Next Frame After Movie Clip Plays
I have a movie clip that plays on frame one, which has the as of stop();
In the movie clip, I want it to return to the second frame of the main timeline after the clip is finished playing. Is there a way to do this?
thanks,
Brian W

Advancing To Next Frame From An Imported Text File
I have set up a portfolio movie that imports all text and a graphic from a text file. This gives me the ability to update the portfolio on a routine basis. The movie imports the text file perfectly.

My dilemna is one of the frames has several pictures and adjoining descriptions. All this data will not fit within the predefined text field. I don't want to have to load a seperate movie into the text field in order to scroll through the remaining pictures.

I would prefer to view the next pic by using some type of a link to move to the next frame. This would give me the ability to add or delete pictures and their descriptions without have a scrollbar component visible afterwords. If I want to delete a pic and its descripton I would remove the link to the next frame and no one would be the wiser.

So, I am trying to figure out how to advance the movie to the next frame from inside the text file. Is this possible?

[CS3] Problem Advancing Frame After Nest Mc Complete.
A couple of problems with finding the right script to advance to another frame in the main timeline after a nested mc completes. The main timeline consists of an action layer and a graphic layer that is 1 frame long -- within which are several layers of various mc's that animate. I've created the script to start the nested mc's and it works fine. Interestingly though, when I change the main graphic to an mc, then all the nested mc's play endlessly over and over again. hmm.

well anyway, what i'd like to see happen is once menu_mc (nested within the main graphic) is triggered and plays... create a goToAndStop command to the next frame on the parent timeline. Thanks much for any thoughts for this very newbious newbie!


so, here is the as3:


function onMouse_Over(event:MouseEvent):void
{
cat_mc.play();
}
cat_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouse_Over);

function onMouse_Out(event:MouseEvent):void
{
cat_mc.stop();
}
cat_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouse_Out);

function onClick(event:MouseEvent):void
{
pictureframe_mc.play();
menu_mc.play();
cateyes_mc.play();
}
cat_mc.addEventListener(MouseEvent.CLICK, onClick);
cat_mc.buttonMode = true

Contact Form Not Advancing To Correct Frame
Hi

So as the title suggests, I have a contact form that IS currently working. Users are able to access the contact form and I AM able to get their emails. The problem is that the contact form never advances to the "correct" frame; where the message appears thank you for sending your message. So the user thinks that message hasn't gone through and they continue to hit the send button 100 times thus filling up my inbox with the same email. Can anybody let me know how to fix this. Is there something on the server side I need to set up? I have PHP installed on the server.. please help

Flash 8 Movie Advancing To Next Frame With No Action...
On different frames I have a stop() action and text fields where users can fill in fields. For some reason the movie will just go to the next frame, sometimes without any interaction from the user. Sometimes it is when clicking into a field. It happens randomly and I can't figure out if it is some bug in my script somewhere or if it is some fundamental flash knowledge that I am missing.

Can anyone point me in the right direction?

Thanks

Wick

Shared Object - Not Advancing To Correct Frame
here is a problem I have been fighting on and off for a while and never found an answer for. I have tried using this for about 3 different projects over the past year, and never gotten a satisfactory result. These are basically for using a flash header type navigation with a lead-in animation. I am using SharedObject to tell whether or not a user has seen the intro animation. Simple enough eh? Then I am using an "if" statement to advance it to a specific frame. This works 100% of the time in the authoring environment.

However, it does not work on the web. If I use a frame label, it does not advance. I can run a trace on it, and it will report the correct frame label, but it will not advance. If I use a frame number it will advance to somewhere around "frame number/2" and stop there.

Has anyone else encountered this problem?

here's a clip of my code, myCookie_so.data.intro is set to "done" later in the movie, and myCookie_so.data.frame is set to "intro_done". this traces everything correctly in the authoring environment:

Code:
var myCookie_so:SharedObject = SharedObject.getLocal("myCookie_so_cookie", "/");
//

doCookie = function(){
if (myCookie_so.data.intro == "done") {
gotoAndStop(myCookie_so.data.frame);

trace(myCookie_so.data.intro);
trace(myCookie_so.data.frame);
trace("doCookie if");
}
else{
myCookie_so.data.intro = "begun";
myCookie_so.data.frame = "intro_begin";
trace("doCookie else");

}
}

doCookie();

[MX04] Movie Clip Not Advancing To Desired Frame
I was wondering if anyone could help me with this tutorial. I didn't see an author attached to it anymore and it appears to be a few years old http://www.flashkit.com/tutorials/In...-596/index.php .

In the code for the button, it says you should be able to change the frame it goes to when you click the button based on the number in "x = Number(x) + 1" I have tried several different frame numbers but it keeps going back to frame 1 no matter what. Any idea why?

on (release) {
duplicateMovieClip("/window", "/window" add x, x);
x = Number(x)+1;
}

I realize I'm using MX2004 and this code is old but I can't seem to find a better tutorial. For my application I'm going to have two rows of navigational buttons. I need to have the ability to have two windows open at once (one window from each row of buttons) and make them draggable. If anyone knows of a good tutorial please let me know.

Thank you!

Advancing From Frame Label To Frame Label Using Time Variables
I need to understand how i can advance from a frame labeled "menu" to another frame labeled "submenu", using seconds.

For example, "menu" is on frame# 1 and "submenu" is on frame# 20. I want a 15 second interval between each frame label without making it really big in frames.

I want to make my demo to be simple to edit if I have to give people a longer time to view each slide.

Advancing
i have this game and when u shoot sumthing the score goes up. i want the level/sceane to change when the score is high enuf. i dont know how to do this

Mp3 Advancing...
I’m just toying around making an mp3 player and came to a problem. I’ve got everything to work just fine... but I don't know how to get the player to recognize that the current track is finished and get it to get the next track... how can this be done? thanks for any help!

Mp3 Advancing...
I’m just toying around making an mp3 player and came to a problem. I’ve got everything to work just fine... but I don't know how to get the player to recognize that the current track is finished and get it to get the next track... how can this be done? thanks for any help!

Preloader Not Advancing
After loading to 100% it hangs. It is used inside external .swf files which are called into the main movie. Any suggestions helpful.
Thanks
MTD

onClipEvent (enterFrame) {
framesLoaded = (Math.ceil (( _parent.getBytesLoaded() / _parent.getBytesTotal()) * 100));
gotoAndStop (framesLoaded);
info.text = framesLoaded + "% completed";
if (framesLoaded >= 100) {
_parent.gotoAndPlay("solf2");
}
}

Advancing Issue
I have an opening page to a site that plays a movie and then at the end of the movie gives two buttons. One to re-play the movie and one to enter the site. But after the movie plays it advances to the "enter the site" link. How can I get the movie to be idle until the user clicks one of the choices?

Tom

Button Advancing
I have a menu button on stage that I would like to advance to the next frame in a movie clip every time it is pressed

on (press){
movie.gotoAndPlay(nextFrame);
}

but this is not working and I am not sure how to get it to do this. I want it to advance to the next frame every time that the button is clicked. and then when it gets to the last frame to go back to the first frame.

ListBox Advancing To Next?
I have a listbox when I selected an item on it, it selects a MP3. works good!
what I'm trying to do is somehow advance to the next selectedItem programmically!

how would one write this?
my listbox is name
Code:

control.lb

thanks!

Advancing Scenes From Within Movieclips :(
Hi...

I'm trying what ought to be simple...

I have a movieclip in the first frame of a movie. It includes a timer which, when reaching zero, does a number of things, like change a variable in another movie clip. I'm trying to get it to also make the main movie to advance to its next scene, but nothing's happening ??

Here's the code in the movieclip:

onClipEvent (load) {
startTime = 60000;
}
onClipEvent (enterFrame) {
myTime = getTimer();
showTime = Math.round((startTime-myTime)/1000);
}
onClipEvent (enterFrame) {
if (showTime<15) {
scoreMessage = "Hurry Up !";
}
}
onClipEvent (enterFrame) {
if (showTime<0) {
showTime = 0;
scoreMessage = "Time's Up !";
setProperty (_root.player, _visible, false);
gotoAndPlay ("Scene 2", 1);
}
}


All of this works fine, except:

gotoAndPlay ("Scene 2", 1);

Any ideas how to get this to work? Is it trying to advance to a non-existent second scene in the movie clip...and if so, why doesn't changin it to:

gotoAndPlay (_root."Scene 2", 1);

solve this?

or am I being very stupid

Any help much appreciated !!

Pete

Duplicate Mc, Advancing _x Each Time
I'm trying to get a duplicate mc to create each duplicate 7.5 pixels to the right from the previous...I've got:

duplicateMovieClip ("line", "line" add Count, Number(Count)+1);
setProperty ("line" add Count, _x, Number(("line" add Count)._x + 7.5));

but it just runs in the same place as the 1st duplicate. I don't think I have the script right in the value for _x...any help?

Thanks!

Advancing Main Timeline With A MC
I have created movie clips on my main timeline and I'm using them as animated buttons. I am able to advance their timelines as a rollOver

onClipEvent (load) {
this.onRollOver = function() {
gotoAndPlay(2);
this.onRollOut = function() {
gotoAndStop(20);
};
};
}

Advancing To A Scene Using LoadMovie
I am trying to find out if there is a way to advance to a scene in a movie when using loadMovie.

example:

in the first movie you can click a button that will load the second movie (this works fine). what i need to happen from the second movie is this: when you click on either button1, button2, or button3, you will revert back to the first movie but be looking at the button1 scene, or button2 scene, or button3 scene.

any help is appreciated,

jasonc

Advancing/reversing MC On Mouse Over
Hi all got a question. I have a 4 sided cube I made in swift3d. I have 5 button on the main stage. The first button has rollover code on it to flip the cube to the next side. so the code is:

on (rollOver) {
this.cube.gotoAndPlay("5");
}

the rest of the buttons have code to move the playhead in this.cube to frame 8, frame 15 and frame 23. this works fine as long as you roll over the button in order. But if you start with the last button in order it just flips and the animation of the cube playing does not work. I was wondering if I could detect where the playhead was(current state) and just advance it so it would just detect if the playhead was on frame 8 and just move it forward and not try to flip to say frame 23 to do the hard coded animation. I hope I was clear enough. Thanks for all your help.

Newbee / Advancing AS Question.
Hi there

My site has 3 pages - home, biography, videos.

Each page has an animated intro and outro. I need my nav bar to know which button has been pressed so it can play the current pages outro before jumping to the correct pages intro. I have been experimenting with setting up a global variable and using if statements to achieve this. I am new to both these as techniques.

in the first frame of my movie I tried setting up the variable


Code:
_global.whichPage=1;
//home=1
//biog=2
//video=3
on my nav bar buttons (this example is biography) I have this code


Code:
on (release) {
gotoAndPlay("home outro");
_global.whichPage=2;
}
then on the last frame of the home outro I have


Code:
if (_global.whichpage=2) {
gotoAndPlay("biography");
}

else if (_global.whichpage=3){
gotoAndPlay("video");
}
Is this something close or absolute nonsense?!

Any advice as to where I am going wrong would be great.

Cheers...

Will

Auto-advancing Playlist
After following this excellent tutorial I was able to create a pretty decent .flv playlist. And, using this info get the videos to play sequentially. However, the highlight bar of the list component doesn't update when the next item plays. i.e. The currently playing video will be highlighted on the list component. When the video finishes, it plays the next video on the list, but the highlight bar remains on the previous item.

Anyone know how to fix this...?

Advancing/Backtracking In Flash
Hey all, I know this may sound like a simple fix, but I just can't seem to get it working. I currently have a photo slide show that has an empty movie clip controlling its advancing/backtracking functions, much like a glorified PowerPoint. Basically I need to have the buttons do the walking/advancing/backtrack through the slide show. As is, the buttons usually advance too much, because the function calls for an isDown call out.

Here is the mc code:
onClipEvent (mouseUp) {
_root.jungle_movie.nextFrame();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) || Key.isDown(Key.UP) || Key.isDown(Key.ENTER) || Key.isDown(Key.RIGHT)) {
_root.jungle_movie.nextFrame();
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.BACKSPACE) || Key.isDown(Key.DOWN) || Key.isDown(Key.LEFT)) {
_root.jungle_movie.prevFrame();
}
}


The movie clip is call Jungle_movie, and pressing right mouse, or SPACE, UP, ENTER and RIGHT advances, where as BACKSPACE, DOWN, LEFT make the slide show go back a frame. Is there a way to do this without the slide show advancing to many frames. Like using an onRelease method of AS?

Thanks for any help,
Jonathan

Advancing A Powerpoint Slide
Having touble advancing to the next slide after a swf has finished playing. Down arrow and next page do not work consistently. Using a PC with Office 2000 and am teaching an unsophisticated client. Any advice besides adding a macro or an invisible button in PPT?

Flash Powerpoint Advancing
I’ve inserted a flash movie into a PowerPoint presentation and it works! The movie is a looping movie that introduces the speaker and the class subject. It’s way sweet! Once the class starts I would like to advance to the next slide or another movie by a mouse click. How can that be done or can it?

RC
FYI
I did post this on the office forum with nmo response.


AS2 - Advancing Movie To NextFrame()
Last edited by uxk8396 : 2008-07-08 at 09:54.
























Hi
Any idea how to removeMovieClip in frame 2 that is brought from the library by attachMovie Method in the previous frame.
I tried the following in the frame 2 but did not work:


HTML Code:
this.onEnterFrame=function(){
removeMovieClip("mcWord")
}

And also

HTML Code:
this.onEnterFrame=function(){
mcWord.removeMovieClip
}
Is there an effective way to do that?
Thanks

Advancing In Timeline Using Input Text Box
I need the ability to advance in my flash file by having the user type into a input text field. The user will be typing a random number so the input isn't always the same. I just need the flash file to see that the field was clicked in and advance the timeline.

I tried making the input text box a button and setting the advance basd on that but it didn't work.

Any ideas?

How Do I Make Forward Advancing Style Nav
i am looking to create a photo album very similar to the cerebrus part of the x-men2 site. if need link i will find it. it's like the sofake site, sort of zooming in nav, but i want to enable the viewer to look around at randomly placed thumbs that can be zoomed in to full size if chosen. thank you very much,




ps.this site/community kicks ass! thanx 4 bein here and doin what u do!

Button Action Not Advancing Timeline
I have a button embedded into a menu (movie clip object) which is also embeded into a mc which is accessed through the click of a button on the main timeline. I want the embedded button to move the timeline to frame 93 when it is clicked but it is not working. I have used the following actionscript attached to the embedded button object:

on (release) {
gotoAndPlay ("Scene 1", 93);
}


seems pretty basic. I am wondering if I need more actionscript to tell it where to look for "Scene 1" since the button is so many levels deep.

Any help would be greatly appreciated. Thanks

Best Flash Book For Advancing My Skills
I have been working with flash mx for about 6 months now, i have grasped all of the basics, know how to use all the tools, can use basic actionscript, understand shape and motion tweening etc. What i want to do now is take my skills to the next level and start looking at making 100% flash sites and more complex animations. i have got a few books in .pdf format but they are often too basic or assume too much knowledge. can someone recommend what the best book is to continue my learning.

Thanks for your time.

Media Player - Tracks Not Advancing....
Hi. I'm trying to make a media player, and (thanks to the help of these forums) I'm almost there. My hangup right now is that I can't get it so that when one song ends, the next song will start up....

The track NAME updates to the next song, but the song never plays. I can't find anything wrong with my code, so I've attached my .FLA if any of you think you can help out (the code for the "onSoundComplete" action that isn't working properly is attached to the Loader Bar movie clip in my .FLA)....

To see what's actually going wrong live online, I have the .swf at http://www.hoffmancreations.com/streamer.swf - unfortunately, you'll have to wait through an entire song to see what the problem is (since the problem I'm having is the player not advancing automatically when a song is over).

Also, only the first 3 songs are actually on the server right now, so you can really only play around with the first 3 tracks. For testing purposes, the 2nd track is very short (under 2-minutes), so that's probably the one you'll want to sit through to see what's wrong. Any help would be greatly appreciated - thanks!...

Waiting For One MC To Finish Before Advancing Playhead?
I'm making an animated logo and breaking up the major sections into MCs. How do I make the playhead pause at a frame while the MC plays out and then advance to the next frame, pause again, etc.?

Attached is a work in progress to let you get the feel of the project. The faded logo in the back will not be in the final product. Its just for layout purposes.

Advancing A Count While Holding A Button
ok, so i did a search for this, and while i found a few topics, everything was atleast a year old, so i'm not sure how topical they are to MX, and i understand the explanations from the wise better when applied to my application spacifically anyways.

But what i want to do, is within my application, there are some values that for various reasons, they can only advance by 1 step at a time, but would involve going to max of 50 or even hundreds of clicks, so it has been requested by my users, for a click and hold while counting function. As it seems, I did what many of my predecessors have, and tried using the on(press) value for the button, and to no surprise (to you) it didn't work. So i tried using a for statement with the aforementioned press value, which looks like this

Code:
on(press) {
for(ss;ss<ms;ss+1){
if(ss<ms){
set("ss", (ss+1)), set("dp",(dp+2))}
else{
set("ss",ms)}
}
}
Which doesn't work either(it goes automattically to the value of "ms" which is the maximum speed available to give a point of reference. SS is the starting/current speed.

So, any help, preferably that doesn't involve into making the button an Mc (as i'm struggling with those at the moment) would, as always, be greatly appreciated.

Advancing Frames Once All Buttons Are Clicked
Hi all,

This may be an easy question, but despite searching the web I can't find a solution. I think it might have to do with setting up variables, but I haven't done this before.

What I am trying to do is have a page with a number of buttons (8 in total). After the last one is clicked, I then want flash to advance to the next frame (or nominated frame). I can easily set it up when the buttons need to be clicked in some kind of order, but when they can be randomly clicked, my flash knowledge lets me down!

Any help is appreciated!

[F8] Advancing From A Tutorial RE: Image Panning
Hey again, i've recently completed a simple tutorial from a website, which involves panning an image from left to right. The image has to be bigger then the workspace. But i was wondering how difficult or easy it is to pan the image up and down as well. (It's probably easier to contact the person that created the tutorial but ive forgotten the site) Here's the code from the tutorial :


Code:
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip,
speed:Number, dir:Number) {
var mousePercent:Number = _xmouse/Stage.width;
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destX = Math.round(-((target._width-
Stage.width)*mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
};
}
Is it just a question of adding a few lines of code using something like "var mousePercent:Number = _xmouse/Stage.height;" and then a few other lines using the y axis?
If anyone has any idea's it would be super

[F8] Buttons Advancing The Playhead Problem
seems like this would be a simple fix, but, I have built a file that programatically generates a number of buttons. The buttons have an onRelease Function that extracts a string turns it into a number, and then gets a frame label from an array,
in the onrelease function I have a gotoAndPlay telling it to play a certain label in another MC.

this all works fine, unless you know a more streamlined way of building the file,

THE PROBLEM
if you click the same button 2 times it advances the play head forward to the next area of content, so if I click the button once and it goes to orange. then if I click again the same button andd blue comes after orange it will go to blue, then when I click the next button in order, it goes to the next label after blue, it does the same thing even if I tell it to go to frames instead of frame labels.

can anyone help,

I have uploaded my file,
thanks so much to anyone who can help!!

How To Stop .mc Button From Advancing Timeline
When I click on the menu button it take you to the right page. If you click on it again it will again take to another page not associated with it, which happens to be the next frame on the timeline. If there is no stop act the the fla loops.

On the main timeline. I have 3 pages on three frames labeled G1 G2 & G3

On the layer right above those frames I have MenuClip.MC.

It contains the animation etc. of the three menu buttons. For instance when you mouse over the middle button it bounces over the part of the 1st and 3rd.

When you open up the MenuClip.MC
you have four layers, with something occupying the first frame only.

as
left button
Middle button
Right button

The AS3 code that is in the first layer is as follows

// Import the Tweener Class for tweens
import caurina.transitions.*;

// Set the hit area of the left button to buttonMode and add listeners to it
leftbutton.hit.buttonMode = true;
leftbutton.hit.addEventListener(MouseEvent.ROLL_OV ER, leftOver);
leftbutton.hit.addEventListener(MouseEvent.ROLL_OU T, leftOut);

// Rollover function for the left button, adding neccessary tweens
function leftOver(event:MouseEvent):void {
// Left button tweens...
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-25, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:255, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-60, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollout function for the left button, adding neccessary tweens
function leftOut(event:MouseEvent):void {
// Left button tweens...
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:180, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

// Set the hit area of the middle button to buttonMode and add listeners to it
middlebutton.hit.buttonMode = true;
middlebutton.hit.addEventListener(MouseEvent.ROLL_ OVER, middleOver);
middlebutton.hit.addEventListener(MouseEvent.ROLL_ OUT, middleOut);

// Rollover function for the midde button, adding neccessary tweens
function middleOver(event:MouseEvent):void {
// Middle button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-100, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-60, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollut function for the midde button, adding neccessary tweens
function middleOut(event:MouseEvent):void {
// Middle button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

// Set the hit area of the right button to buttonMode and add listeners to it
rightbutton.hit.buttonMode = true;
rightbutton.hit.addEventListener(MouseEvent.ROLL_O VER, rightOver);
rightbutton.hit.addEventListener(MouseEvent.ROLL_O UT, rightOut);

// Rollover function for the right button, adding neccessary tweens
function rightOver(event:MouseEvent):void {
// Right button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-210, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-25, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:105, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollout function for the right button, adding neccessary tweens
function rightOut(event:MouseEvent):void {
// Right button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:180, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

//My Tampering //

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.ProgressEvent;

// assign menu button fuctions to mouse action like hovering over and clicking //
leftbutton.addEventListener(MouseEvent.CLICK,gohom e); // takes you to the golf homapage g1 frame //
leftbutton.addEventListener(MouseEvent.MOUSE_OVER, oversound); // sound for mouse over menu button function //
leftbutton.addEventListener(MouseEvent.CLICK,click ersound); // sound for clicking of menu button function //

Middlebutton.addEventListener(MouseEvent.CLICK,gos kins);// takes you to the golf homapage g2 frame //
middlebutton.addEventListener(MouseEvent.MOUSE_OVE R,oversound); // sound for mouse over menu button function //
middlebutton.addEventListener(MouseEvent.CLICK,cli ckersound); // sound for clicking of menu button function //

rightbutton.addEventListener(MouseEvent.CLICK,goye llow); // takes you to the golf homapage g3 frame //
rightbutton.addEventListener(MouseEvent.MOUSE_OVER ,oversound); // sound for mouse over menu button function //
rightbutton.addEventListener(MouseEvent.CLICK,clic kersound); // sound for clicking of menu button function //

// defining the sound functions //
function clickersound (event:MouseEvent){
var mySound:Sound = new s164(); // this is the class name "Gbreak" load the wave file to the library.//
//under linkage class use this name, and check boxes for export to AS, and for export to 1st frame//
var soundChannel:SoundChannel = mySound.play();
}

function oversound (event:MouseEvent){
var mySound:Sound = new s161();
var soundChannel:SoundChannel = mySound.play();
}


// defining the functions that take you to another page //
function gohome(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g1");
}

function goskins(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g2");
}

function goyellow(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g3");
}

How To Stop .mc Button From Advancing Timeline
--------------------------------------------------------------------------------

When I click on the menu button it take you to the right page. If you click on it again it will again take to another page not associated with it, which happens to be the next frame on the timeline. If there is no stop act the the fla loops.

On the main timeline. I have 3 pages on three frames labeled G1 G2 & G3

On the layer right above those frames I have MenuClip.MC.

It contains the animation etc. of the three menu buttons. For instance when you mouse over the middle button it bounces over the part of the 1st and 3rd.

When you open up the MenuClip.MC
you have four layers, with something occupying the first frame only.

as
left button
Middle button
Right button

The AS3 code that is in the first layer is as follows

// Import the Tweener Class for tweens
import caurina.transitions.*;

// Set the hit area of the left button to buttonMode and add listeners to it
leftbutton.hit.buttonMode = true;
leftbutton.hit.addEventListener(MouseEvent.ROLL_OV ER, leftOver);
leftbutton.hit.addEventListener(MouseEvent.ROLL_OU T, leftOut);

// Rollover function for the left button, adding neccessary tweens
function leftOver(event:MouseEvent):void {
// Left button tweens...
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-25, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:255, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-60, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollout function for the left button, adding neccessary tweens
function leftOut(event:MouseEvent):void {
// Left button tweens...
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:180, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

// Set the hit area of the middle button to buttonMode and add listeners to it
middlebutton.hit.buttonMode = true;
middlebutton.hit.addEventListener(MouseEvent.ROLL_ OVER, middleOver);
middlebutton.hit.addEventListener(MouseEvent.ROLL_ OUT, middleOut);

// Rollover function for the midde button, adding neccessary tweens
function middleOver(event:MouseEvent):void {
// Middle button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-100, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-60, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollut function for the midde button, adding neccessary tweens
function middleOut(event:MouseEvent):void {
// Middle button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Right button tweens...
Tweener.addTween(rightbutton.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(rightbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(rightbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(rightbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

// Set the hit area of the right button to buttonMode and add listeners to it
rightbutton.hit.buttonMode = true;
rightbutton.hit.addEventListener(MouseEvent.ROLL_O VER, rightOver);
rightbutton.hit.addEventListener(MouseEvent.ROLL_O UT, rightOut);

// Rollover function for the right button, adding neccessary tweens
function rightOver(event:MouseEvent):void {
// Right button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-210, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:210, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:220, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:200, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-25, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:105, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:60, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:70, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:50, time:0.5});
}

// Rollout function for the right button, adding neccessary tweens
function rightOut(event:MouseEvent):void {
// Right button tweens...
Tweener.addTween(event.target.parent.cont, {transition:"easeoutelastic", x:-110, time:0.5});
Tweener.addTween(event.target.parent.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(event.target, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(event.target.parent.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Left button tweens...
Tweener.addTween(leftbutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(leftbutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(leftbutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
// Middle button tweens...
Tweener.addTween(middlebutton.cont, {transition:"easeoutelastic", x:-50, time:0.5});
Tweener.addTween(middlebutton, {transition:"easeoutelastic", x:180, time:0.5});
Tweener.addTween(middlebutton.bg, {transition:"easeoutelastic", width:110, time:0.5});
Tweener.addTween(middlebutton.hit, {transition:"easeoutelastic", width:120, time:0.5});
Tweener.addTween(middlebutton.masker, {transition:"easeoutelastic", width:100, time:0.5});
}

//My Tampering //

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.ProgressEvent;

// assign menu button fuctions to mouse action like hovering over and clicking //
leftbutton.addEventListener(MouseEvent.CLICK,gohom e); // takes you to the golf homapage g1 frame //
leftbutton.addEventListener(MouseEvent.MOUSE_OVER, oversound); // sound for mouse over menu button function //
leftbutton.addEventListener(MouseEvent.CLICK,click ersound); // sound for clicking of menu button function //

Middlebutton.addEventListener(MouseEvent.CLICK,gos kins);// takes you to the golf homapage g2 frame //
middlebutton.addEventListener(MouseEvent.MOUSE_OVE R,oversound); // sound for mouse over menu button function //
middlebutton.addEventListener(MouseEvent.CLICK,cli ckersound); // sound for clicking of menu button function //

rightbutton.addEventListener(MouseEvent.CLICK,goye llow); // takes you to the golf homapage g3 frame //
rightbutton.addEventListener(MouseEvent.MOUSE_OVER ,oversound); // sound for mouse over menu button function //
rightbutton.addEventListener(MouseEvent.CLICK,clic kersound); // sound for clicking of menu button function //

// defining the sound functions //
function clickersound (event:MouseEvent){
var mySound:Sound = new s164(); // this is the class name "Gbreak" load the wave file to the library.//
//under linkage class use this name, and check boxes for export to AS, and for export to 1st frame//
var soundChannel:SoundChannel = mySound.play();
}

function oversound (event:MouseEvent){
var mySound:Sound = new s161();
var soundChannel:SoundChannel = mySound.play();
}


// defining the functions that take you to another page //
function gohome(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g1");
}

function goskins(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g2");
}

function goyellow(e:MouseEvent):void
{
MovieClip(parent).gotoAndPlay("g3");
}

Advancing A Movie Clip Via Drag
How would I go about advancing a movie clip's time line via a drag action on the movie clip itself? Where I could grab on the clip and advance it by moving it left or right. Any ideas on this? I am willing to pay someone to provide a solution as well.

-mx

Copyright © 2005-08 www.BigResource.com, All rights reserved