ActionScript 2.0 :: Moving Mc From Xpos To Xpos And Back
May 29, 2004
I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed.[code]is the right function to accomplish what I want and if yes, what should be the action for the button?
View 4 Replies
Similar Posts:
May 29, 2004
I have a mc on the stage. I want the mc to move from one x position to another x position and back to it's previous x position again, after a button is pressed.I have the following function:
Code:
function moveClip (clip, xPos, speed){
clip.onEnterFrame = function (){[code]....
Is this the right function to accomplish what I want and if yes, what should be the action for the button?
View 4 Replies
Nov 2, 2006
making an object move from one side to another by using actionscript. so now i was wondering how to make the box get back into the same place as it started when it reaches a certain point.
dding the code to this AS i already got:
Code:
onClipEvent(enterFrame) {
speed = 5;
this._x += speed;
}
View 3 Replies
Feb 19, 2011
[code]The idea was that xpos would update every time the button is clicked, and go from 250 to 300 to 350, etc.I don't really understand why xpos doesn't update; it always remains 250, except for within the function (when it temporarily goes to 300.)
View 9 Replies
Mar 11, 2005
I've got this button that sets _xdest = 450. What I am trying to do is set an If move._xPos>= 450 then a function is activated like this
move.onEnterFrame = function() {
if (_root.move._xPos>= 450) {
out();
}};
View 3 Replies
Nov 28, 2009
I've been teaching myself 3d objects in Flash using the tool in the timeline and AS3.
My Problem is moving an object one way and at a specific point move back (and repeat) in AS3 here is the code. How can I move satillite.x one way and then in the oppisite direction?.
[Code]...
Is there a way to size these objects, or is it depedent on the size of the image map?
View 3 Replies
Feb 27, 2004
I would like to let a MovieClip to move from lets say _x 200 to _x 800. When the mc reach the _x 800 it should return to _ 200 and visa versa. I like to do this with AS instead of with motion tween.
View 2 Replies
Jan 26, 2006
I want to make a movie clip move left continuously and smoothly on rollover then on rollout i want it to be able to move it back to its original position with an ease. The problem is getting it to remember the position it finished in on rollover. How can i do it with actionscript?
I want to do it all with actionscript because I did it with frame labels and tweens first of all but its not smooth enough, it jumps in certain points because it cant remember how far left it moved on the rollover.
View 4 Replies
Oct 8, 2010
I'm trying to go back a certain number of frames (let's say 20) after I hit the "Left" keyboard key.
PHP Code:
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
[code].....
View 6 Replies
Jan 2, 2010
I'm working on a Curling game and have a broom moving back and forth based on the mouseX position. Although I thought it would be as simple as recording the current broom position vs. the previous broom position that's not the case. This is because when you move back and forth the current and last postion may be at the very same point, like the center of the screen, depending on when exactly the mouse position is recorded. So, moving the mouse very slowly may give the same result and moving the mouse super fast where the x coordinate just happens to be recorded at or near the same point.
I tried using both an enterFrame event and a timer. Both yielded essentially the same results. I can't think of a way around this off the top of my head. Is there another way to record how fast the user is moving the mouse back and forth?
View 2 Replies
Jun 29, 2011
I am working on a website where I have some movieclips on the stage scattered. Some overlapping each other. Now when I move my mouse over any movieclip, I want the movieclips around it to move away from it and when I rollout they should get back in place. An example of this can bee seen on [URL].
View 6 Replies
Jul 15, 2004
I have a block that I'm trying to make move from right to left, and if the block gets to a certain point, it will move back to it's original position. So, I have this on my block (movieclip) right now.
Code:
onClipEvent(enterFrame) {
speed = 3
dist = 8.5
_x -= speed;
if (_x = dist) {
_x += 3
}}
But all this is doing is throwing the block at the 8.5 distance...
View 9 Replies
Feb 4, 2005
drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies
Feb 4, 2005
do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies
Mar 10, 2008
I've got a horizontal bar on the screen following the mouse vertical motion. I would like for it to be transparent until the mouse moves, and then fade in to be 100% on mouse movement. When the mouse stops moving, I would like it to fade back to be 0% transparent after a couple of seconds. This what I have for the mouse follow on the bar MC...
[Code]....
View 4 Replies
Oct 21, 2010
I have a Flash website with 3 interfaces( 3 frames with movie clips inside). they have a button that goes to different loaded .html page(text). But once the back button is pushed on the web browser, it always goes back to the first frame instead of the actual last page, which might have been frame 2 or 3.
View 1 Replies
Jan 13, 2009
I have a project (see attached) where I need to have the folders seem like they are floating in space, and I need the best way to make it so when you click on a back folder, it slides off the screen and come back in front of all the folders.
View 2 Replies
Dec 4, 2010
Anyways I am using action script 3.0 and I created multiple layers using just one scene. I created a layer with lables on them to mark where I want my buttons to point to and go to. I have the stop (); on the first frame. And I made my buttons mostly interactive with movie symbols and tweens.My first scene I have 2 doors, the user can pick which door to go to and it takes them into a different path.I made the buttons that are clicked to go forward, and then I tried to make an invisible button on the button edge of the scene to go backwards However, the PROBLEM is when I click my button to go backwards I am stuck on the first page and can't move forward.
function gotoOne(evt:Event):void{ gotoAndStop("one")}backbutton1.addEventListener("click",gotoOne);
function gotoFour(evt:Event):void{
[code].....
View 11 Replies
May 26, 2011
I have a GUI using Flex. I have a condition like i need to execute some command line arguments in the local machine and get the results back or output back to a textbox area. How can i do a button on submit, execute command in the local machine and return the output?Command to execute example:
echo logfile.log | grep username
Code:
button1.onRelease = function ()
{
// in this computer, it will now run a command, please wait.
}
View 1 Replies
May 28, 2010
I am working on a having external swfs get loaded into the main swf one by one from an array.I can get the first one to load, but it just keeps on playing the first item in the array over and over, instead of loading the next movie. I have a container on my stage, cleverly named "container" and I am using AS2 and loadMovie.
I am guessing my conditon on my if statement is off, but I am not sure how to tell the onEnterFrame to check the currentframe of the loaded swf and not the container itself. I might be way off, but in my mind I feel like this mostly makes sense, but knowing Flash it is probably not nearly enough coding.I might also add this won't be running on the web, so I don't need to worry about preloading swfs since it will be running directly off a PC onto a screen in our office.Here is my code:
Code:
var myClips:Array = ["movie1.swf", "movie2.swf", "movie3.swf", "white_logo.swf"];
var i:Number = 0;
_root.container.onEnterFrame = function() {[code].....
View 2 Replies
Sep 14, 2011
I've got the standard scene 1 with three frames on it. the first frame has a movie clip with about a 70 frame timeline. the second frame has a movie clip with about a 20 frame timeline. the third frame is black with a stop action. i'm trying to make a leaderboard banner, and i need each clip to play one after the other.
right now, when ctrl+enter it plays nothing. i actually have to rewind it to have it play the first clip. then it just repeats the first clip and completely skips the second. in the first clip's timeline, I have a parent.gotoAndPlay(2); on the last frame.
View 1 Replies
Sep 14, 2011
I have some knowledge of Flash, but not enough obviously. Right now I've got the standard scene 1 with three frames on it. the first frame has a movie clip with about a 70 frame timeline. the second frame has a movie clip with about a 20 frame timeline. the third frame is black with a stop action. i'm trying to make a leaderboard banner, and i need each clip to play one after the other. right now, when ctrl+enter it plays nothing. i actually have to rewind it to have it play the first clip. then it just repeats the first clip and completely skips the second. in the first clip's timeline, I have a parent.gotoAndPlay(2); on the last frame.
View 1 Replies
Feb 27, 2010
i want to know how we can make back button in flash to go back to page same like browser back button.
View 1 Replies
Nov 8, 2011
In my apps, i would like to:
1)have a pop-up menu when a button is touched, then ok to close but still in the same page as it is
2)invoke the popup menu by using samsung's "MENU keycode",then ok to return the same page as it is
3)having the user to swipe 5 images to view them, left image as 1st and 5th image as last image with smooth transitions
4)and also using the "BACK keycode" to go back to previous page
View 3 Replies
Nov 2, 2010
im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.
hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......
View 2 Replies
Jan 30, 2012
what i have is a tween on a movie clip of a popcorn kernel on one layer and a tween on a button on another layer to follow the movie clip. i want to be able to roll over the kernel and make it "pop". i changed my over on the button to popped corn (this works) but i want it to stay popped for the rest of the tween.
View 11 Replies
Apr 22, 2007
I want to know how i can moving my scene by moving a mouse over them.
to understand what i want exactly ckeck this link :- [URL]
View 1 Replies
Nov 28, 2010
I have some simple script that has 2 "movie clips". What I want to do is to start moving the second movie clip at the same time when the 1st starts moving. (both start moving at the same time) I tried the following script but it never works:
[Code]...
View 3 Replies
Feb 18, 2010
Why will this not work? I get back: "Welcome Back, DEFINED." The firstToUpper function will not run. I set the variable for Party already.
Players = firstToUpper(Party); function firstToUpper(word) { firstLetter = word.substring(1, 0); restOfWord = word.substring(1); return (firstLetter.toUpperCase()+restOfWord); trace("hey")}Hiusername.text = ("Welcome Back, " + Players);
View 3 Replies
Oct 30, 2006
basically this code will work like a browser back button its very simple but "could end up very long" basically it will act "similiar to the browser back button"
Code:
on (release) {
if(page1 = _currentframe){
_root.gotoAndStop("quiz");
} else if (page0 = _currentframe){
[code]....
it works when the (page1 = _currentframe){ is rotated with the first if statement...because for somereason it seems to not recognise the "else if's"
View 2 Replies