ActionScript 3.0 :: Play A Certain Part Of MovieClips Timeline Depending On The Button Pressed
Nov 22, 2010
Right I only want to play a certain part of my MovieClips Timeline depending on the button pressed.
ActionScript Code:
stop();
CircleLineMC.KingsCross.addEventListener(MouseEvent.MOUSE_DOWN, KingsCrossBtn);
function KingsCrossBtn(event:MouseEvent):void {
BigSquare_MC.gotoAndPlay(1);
}
But I want it to play only up to frame 50 and then stop there and then loop instead of playing the whole timeline, does anyone know How to do that.
View 6 Replies
Similar Posts:
May 1, 2003
The first prob I had was when i used the load movie command the swf file was loading in the wrong position, it kept loading down and across the page. I had
PHP Code:
_root.myemp.loadMovie("banner.swf", 0);
I dont know why this is happening but I just fixed this by doing:
_root.myemp._x = 0
_root.myemp._y = 0
The next problem Im having is that I want to change the frame depending on which button was pressed. If button two was pressed I wanted to load "banner.swf" and gotoAndStop("pg2"), If button three is pressed gotoAndStop("pg3")Ive tried some things but cant get this part right such as:
_root.myemp.gotoAndStop("pg2")
"banner.swf".gotoAndPlay
I just dont know the syntax...
View 2 Replies
Jan 31, 2011
I remember in an older version of flash you could put a gotoAndPlay statement in the last frame of a sequence telling it to go back to the first frame in a sequence, but as I understand it you are not supposed to put script into frames anymore. So is there a way to tell a movie clip to play and repeat just part of its timeline (say a walking sequence) and then have it change to a different sequence later (such as jumping)?ed.
View 1 Replies
May 1, 2008
I'm doing my final year uni project (1 week left) and having trouble with some actionscripting and xml.Basically I have all the usual AS coding sorted out for my XML data and it's working fine but what I want to do is replace the xml file with another xml file depending on what button (I have 25 different files/buttons to do) is pressed.
So button 1 will put in: xmlFile.load("button1.xml")Button 2 will replace the above scripting with: xmlFile.load("button2.xml")
Is this possible? I don't want to create 25 instances/frames of the full xml text as the xml datat is displayed on an animation and it would significantly increase the file size.
View 2 Replies
Apr 9, 2009
I am using a template that the buttons have actionscript in them already. I tried replacing "get url" with "gotoAndPlay" a certain frame. I need the button to go to frame 113 after i click on this button.
on (rollOver) {
if (_root.link<>p) {
gotoAndPlay("s1");
[Code].....
View 2 Replies
Jul 28, 2009
I am like a new-born-newbie when it comes to Action Script 3.0 (or any other version for that matter). I've been trying to learn it by myself for the past week and a half using manuals and other sources but it's not so easy as there are many concepts that take some getting used to (I've never done programming before). So I ask of anyone who is kind enough to give me a hint or point me in the right direction. I am sure this will seem like a very easy and probably stupid question for the well-informed but it has been eluding me for the past 4 days.
I am making a website (I should say it's pretty much finished except for this one detail) it's simple and short. Nothing very fancy. There are 8 buttons in total for the main navigation (4 buttons in English and 4 in Chinese, each language group in their own set of frames)
the button that serves as a link to the Chinese translated version of the site is supposed to go to a particular page, depending on which page the user is in at the moment (example: if it is in the portfolio page in English, when clicking on the Chinese button it should go to the portfolio page in Chinese and so on). Likewise with the English button in the Chinese version pages.[code]...
View 4 Replies
Apr 13, 2010
In my "Scene 1" i call a New MovieClip("MC1"), this MC1 have a button named "btn1", I need a code to put in the first frame of the "Scene 1", that check if the button btn1 was pressed in the new movieClip (MC1) How can i check if the button was pressed? This is my code in the first frame of the "Scene 1"
[Code]...
View 3 Replies
Mar 24, 2011
I have a numeric stepper which allows the user to choose as many balls as they want, then they shud press the button and all of those balls should fall down. How can I do this???
View 1 Replies
May 4, 2011
I am learning Flash on CS3 and I have created a scrolling background image which works great. I found a simple play button that works fine using AS2, I use stop(); on frame 1 and on a separate layer and then on the same layer I have a drawn play button on frame 1 I use this
code
on(release) {
root.gotoAndPlay(2);
}
Works good but now the scrolling animation stops after frame 40. How can i get the animation to be continuous after I hit play?
View 2 Replies
Mar 19, 2006
when button is pressed one mc starts to play. when another button is pressed the first button related mc is smoothly played to the end... after that only second pressed button related mc starts to play...
View 6 Replies
Jan 4, 2009
I have a very basic question. I have a custom class called caurina. I've imported the class and it works great. What i did is use that as a function called slide().
What I would like to do is make that function play when a button is pressed. I can't seem to find out how to do this anywhere. I am using as3.
Summary: When btn is pressed go play function slide()
View 6 Replies
May 12, 2011
Soo this is a simple problem, i have a 60 frames movie in a Layer, and another layer with 2 buttons.I want the movie to play foward while one button keeps PRESSED, and to play backward when we keep pressing the other button.i tryed this simple code but it didnt work out.on (press) {nextFrame();}
I used this code in the button that plays foward but it only moves 1 frame. I am realy new a this,
View 6 Replies
Aug 6, 2009
I'd like to create a stopwatch that starts at 00:00 when a play button is pressed, and then stops whenever the stop button is pressed. After the stop button is pressed, I would like the time to be displayed on the next frame, and say something like "You pressed the stop button in x". I'm using flash CS3...so actionscript 2.
View 4 Replies
May 2, 2010
I'd like to create a stopwatch that starts at 00:00 when a play button is pressed, and then stops whenever the stop button is pressed. After the stop button is pressed, I would like the time to be displayed on the next frame, and say something like "You pressed the stop button in x".
View 1 Replies
Jan 17, 2011
I have a button, labeled "Main1," in a scene, "Main." When I click said button, I want an animation to start. Said animation is a movie clip named "ArrowAnim."Now, I have done something similar before in another project, using a code which I thought would have worked with this movie clip as well. The code I used before (and which worked flawlessly) was:
Code:
on(release)
{
[code]......
View 4 Replies
Nov 26, 2010
I have tried everything but it just isn't working.On my main timeline I have a MC called "rainbow." Inside "rainbow" I have a MC called "greenbow."Inside "greenbow" I have a MC called "meetbtn2" I want it to play frame 134 on the main timeline when you click "meetbtn2."my code inside greenbow is as follows:
meetbtn2.onRelease = function () {
_root.gotoAndPlay(134);
};
however it doesn't work! is it because i am inside two MC's?I have also tried
_root.rainbow.greenbow.meetbtn2.onRelease = function () {
_root.gotoAndPlay(134);
};
View 12 Replies
Jul 26, 2009
I have started to make an interactive movie where pushing keys moves a movie clip around the stage! And I can obviously make the movie clip do what I want, so here is the question: I want to make the movie clip change its animation depending on which keys are being pushed i.e. Left key the movie clips moves left, and my stick man changes to a running animation. Push nothing and it changes back to his standing still animation.
View 2 Replies
Mar 25, 2007
I have a circle movieclip that needs to rotate to certain destinations depending on buttons pressed in the navigation. Everything works fine, except when you go from green to cyan and vice versa, it does a full 360 rotation instead of just moving to the destination.
View 13 Replies
Jul 20, 2006
its a gambling game of chance and I want it to go to a random frame which will play a movie when the button "one" or the button "two" is pressed. so on each button, I have the code:
[Code]....
View 7 Replies
Nov 16, 2004
I have a function on root:
_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();[code]....
This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say
on (press){
_root.fade = true;
}
the mc fades in, but I cant do another on (press) to fade out. Is this too confusing?
View 2 Replies
Nov 13, 2010
What I am trying to achieve is have one movie clip containing a button control the timeline of another movie clip.I know how to get a button to control the timeline of it's current movie clip, however, getting a button to control the timeline of a seperatef there is a tutorial that someone knows of, or if someone could post a snippet of AS3 showing how a button controls another clips timeline -Re: Question: AS3 Button controling timeline of movie clip.here is the coding I am using too:
but_shows.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
function onMouseDown(event:MouseEvent):void{
_root.mainContainer.gotoAndStop(2);
[code].....
View 1 Replies
Mar 19, 2012
I'm creating a simple game in Flash and I cannot figure out how to get a button to play 1 of 7 movie clips. Any help would be great.
View 6 Replies
Nov 4, 2009
I have a play/pause button on my animation which works a treat when all animations are within the main movie clip. Now I would like to have some movement within the main movieclip and some within individual sub movie clips. Once I go to play the animation all animated objects within the main movieclip are stopped but the sub movie clips are playing. How can I stop the sub movie clips to???
The following is the current code I have
ActionScript Code:
stop ();
play_btn.onRelease = function(){
gotoAndStop(2);
_parent.play();
[Code] .....
View 5 Replies
Sep 23, 2009
direct me to a simple technote on how to play the timeline with a simple buttonexample:in AS2 you could attached script to button something like
on MouseEvent {
gotoandplay(6);
}
[code].....
View 4 Replies
Aug 30, 2010
I can't get my button to play the parent timeline.. I can get it to alpha out the MC but not play the timeline.. grrr..
ActionScript Code:
import com.greensock.*;
import com.greensock.plugins.*;
TweenPlugin.activate([FramePlugin]);
[code]....
View 0 Replies
Sep 23, 2009
how to play the timeline with a simple button
example:
in AS2 you could attached script to button something like
on MouseEvent {
gotoandplay(6);
}
thats all I am trying to do, but in AS3 how do I simply get a button when clicked to go to a frame and play.
View 1 Replies
Feb 19, 2010
how to play the timeline with a simple button
example:
in AS2 you could attached script to button something like
on MouseEvent {
gotoandplay(6);
}
thats all I am trying to do, but in AS3 how do I simply get a button when clicked to go to a frame and play.
View 3 Replies
Aug 12, 2010
I'm creating a website by splitting up the main timeline into the different pages of the site. I'm trying to make a dropdown menu on the 3rd frame. On a layer called buttons I have a button with the instance name patientnumberbtn. I want that when you roll over this button is tells the menu to drop. The movie clip for the menu is nested on its own layer of the main timeline. I would like to play this nested timeline, (the drop down menu has masks and other animations that are moving around). This movieclip that everything is nested in has an instance name of patientnumbermenu. Here is what I am using for code.
patientnumberbtn.addEventListener(MouseEvent.MOUSE _OVER,patientnumber_over);
function patientnumber_over(event:MouseEvent):void
{
patientnumbermenu.play();
}
When I run it there is an output error #1009 but it still lets me proceed. When I roll over patientnumberbtn, nothing happens. Within the patientnumbermenu I have stop commands to prevent it from playing when we first reach frame 3 of the main timeline. I've removed these commands and the patientnumbermenu will play even though the commands used to get to frame 3 is a gotoAndStop(); command.
View 0 Replies
Apr 9, 2009
I am using Flash CS3 and ActionScript 2.0. I have a flash timeline that shows 4 tabs and cycles through them. There is also a play/pause button. My issue is that when you click one of the tabs, you start the timeline up again, but the play/pause button doesn't reset. I have the full Flash file, as well, if needed. [URL]
Attachments: TabbedFlash10.swf (52.7 K)
View 6 Replies
Oct 25, 2005
I download a tutorial to make a digital clock now what I want to do is make my movieclips go to a different frame depending of the hour. I want to make that effect of day/night.
View 6 Replies