Actionscript Movement
I am trying to make a simulator that will create a star, if certain parameters are met. The part I need help with is this; can I somehow create a mc animation that can be applied to many instances of a mc, in different locations on the stage, and have each instance end up in the center of the stage?
FlashKit > Flash Help > Flash ActionScript
Posted on: 06-29-2004, 04:03 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
"Electron Movement" Tricky Actionscript Movement Animation
Can anybody help me with the actionscript for this one?
Objects floating from right to left on a page, when they float into static objects instead of passing behind them or in front of them or bouncing off them and going the other way, they simply move round the static objects and carry on.
Like drunks walking through a jungle of lamposts.
Movement Using Actionscript
How do I make something move using actionscript?
For example I have 4 buttons and a movie clip that I want to slide to the x position of any button I rollover. Also I would like to make the sliding movie clip accelerate and decelerate.
Movement Using Actionscript
My first attempt at moving something using action script. Took me a while to make it, but i got it done in the end. Check it out
http://www16.brinkster.com/darth84/movement.swf
What do you think? Methinks it looks cool, but thats because I made it.
[Edited by ammaar on 09-27-2001 at 10:42 AM]
Actionscript Movement
Simple question, how do I move an object from one side of the stage to the other using actionscript?
Movement With ActionScript
Right...
I have an MC and I want to move it fomr one point to another with tweening and easing. How do I do this with actionscript, as in make it goto an x y coordinate??
Movement With ActionScript
Hi,
I have seen on sites picture back drops, and when a section is selected it goes to a part of the long pic, I assume using x y coordinates. It does this with motion and easing.
How do you do this??
Thx in advance
Actionscript Movement Again HELP
I have a mc which I have inside a standerd 3 frame loop what I want it to do is move from one side of the screen to the other and back and forth which I can do but I want it to slow down when it gets to oneside and then when it hits that side to go back over to the other side and slow down as it gets to the other side and back and forth . Please help I have spent hours getting this to work .
frame 1
Code:
tx1=550;
tx2=0;
_x=41;
_y=140;
// frame2
_x+=(tx1-_x)/5;
if (_x+_width/2>tx1) {
_x=tx1-_width/2;
_x+=(tx2-_x)/5;
}
if (_x-_width/2<tx2) {
_x=tx2+_width/2;
_x+=(tx1._x)/5;
}
// frame3
gotoAndPlay(2);
Movement With Actionscript
i have a 'button' and a 'movie clip that movies up and down with the mouse'
i need to know how to make the movie clip accelerate from its current position to a stated _y position when the button is pushed
thanks
Actionscript Movement
I am trying to create a collapsable menu that expands when a button is clicked so that sub buttons show and all the other main buttons slide down. When the button is clicked again or another main button is clicked all the buttons will slide back up and any sub buttons already opened will slide up. I have 6 buttons created all set up with a mask and tween that will move the sub buttons down or up. My problem is getting the other main buttons to slide down to allow the sub buttons room to display. After trying several things I've pretty much come to the conclusion that I will have to move my main buttons through actionscripting but can't figure out how to do it. I tried using a the while command and increasing the y position by 5 until the y location and desired destination were equal but it just moves the button right to the desired location and doesn't create any sort of animation. I found this tutorial but the movement script is a complete mess and I can't figure out exactly what they are doing and there is no fla included. This is pretty much the effect I'm looking for except my buttons are not dynamic. Any help would be greatly appreciated.
Movement With Actionscript....
Hi,
I'm trying to move a movie clip (content) with actionscript.
I have 7 buttons which need to move content to 7 different x locations (ie. the clip moves left and right only.
After it has finished moving i need it to fade out. Then when another button is clicked, the movie needs to fade back in before moving to the next position.
I have managed to get it working some of the time. The only problem is, the movie doesn't always fade out after it has finished moving.
It works all of the time if it is moving from left to right, but only some of the time if it is moving from right to left.
I have uploaded the .fla to http://www.tickle.co.uk/testarea/movefade.fla
I'm getting pretty desperate now so i'd be grateful for any help!
Thanks in advance,
Phil
Actionscript Movement
I'm looking for a tutorial to learn actionscript movement (no motiontweens) Wher can I learn that?
Thanks
Help With Actionscript Movement
I'm trying to simulate a wave washing ashore and then slowly receeding. So far I've got the wave mc moving left and slowing down by a factor of six until it reaches its end position. How do I get it to go backwards now (say back to starting position for simplicity's sake)? Actionscript so far:
onClipEvent(load) {
this._x = 100;
endPosx = -100;
}
onClipEvent(enterFrame) {
movex = (endPosx - this._x)/6;
this._x += movex;
}
Actionscript Movement Q
im working on a .fla that has a bunch of scrolling MCs...once a clip gets to a certain point, i want the main timeline to jump to a keyframe and which had the next one to scroll...this is what i have on the first MC, which works...playhead jumps to frame "two"...but applying this code to the second clip and changing the keyframe label, the timeline does not jump to the next keyframe as specified....why, help please...:
onClipEvent(load) {
speed = -3;
}
onClipEvent(enterFrame) {
currentPosx = this._x + speed;
this._x = currentPosx;
if (currentPosx < (170 - this._width/2)) {
_root.gotoAndStop ("two");
}
}
thank you
:::::::::: Please Help :::::: Actionscript Movement
I need to achieve the following, any guidance would be much appreciated.
Say I have a load of movie clips on the stage dotted around, very small. I want to use actionscript to make them grow and become centred on the stage, depending on a certain event, like a button click to target a certain clip.
Im not sure how to start this. Has anyone done anything like this before? I'm pretty sure its possible
Thanks alot
Movement With Actionscript
i put together this site with little/no actionscript knowledge. I would like to utilize actionscript for the movement of the menus and the alpha tweens. not quite sure where to start though. any suggestions.
Actionscript Movement
just messing around with flash since ive got all summer now...
its been a while and i forgot how to do this
how do i move an object using actionscript?
just the basics i guess...i messed around a little, but cant remember
thanks in advance
-2
Actionscript Movement
Hi there
I have some Actionscript that moves a movieclip to a given X and Y value using deceleration. Below is the code in queston,
code: onClipEvent (load) {
speed = 4;
ax = _x;
ay = _y;
}
onClipEvent (enterFrame) {
_x += (ax-_x)/speed;
_y += (ay-_y)/speed;
}
AX and AY are the target X and Y coordinates.
I am wanting to modify this code so that it does more or less the same, except when it gets to the point of target, it "bounces" around like a elastic effect. For an example, here is a motion tweened version of what I want, (obviously will be smoother when coded)
http://www.sekka.co.uk/ball
How do alter the above code to achieve this?
Thanks in advance
Actionscript Movement
I wanted to thank catbert303 for the movement actionscript, because I was looking for it for few months now and I was not able to find it. I also wanted to ask few other questions.
1. I put the code in that catbert303 provided goes as:
code:
onClipEvent(load) {
speed = Math.floor(Math.random() * 10);
stopAt = 350;
}
onClipEvent(enterFrame) {
if (this._x < stopAt) {
this._x += speed;
}
}
how can I make my object bounce up and then bounce down again where it came at the first place.
My second question is what book would you recomend that has all of this stuff as far as actionscripting. Like how to do alphas, motion tween, bouncing and etc with actionscript.
My third question is if my movieclip needs to stop at x=324.5 and y=146.2 how do I put that in the code. Thank you very much
EDIT: Added as tags. - jbum
Movement With Actionscript
Hi guys!
I'm trying to get 2 movie clips to move and fade using actionscript.
They are only moving straight along the X-Axis.
Lets call them 'A' and 'B'.
I need to get A from a set position to move to the right.
I need to get B from a set position to move to the left.
And they need to fade in at the start of their respective animations and then fade out at the end.
Can anybody help me with this one, or point me in the direction of a tutorial.
Thanks!
D.
Actionscript Movement
i have this code below, for actionscript 2 of course, and it works fine.
Code:
onClipEvent (load) {
this.speed = 2;
this.distance = 500;
}
onClipEvent (enterFrame) {
if (this._x<this.distance) {
this._x += speed;
}
if (this._x>=(this.distance*0.8)) {
speed -= 0.05;
}
if (speed<0) {
speed = -2;
}
}
basicly, it a circle moves along the screen until it's x co-ordinate is at just before 500 then slows down then stops at 500 and then goes the other way. now after it goes the other way (to the left) i want it to again slow down and stop at a certain point (say 100), how would i go about doing that? also, if anyone could show me how to clean up the code a bit, that would be fantastic. thanks
Movement Using Actionscript
Hi guys.
I am trying to find out how to move a simple MovieClip from one set of coordinates to the other. For example:
Move 'MC_01' from X=362 y=243 to x=362 y=0 over 100 frames. When this is done goto frame label 'step_02'
Hope this makes sense. Could someone help me with the actonscript for this or point me in the direction of a tutorial on this. I'm having trouble find what I need.
Your help is very much appreciated!
Many thanks
D.
Actionscript Movement
I have 6 buttons in a horizontal menu and what I am trying to do is when the mouse is over one of the buttons the other ones should distance themselves from this one and this button should slightly increase in scale. I have no idea how to create the animation, which I want to be non-linear.
Actionscript Movement
Hi all,
this is probabely a simple question to many of you, but i seem to fail miserably every time. Basically i need to make a movie clip move back and forth between two x values. ie it moves from 300 to 500 then back to 300 etc etc.
thanks for any help on this script!
Steve
Help With Movement Using Actionscript.
go to this site http://www.constructiondurable.com/indexflash.htm and take a look at the preloader,it moves smoothly and i don't think it's done using simple tween.i tried to do it using tween but just didn't work out.is it made using actionscript?
Movement With Actionscript
Hi,
I am using action script to do some simple movement of text. I created some text, made it a movie clip and gave it an instance name of q1. I put it on the stage and did a right click on it, and selected "actions." I added the following actionscript code for the movement:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
}
This worked great and moved the text up the screen to a certain point and stopped. Just what I wanted. But now, when the text stops moving, I want the entire movie to go to frame 2. This seems like it should be easy to do, but I can not figure out how to recognize that the motion has stopped and to go to frame 2. I tried this,but it had no effect:
onClipEvent(enterFrame) {
if (!cancelled) {
speed = 4;
this._y -= speed;
if (this._y < 100) {
this.cancelled=true;}
}
gotoAndPlay(2);
}
Anyone know how to do this? Thanks!
Bob
Movement Using Actionscript
Hi! Ive done the tutorial on how to make things move with actionscript
(http://www.kirupa.com/developer/mx/ASmovement.htm)
however this is just for continuos movement- does anyone know how you stop it moving?
i am a novice so please help!!
Actionscript Movement
Hey,
can anyone tell an actionscript newbie how to go about creating horizontal style movement as in what happens when you use the sub-menu on this site...
http://www.snowpatrol.net/flash/flash.html
and the contents moves to the left and right along a horizontal timeline???
all help greatly appreciated*
Movement Using ActionScript
I'm new to using Action Scrip and I'm wondering if I could have a bit of help.
I've read and understood the "Movement Using ActionScript" tutorial, but I'm wondering how to make the movie clip come back from the start again.
Kind of like this flash movie: http://www.weebls-stuff.com/toons/28/
Thanks
Movement W/ Actionscript
ok so i am working on this page:
http://www.pages.drexel.edu/~abl27/
each button in the grid on the right will open up a project on the left where the news is now. however i would like to make it so that the buttons move left and right depending on how much space each project takes up (so no matter how much space the project being viewed takes, the buttons are always right next to it).
what is the best way to attempt that? can anyone point me to any helpful tutorials?
i figure what i will have to do is program each button so that when it is clicked it makes all the other buttons slide to a defined spot. i just dont know how to do that...
also, ideally i would like so that each button slides into place one at a time for example:
www.crew9.net
thanks!
Actionscript Movement
hi all
i've been out of touch with this site from last 6 months.
so now i want to start again learn more on actionscrip
I’ve made the following animation by using flash motion twin
But now I want to know how I can create this animation or
similar animations by using Actionscript.
Can any one plz help me out of this.
you can view my these two files by clicking the following links:
http://www.intersoft-group.com/tm/fm/formail.html
http://www.intersoft-group.com/tm/fm/formail2.html
thanks
amjad
Actionscript Movement
Hello everybody. Here is my problem. In attached file I have square that moves through the entire page. I used an example of the square that was posted on this website as tutorial. I was woundering if anybody knew if I am able to stop this square at certian places with actionscripting. For example x=397 and y=123. Thank you very much for the help.
Actionscript Movement
hello
I have to make a site where there is 3 animations(MC) running with invisble buttons over them.
When you push one of the buttons the other two MCs must slide a som pixels to the side while decreasing their alpha. So if somebody has any info how this could be done...so please write...thanx
Tokei
Movement Using Actionscript.
I am pretty new at flash so here is my dilemma.
So i lets say using this actionscript:
onClipEvent(enterFrame) {
speed = 1;
this._x += speed;
}
How do I make it so when I click on an image, it uses actionscript to move it a certin amount and then stop where I want it to.
Thanks.
Movement Using ActionScript
I have a movie clip that I would like to slide to the right or left depending on which button the user clicks. When I test the movie and click on the buttons, the target movie clip only moves one pixel. I want it to slide into place. What am I doing wrong?
leftBtn.onRelease = function() {
if (_root.info_mc._x>490) {
speed = -5;
_root.info_mc._x += speed;
}
else {
_root.info_mc._x = 490;
}
};
rightBtn.onRelease = function() {
if (_root.info_mc._x<590) {
speed = 5;
_root.info_mc._x += speed;
}
else {
_root.info_mc_x = 590;
}
};
Thank you in advance for your help.
Movement Using Actionscript
Hi! Ive done the tutorial on how to make things move with actionscript
(http://www.kirupa.com/developer/mx/ASmovement.htm)
however this is just for continuos movement- does anyone know how you stop it moving?
i am a novice so please help!!
Actionscript Movement
Hey,
can anyone tell an actionscript newbie how to go about creating horizontal style movement as in what happens when you use the sub-menu on this site...
http://www.snowpatrol.net/flash/flash.html
and the contents moves to the left and right along a horizontal timeline???
all help greatly appreciated*
Movement Using ActionScript
I'm new to using Action Scrip and I'm wondering if I could have a bit of help.
I've read and understood the "Movement Using ActionScript" tutorial, but I'm wondering how to make the movie clip come back from the start again.
Kind of like this flash movie: http://www.weebls-stuff.com/toons/28/
Thanks
Movement W/ Actionscript
ok so i am working on this page:
http://www.pages.drexel.edu/~abl27/
each button in the grid on the right will open up a project on the left where the news is now. however i would like to make it so that the buttons move left and right depending on how much space each project takes up (so no matter how much space the project being viewed takes, the buttons are always right next to it).
what is the best way to attempt that? can anyone point me to any helpful tutorials?
i figure what i will have to do is program each button so that when it is clicked it makes all the other buttons slide to a defined spot. i just dont know how to do that...
also, ideally i would like so that each button slides into place one at a time for example:
www.crew9.net
thanks!
Bar Movement Via Actionscript
Hi there. I'm having a problem. I want ro make a bar (a simple object in flash) to move right and left according to the mouse position. I can make the movement and so on, but i want to define some limits in wich the bar moves, or the bar would get off the screen and i don't want that. I posted the fla with this message, so i would apreciate a lot if someone download the file and see where's the problem. Is it a coordinates problem ?? I don's know.Plz help me
Actionscript Movement
hi all
i've been out of touch with this site from last 6 months.
so now i want to start again learn more on actionscrip
I’ve made the following animation by using flash motion twin
But now I want to know how I can create this animation or
similar animations by using Actionscript.
Can any one plz help me out of this.
you can view my these two files by clicking the following links:
http://www.intersoft-group.com/tm/fm/formail.html
http://www.intersoft-group.com/tm/fm/formail2.html
thanks
amjad
Actionscript Movement
Hello everybody. Here is my problem. In attached file I have square that moves through the entire page. I used an example of the square that was posted on this website as tutorial. I was woundering if anybody knew if I am able to stop this square at certian places with actionscripting. For example x=397 and y=123. Thank you very much for the help.
Actionscript Movement
I am working on a collapsable menu for a website but I'm having some problems making the main buttons shift down when an button is expanded. I've seen the actionscript movement tutorial on this website but when I try to use it on my menu I have problems. The tutorial on this site has the movement set to a clip event. However I need to be able to control when they move up or down. I tried putting a MC with 3 frames in it to control my movment but it didn't work. It looked like this
Code:
Frame 1:
Stop();
Frame 2:
if (_root.Button2Dest !== _root.Button2._y){
_root.Button2 += 5
gotoAndPlay(3);
}
gotoAndStop(2);
Frame 3:
gotoAndPlay(2);
When I did this my 2nd button just jumps to where it is supposed to end up instead of moving there by 5 pixel increments. Any help on this would be great.
Actionscript Movement
hello
I have to make a site where there is 3 animations(MC) running with invisble buttons over them.
When you push one of the buttons the other two MCs must slide a som pixels to the side while decreasing their alpha. So if somebody has any info how this could be done...so please write...thanx
Tokei
Movement Using Actionscript.
I am pretty new at flash so here is my dilemma.
So i lets say using this actionscript:
onClipEvent(enterFrame) {
speed = 1;
this._x += speed;
}
How do I make it so when I click on an image, it uses actionscript to move it a certin amount and then stop where I want it to.
Thanks.
Actionscript Movement - Please Help
Yet another issue...
I hope someone can help me with this.
I'm trying to create a button, that on rollOver moves an mc up, and on rollOut moves the same mc down again, with easing.
I have the mc moving up:
ActionScript Code:
btn_slide1.onRollOver = function() {
tweenSlide(mx.transitions.easing.Strong.easeOut);
};
function tweenSlide(easeType) {
var begin = 315;
var end = 15;
var time = 10;
var mc = slide1;
slideTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
but if i repeat the script, changing the values like this, it looks weird..
ActionScript Code:
btn_slide1.onRollOut = function() {
tweenSlide(mx.transitions.easing.Strong.easeIn);
};
function tweenSlide(easeType) {
var begin = 15;
var end = 315;
var time = 10;
var mc = slide1;
slideTween = new mx.transitions.Tween(mc, "_y", easeType, begin, end, time);
}
Any suggestions...?
Also.. the mc that works as the button has a timeline animation onRollOver implemented inside the mc. That obviously overrides this onRollOver, so is there a way to implement this in the above onRollOver script aswell?
ActionScript Code:
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = function(){
rewind = false;
play();
}
this.onRollOut = function(){
rewind = true;
}
This is alot in one round, i know, but hope someone is able to help out...
Happy newyear all
Movement: Actionscript Style.........help
i need to know how to animate a object useing only actionscript. lets say something as easy as makeing a square move from the left side of the screen to the right and then stop, this can be done very simply with tweening, i want to know the code that would let me do this, please help me, if you want to just post the code so i can study it and learn that would be great.
thanks-
Line Movement With Actionscript
How do I make a movie (of a horizontal line going down the screen) start playing backwards (ya know, going back up?) when it gets to the last frame and keep looping? I thought I could do this by setting a variable at the beginning equal to 1 and at the end equal to -1 and then just have the actionscript Go to and Play (_currentframe + framenum); (framenum is the variable I created)....but it doesn't seem to work...what did I do wrong? I know it's something stupid.
Alright alright, I know i can do this by doing a simple motion tween with 3 keyframes to make the line go down and up and rinse and repeat and whatever, but that's not the point. The point is...I'm stubborn and I want to do this with actionscript.
|