ActionScript 2.0 :: CS3 Movieclip Is Stuck After Movement
Apr 27, 2009
I've attached a demo fla so you can see what I'm trying to do. Basically the big circle is a spaceship that will move to wherever you click. The small circle is a resource that the ship can collect, in this case it's called iron. When you click on the iron the ship moves to it and then the small circle disappears, and +1 is added to your inventory, creating the illusion that the ship has collected it. Problem is, after you collect the iron, you can't really move the ship anymore. It's stuck around the position where the iron was. How do I regain control of the ship after I collect the iron?
View 1 Replies
Similar Posts:
Oct 18, 2005
The main FLA has buttons linked to external swf files that are nested in a layer inside an html file. When rollover occurs, it opens up corresponding swf file. Problem is that when a user moves mouse too quickly over the stage, the rollout gets stuck in the last button the mouse posssibly passed by.
View 4 Replies
Jul 5, 2010
I have a movie which is serving as a button.When you rollover the image, it grows, and stops.When you rollOut, it shrinks, and stops.This code works fine. The Problem:When you scroll the mouse over quickly, the animation get stuck and doesn't execute the rollOut code.This is most likely because the first rollOver action hasn't yet completed.Here's my code:
thumb_test_4.onRollOver=function () {
this.gotoAndPlay(2);
}[code]....
View 9 Replies
Jul 20, 2009
GotoAndPlay acts strangely. I have mc and another mc (instance name: "animation") inside of it. Problem is that the first frame of animation mc stops for TWO frames. Why does it stop for two frames, even thought it should just go from the first frame to the second? Here is the code so you can test it yourself. I have also attached the fla file with this message.
Code:
mc1.stop();
mc1.animation.stop()
var s = 0
addEventListener(Event.ENTER_FRAME, loop)
function loop(e:Event) {
s++
if(s==2) mc1.animation.gotoAndPlay(1), mc1.gotoAndStop(2)
textCount.text = s
}
View 6 Replies
Mar 16, 2010
Link: [URL]. On my movieClip I have a rollOver & rollOut effect with the following script.
txt1: will easeOut larger/ easeIn smallertxt2: will fade in.
Script:txt1.onRollOver = function() {
gotoAndPlay("on");};
txt1.onRollOut = function() {
gotoAndPlay("off"); };
Problem: In my flash file since this effect is done on keyframes if you rollOver the movieClip the easeOut/easeIn on txt1 effect will stick on the stage and it doesn't look clean. How I could go about this with hard coding the actionscript effect instead of using a static motion tween.
View 3 Replies
Apr 29, 2011
It seems to me that all I need is to get my youtube chromeless player that I've loaded in the place I want it to be. Preview As you can see it's not loaded into my MovieClip! Though it IS loaded, it plays, it's the right size! Just not in the right position. I'm hoping one of you can spot me here and be my life saver. Been stuck here and sitting on this code for a couple of days, REALLY WANT TO MOVE ON! Here's my code (AS3)
[Code]...
View 5 Replies
Oct 7, 2009
I have an over_mc on the stage that is set up for MouseEvents, everything seems to work the way I want until i move the mouse off the area before the movie slider_mc has finished playing. After that the movie only jumps between the start and end of the animation and none of the frames between. slider_mc is a MC with 30 frames and a motion tween. Frame 1 is labeled "start" and frame 15 "middle" with stops(); on both frame 1 and frame 15 in the AS layer. slider_mc is an arrow that moves across the stage and stops on a mouse over, it moves off the stage in on a mouseout.
[Code]...
View 0 Replies
Apr 24, 2009
I have made a movieclip and gave the frame this actionscript:
------------------------------------------------------------
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {[code]........
it moves fine and stuff but i was wondering how can i restrict the area in which the movieclip can actually move ? my flash file is 550px X 400px and i want to make it so that it can only move in 300px X 200px of the file if you understand ?
View 1 Replies
Dec 26, 2009
I have a graphic of a computer with a mouse that is a movieclip and I am wondering if it is possible to be able to move the movie click about by clicking and dragging on it but I want to restrict the mouse to a certain space so it doesn't float off the table.
View 1 Replies
Feb 10, 2010
I have a background image that moves left and right, continuously giving a 360 Degrees appearance. My control buttons work fine but what I want to do is ease in to the movement. Here is a LINK to my demo. When you roll over the arrows is simply starts and stops. I'd like to ease the starts and stops
Right Arrow
Code:
on (rollOver) {
_root.theclip2.gotoAndPlay(_root.theclip2._currentframe);
} on (rollOut) {
_root.theclip2.stop();
[Code] .....
View 9 Replies
Nov 3, 2010
I have a big movieclip in a movieclip (bigger then the stage) when i roll over different movieclips the big movieclip moves, right now it just keeps moving when i keep the mouse on the movieclip/ I would like the movieclip to stop moving when its edge is about to leave the screen. I have no idea how i should do this, and all the tutorials i've found explain how to keep and object in the stage (this one is a lot bigger then the stage)
View 1 Replies
Mar 28, 2009
Can anyone tell me how could I be able to move a movieClip in opposite direction of the _xmouse?That means when I move the mouse pointer to right side, my movieClip would move some distance to the left side. And when I move the mouse to the left ,the movieClip should also move to right.I have done something in the attached file but i dont want to continue the movieClip's movement when the mouse movement stops.
View 6 Replies
Apr 16, 2009
I know how to do motion guides, but now I also want to control this movieclip with actionscript code, so that I modify the x and y properties, but STILL restrict the position of the movieclip only to that motion guide. I see that once I modify the x or y properties, the movieclip jumps off the motion guide
View 1 Replies
Jul 30, 2009
I am working on a game project and i have a question about movie clip movement using keyboard event. Basically I have a character on screen and it can move on the x axis using the left and right buttons. I am making my character move by changing the x value of the character movieclip but I find very it laggy and not smooth and if I am going point by point then it's too slow. Whats the best way to make the character move so that the transition will be smooth.
View 3 Replies
Aug 10, 2011
A friend need's to create a flash banner like this site. i write this action to a movie clip, but the clip have to be on movement.
[Code]...
Is there a way to use the startDrag function on a movieclip on movement?
View 1 Replies
Sep 16, 2010
im busy with making a banner with a big movieclip and a small canvas. The idea is somewhat like on:
Code:
tfe.nl/vacatures/
I have added mouselisteners to 8 different movieclips for each side it should scroll to. But i have no idea how to make the movieclip move to the side when i roll over the right movieclip, when i roll over a movieclip on the side the big movieclip should keep moving untill the mouse is in the middle again or the movieclip has reached the side.
[Code].....
View 5 Replies
Apr 24, 2005
I'm having a problem with a little movement script I wrote for a MC I have. I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.) Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.
(I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay. I've attached the .swf.
onClipEvent (load) {
speed = 2;
xPos = 0;
yPos = 0;
this._x = xPos;
this._y = yPos;
[Code] .....
View 11 Replies
Aug 6, 2005
I have a page with height of 2800px. On this page I place a menu up of the page. As I scroll the page down, the menu disappears ( it still stays up). What I need is the menu to remain on the level of the page, where I am just, while I am scrolling the page. Something like on the this website http:[url].... By the way it doesn't have to be menu, I mean any mc that I want it to be moving on that page like that.
View 5 Replies
Apr 18, 2006
I made a horizontal scroll bar using kirupa file for a vertical one, but i need to add an ease effect on the movement of the movieclip. The code i use follows.
[Code].....
View 1 Replies
Sep 24, 2008
I am new to AS but trying to control my MC to move up and down. It's working but I want it to stop at a point so it doesn't go to high and stop at a point where it doesn't go too low.
I got this so far
moveUp.onPress = function() {
gtr_MC.onEnterFrame = function() {
this._y -= 1; };};
moveUp.onRelease = function() {
delete gtr_MC.onEnterFrame;
[Code] .....
View 2 Replies
May 11, 2010
I'm making a game where your character must touch rings (big ovals) that are moving up and down with a motion tween (with easing). I attach these movies and push them into an array. For the hittesting, nothing is accurate. Since a movieclip inside the ring movieclip is moving up and down, the boundary box is much bigger than it should be when hittesting. If I use the x/y method, it triggers the hittest when my character is in line with the reference point. It should trigger when the middle of the character hits around the middle of the ring.
View 2 Replies
Dec 7, 2004
I have the following script in both frame 1 and 2 to let a movieclip move from right to left on the stage:
Code:
speed =-5
name._x += speed
if (name._x<-500) {
name._x = 250;
}
And the clip is indeed moving from right to left on the stage and when it reaches _x -550 it is going back to it's starting position _x 250 only the movement isn't smooth at all. What should I do to make the movement more smooth or should I use a completely different script?
View 6 Replies
Nov 7, 2010
Ive tried searching, but i have no clue what keyword i could use. Here's my case: I'm trying to get a MovieClip to move 20px at a time. Not like "this._x += 20;" or whatever. cause then it would just go fast. I want it to move 20px that one time you hit the button. And 20px further the next time. Or 20px each half second or something.
I thought i solved it when i figured this out: What if i nudge the picture inside the MovieClip 20px each frame, and code it this way:
[Code]....
View 1 Replies
Nov 13, 2008
I am trying to make a movie clip that contains different buttons. Not all the buttons will be visible on the stage always, so I want that when the user moves the mouse arrow left, the movieclip containing the buttons updates and move along with it to the right...and vise versa. The issue I am having is that my pieces update only after I am done moving the mouse. So the movie clip is not moving along with the pointer. Attached is the code. Here is a sample of what I am trying to accomplish: [URL]
View 3 Replies
Oct 5, 2011
Working on a maze game. When the leftkey is pressed the movieclip (char) should turn 90 degrees to the left.
char.scaleX *= -1;
However, the most important thing is that the character doesnt go through the walls of the maze.And I think thats my problem for implementing the code above.Because it doesnt work properly when i put in here;
if(!mazehit) {
char.y += speed;
char.scaleX *= -1;[code].....
View 1 Replies
Nov 6, 2006
I've mastered the way of image panning on an x asis for menus and so forth, but I am trying to get it working with an x and y asis. I mean like the main navigation in this example [URL].
View 4 Replies
Dec 7, 2004
I have the following script in both frame 1 and 2 to let a movieclip move from right to left on the stage:
[Code]...
And the clip is indeed moving from right to left on the stage and when it reaches _x -550 it is going back to it's starting position _x 250 only the movement isn't smooth at all. What should I do to make the movement more smooth or should I use a completely different script?
View 6 Replies
Jan 3, 2010
I am about to make a gallery where all the pictures are ligned up, in a vertical row collum.I wan to make the Movieclip move in the opposite direction of my mouse movement
View 2 Replies
Jun 13, 2011
I'm not sure what to call this particular way of making the movieclip follow the mouse.When the mouse moves up, the movieclip plays through the frame. If the mouse moves down, the movieclip plays in reverse? I think that's how it works.
View 2 Replies
May 11, 2009
I have a flash project that's implementing a simple two player game. I have added an enterFrame function to my main movie which listens for keyboard activity in order to move a cowboy gunslinger. Whenever the cowboy moves, I send a message over a socket to a server which dispatches the movement to the other connected client. This works pretty well, however, the movement messages tend to arrive in clumps which results in jumpy animation of my cowboy on my opponents screen and jumpy animation of his cowboy on my screen. To illustrate, i put a trace in my enterFrame function because I am imagining that this function will run roughly once each time my main movie renders the screen. I also put a trace statement in my function that responds to network traffic and moves the remote player's cowboy on my screen. Here's the output:
[Code]...
View 17 Replies