ActionScript 1/2 :: HitTest GoToAndPlay(2) - Play The Movie
Sep 26, 2010
when my character hits a certain object, I want it to play the movie. BUT since the hitTest is techincally always true if my character is just sitting on the object the entire time, it continuosly player frame #2. What is the simple fix for this? The code that will just play movie clip ONE TIME, and not restart continuosuly?
View 1 Replies
Similar Posts:
Dec 17, 2009
I have buttons that i've created to play a movie clip.My movie has labels for different parts of the movie.
on_btn.addEventListener(MouseEvent.CLICK, turnOnTv);
function turnOnTv(event:MouseEvent):void{ gotoAndPlay (20);}
Do I have to put the name of the movie clip that should play?
View 2 Replies
Nov 9, 2007
For some reason i'm having problems swapping scenes in my flash movie. At first i put the action in a "actions" named layer and a link to a button. So basicly when scene1 loads the frame 1 action is "stop ();". The viewer clicks on button1 which has a code of;
[Code]...
View 1 Replies
Nov 23, 2009
is there anyway to have a button play frames 5-10 on a movie clip inside the current frame, as well as skipping to...lets say...frame 10 of the scene?
i want to create a site where buttons go to different pages, but those pages have animations in and out.so if someone is in one page, and clicks a button to go to another, that page plays the "out" animation while the other page plays the "in" animation.
View 1 Replies
Sep 8, 2010
I'm trying to make it so that when a movieclip (box) touches another movieclip (exit), it goes to frame 2.I've made it so that (box) moves with the arrow keys and doesn't go pat the barriers (boulders) using this:
x.onEnterFrame = function()
if (Key.isDown(Key.RIGHT)) {box._x += 5;}
if (Key.isDown(Key.LEFT)) {box._x -= 5;}
[code]....
View 2 Replies
Jul 14, 2011
How can I mention in the actionscript 3 that the movie clip on frame no. 10 should play after the webpage loads (or after 1 minute)? then stops? The code would be on Frame no. 1.
View 3 Replies
Jul 21, 2011
I have three symbols. First is a Shield MovieClip, where in the first frame I have placed a stop(); Action and the second frame is where the animation starts..Second is a Ship and third is a PowerUp. Inside the Ship symbol, I placed the Shield MovieClip. I wanted to create a hitTest when the Ship hits the PowerUp, the Shield MovieClip inside of the Ship will start playing.
This is my code that doesn't work:
if(this.hitTest(_root.ship)) {
root.Ship.Shield.gotoAndPlay(2);
}
View 1 Replies
Jan 13, 2010
After my MovieClip has finished playing once (and ended on the last frame with stop()), I can't get it to play again with gotoAndPlay(x). It will go the specified frame, but will not play from then on. Is there anything else I have to add to actually make it play?my attached sample file which contains a menu that, for testing purposes, is supposed to play someMovieClips when the initial loading process is done.
View 6 Replies
Jul 11, 2009
ActionScript Code:
onClipEvent(enterFrame){
if(this.hitTest(_root.player)){
_root.coinsnd.play;
}
}
When the player touches the movie clip this sound will play, no errors found on this script but it doesn't work
View 3 Replies
Mar 15, 2010
We have 5 buttons that each go to another frame e.g Product, Contact etc. but we want to play the same series of frames (an outro) and then goto the frame that corresponds to the button. Weve tried lots of different examples from the already posted questions and nothing will work. The latest I tried:
[Code]...
View 10 Replies
Aug 19, 2010
I have a series of sections in the timeline and I'd like to use gotoandplay. How do I begin playback of another section of the timeline. Is there a way to detect the end of gotoandplay?
For example: 3 objects and 6 frames.
Each object has a animate in frame and an opposite animate out frame. At each frame the user can pick any of the three objects but if an object is already animated in then is must first play it's 2nd animate out frame. I need to detect the end of an animate out sequence to begin the first frame of the selected object.
View 1 Replies
Nov 29, 2011
I am working in AS2, and am looking for a code that allows me to stop the frame (which is easy: stop() and then make that frame "play" if you will for 30 seconds, and then gotoAndPlay("nextframe"). Is this even possible? I know there's a getTimer(); code, but I have no idea how it works. (I have animations going on in the different frames through movie clips, not on the timeline. Basically trying to make a "movie" with flash)
View 8 Replies
Oct 11, 2004
i am having trouble with my gotoAndPlay in my MC. i have An MC1 on main stage then inside it i have another MC2. Now on my MC1 i want wen it comes to frame 15 to go and play starting frame2 on MC2 so in MC1 frame 15 i put mc2.gotoAndPlay(2); But nothing happens.Oh yea MC1 has stop on the first frame. But i dont see why it wont work.
View 2 Replies
Dec 31, 2010
I have 2 movieclips with instance names: bonus and platform. (and a movieclip inside platform with instance name: hit) I need a sound to play when hitTest is true.
Here is non-working code:
[Code]...
I dont see why this doesnt work. The sound is in the library with linkage name: snd50Points The trace("hit"); doesnt give an output when they do collide. I have a seperate hitTest that does give an output however, could this mean I cant have a hitTest of the same thing at once? I cant delete the onEnterFrame loops of the other hitTest because it has code that needs repeating. So yeah, I need a sound to play once when they collide and play the sound once again when they collide and so on.
View 5 Replies
Dec 31, 2010
I am trying to right a code that will help me make a random gotoAndPlay hits test script like you see the the popular game Pokemon. I have a character that is going over top of another movie clip but i want it to start generating random number and once it its a certain number i want it to go to the frame it is assigned to.[code]
View 2 Replies
Aug 25, 2011
I've got an MC calle "films" and inside of it I'm animation a bar of images across the screen from frame 1 - frame 180. At frame 180 and need it go back to frame 90 and play.I named fram 90 "repeat" and added the following code to frame 180:
stop();
this.gotoAndPlay("repeat");
But it doesn't goto 90 and play it goes back to 1 and plays.
View 1 Replies
Oct 15, 2009
I am trying to get a FLA to work correctly. I have 4 movies that I want to play with a navigation swapping the movies to the front as clicked. When I use the navigation, the first few movies work great, but as I click through they start to get a little jumbled, and it breaks. I am using this script for the buttons to call on the movies:
[Code]....
View 1 Replies
May 12, 2010
Basically trying to set a gotoAndPlay event on a movie clip (onPress / onRelease)
I've tried laying an invisible button over the top of the movie clip which did work, but disabled the movie clip from playing on rollover.
I found the following code on a Adobe forum, but don't really understand it.
myMovieClip.onPress = function () {
trace ("onPress called");
};
View 3 Replies
Nov 2, 2010
I have some sendAndLoad code which works good. Instead of outputting something to a text box I'd like to go to a different place in my movie. I've got quite a few embedded movie clips and the path is the following:
pages_all -> action sc copy 12 -> action content copy 13. Within the pages_all movie clip I'd like to go to frame number 13. How can I use the gotoAndPlay function to go to another movie clip.
I did try the following:
this._parent.gotoAndPlay(13)
View 0 Replies
May 24, 2011
In the past I've used _root.smoke.gotoAndPlay(1);.I can't seem to target this "smoke" movie clip that is on the root with actionscript 3.
View 7 Replies
May 26, 2003
I have this situation:
- main movie
- external movie
- 1 mc into external movie
I load the external movie into main movie and i want to put a gotoandplay() in mc of the external movie, to the external, like this:
[AS]on (release) {
_root.gotoAndPlay (45);
}
[/AS]
but it takes action in the main movie and not in external movie..
View 3 Replies
Apr 2, 2007
im having a problem with Loadmovie().im trying to load a movie and gotoandplay it like this
Code:
var placeholder:MovieClip = this.createEmptyMovieClip("monster", 5);
monster.loadMovie(_root.monsterfile);
monster._x = placeholder._x;[code]....
but it doesn't work .it does load the movieclip though
View 1 Replies
Nov 1, 2010
I have some sendAndLoad code which works good. Instead of outputting something to a text box I'd like to go to a different place in my movie. I've got quite a few embedded movie clips and the path is the following: pages_all -> action sc copy 12 -> action content copy 13. Within the pages_all movie clip I'd like to go to frame number 13. How can I use the gotoAndPlay function to go to another movie clip. I did try the following:
this._parent.gotoAndPlay(13)
That didn't work.
View 1 Replies
Nov 6, 2006
I two small flash games/gadgets, that are loaded into a bigger one using loadMovie. They all work, except one part of one game. It seems that my hitTests arent working when the game is loaded into the main movie. It works fine on its own, but not when its loaded. I've attached all the files.
View 1 Replies
Sep 7, 2009
I'm making a droid (bad guy) move down the screen. If it hits the robot (good guy) the baseHealth will go down 2, same if it hits the bottom of the screen. If it hits the beam movie clip then it will go to the top of the screen and continue downward. The beam movie clip is a laser that slowly move outward, and I want the droid to go to the back of the screen if it ever touches any frame of the beam. However, when the droid touches the beam nothing happens, though it seems to work when it touches the robot or hits the bottom of the screen.
Code:
addEventListener(Event.ENTER_FRAME, moveDroid);
function moveDroid(e:Event):void{[code]....
View 1 Replies
Apr 9, 2009
I have a presentation which is one movie clip in one frame on the main timeline. The movie clip has quite a lengthy timeline. What I need to do is stop the movie at a frame then play on mouse click and in some cases gotoandplay, then stop again. There are no other movie clips inside the main movie clip and I want there to be no buttons. Just proceed to the next bit on mouse click.
View 2 Replies
Oct 28, 2010
Why with AS3 when i create button with gotoAndPlay(2); in movie with 2 frames it does not work? Its because its last frame. What would be work around?
ActionScript Code:
stop();
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
[code]....
View 1 Replies
Jan 15, 2003
[fmx]
related files: 7MB .FLA File
Okay...
At the _root I have an instance using an empty clip named mainPageEmptyClip. Inside of that, are various other movies.
Now, at the _root there is a menu which, when clicked, should access one of the layers within the empty clip's content.
The problem here is that I can't discern what the target would be to actually access the clip. The action worked fine before I implemented the empty clip, but now it won't work any longer.
I've tried using the target tool built into FlashMX, but it doesn't list any of the instances withing mainPageEmptyClip - that's as far as it goes. I've tried entering in what would seem to be the path, based on the instance names of subordinate movies, but it does me no good - I'm continually given the error of Target Not Found.
These are the two options I've tried....
_root.mainPageEmptyClip.gotoAndPlay(351);
_root.mainPageEmptyClip.webLayer.gotoAndPlay(156);
View 2 Replies
Feb 14, 2005
in the end of a frame of a movie clip, can i have some kind of action script that makes that movie clip stop, and then play a frame in a scene?
this is what i have-
stop;
gotoAndPlay("Scene 2", 60)
it works, but instead of going to frame 60 of scene 2, it just goes to frame 60 of the movie clip that's still in scene 1.
View 4 Replies
Dec 13, 2005
I've got a 'simple' problem with some actionscript and movie clips. I have a 1 frame movie with 2 Layers. On Layer 1 I have a movie clip called green1_mc. In this movie clip I have another called green2_mc. This animation is 120 frames long, with a stop(); on frame 59. On Layer 2 of the main timeline I have another movie clip called green_back. This is my button. I've put the following code on the clip.
[Code]...
View 3 Replies