ActionScript 2.0 :: Horizontal Movement Loop?
Oct 18, 2003
In your tutorial you used the following code to create horizontal movement:[AS]onClipEvent(enterFrame) { speed = 10; this._x += speed; }[/AS]
how would you create a continuous loop of this movement(ie. make the movie move horizontally across the screen over and over).
View 4 Replies
Similar Posts:
Oct 18, 2003
I am just learning actionscript, and your site has been able to clarify a number of things for me. With that said my question is this: In your tutorial you used the following code to create horizontal movement: AS]onClipEvent(enterFrame) { speed = 10; this._x += speed; }[/AS] how would you create a continuous loop of this movement (ie. make the movie move horizontally across the screen over and over).
View 4 Replies
Jun 13, 2011
Trying to use an enterFrame event in conjunction with two functions that combined I want to move my object (a square) from the right to the left side of the screen and rotate it AROUND THE CENTER.When I use the following functions individually, they both work fine:
Actionscript Code:
//Centering function function rotCenter (ob:*, angleDegrees:Number, ptRotationPoint:Point) { var m:Matrix=ob.transform.matrix; m.tx -=
[code].....
View 1 Replies
Mar 26, 2012
I'm making a game similar to Kaboom for my actionscript class
[URL]
I realize I'm not even close to done and its probably shitty but this is my code so far:
var bucket:Bucket=new Bucket
var sun:Sun=new Sun
var fireBalls:Array=new Array()
[Code].....
I know I want to use a timer event or something to get the sun to switch directions randomly but I can't quite figure it out
this is an idea of what the swf looks like (its not loading everything in this simulation, the bucket is on the stage and moves left and right onKeyDown in reality):
[URL]
View 1 Replies
Feb 9, 2009
I've been struggling with a horizontal scroll bar controlling vertical content movement. Can anyone help me? I'm using AS2 in CS3 and I have tried the search function....in vail..
View 4 Replies
Mar 30, 2010
Random Movement: Flip horizontal on direction change along x
View 1 Replies
Mar 31, 2010
[I am using one of the Random Movement Tutorials and as my moving object have a front and a back I wish them to flip horizontally when the change direction.They currently start face left and start moving left, when they start moving right I wish them to flip horizontally.[code]
View 4 Replies
Nov 13, 2010
game.rows = 10;game.spacing = 10;this works ActionScript Code:attachMovie("cell","cell"+i,this.getNextHighestDepth);This doesnt soon as place the moveclip in the for loop. For some reason nothing appears on the stage.Its just to place th movieclips in line next to eatch other horizontal,, Im sure it not to far off. However i cant see my mistake.
ActionScript Code:
var rows = 10;
var spacing = 10;
[code].......
View 9 Replies
Jan 9, 2009
So My problem is I can't seem to get my horizontal nav to space out with an even number of space between the items.
Code: Select allpackage {
import flash.display.*;
import flash.events.*;
[Code]....
View 2 Replies
Apr 13, 2008
I Have a menu with 4 buttons and only three buttons are shown the fourth button is behind a colored square. Each button has it's own color. When i push a button a square on the left will drop down with the same color as the button. And when you push another button the square goes up and will be replaced by another square with the same color as the last button you have pushed. But now for the most difficult part. When you push a button all the four buttons will tween to the left untill the activated button is behind the square. All the other buttons will return from the right.
View 1 Replies
Jun 7, 2010
I have been working on a horizontal AS3 draggable menu for some time now and i am almost there with it. I am basically trying to replicate the menu at [url]...
So far i have got everything to work apart from the easing movement when the menu is dragged. The menu is quite simple, it is made up of a container mc.Inside this container there are 6 buttons which fill the dimensions of the container.The container itself is bigger than the stage and the user must click and drag the menu horizontally to see the rest of the menu.This is working. However, i am still after an easing effect when the menu is being dragged as it stops dead (because it is using the startDrag and stopDrag commands).how to implement an easing effect on the dragging of this menu i would be so grateful as i cannot manage to do it! (perhaps using tweenlite or tweenmax if its easier, or by using simple physics - I have attached a zip file that contains a compiled SWF and a CS4 FLA file.This is the AS3 i have so far:
Code:
stop();
import com.greensock.*;
import com.greensock.easing.*;
import flash.events.MouseEvent;[code].........
View 0 Replies
Sep 28, 2009
I have a series of images that merged into one 2400 pixel wide jpg. I want this to loop continuously across the bottom of a website. I have tried using TweenLite and TweenGroup but cannot get that to behave correctly. Is there an Actionscript 3 way to do this? Ultimately this is being added to a Flex site.
View 1 Replies
Apr 25, 2009
How do I make a smoothe and endless horizontal loop of five or six photos that seems seamless ? I think that this is an actionscript thing that I do not know. I just want five or so evenly spaced photos to scroll from right to left at the top of the stage.
View 1 Replies
Oct 4, 2010
I'm new to flash and this is my first animation... I'm making it in CS5 using AS2 and it features a snail with a movement loop. The loop is in the library as a movie clip, it has 3 layers and is 19 frames long. Because it is a snail in the loop it ends in a different place then it started. The snail has to move along 97 frames after each movement. I thought I could do this within the movie clip using some actionscript on frame 1 but I haven't really got to grips with actionscript so I was wondering how I should go about moving it every time the loop restarts.
View 2 Replies
Mar 23, 2004
All I want is my circle to go across the page and to keep looping. My circle is moving great with this code:
onClipEvent(enterFrame) {
speed = 9;
this._x += speed;
}
What do I add to make it loop?
View 6 Replies
Mar 23, 2004
I am doing a really simple flash piece and was wondering if someone could help me real quick...all I want is my circle to go across the page and to keep looping. My circle is moving great with this code:
onClipEvent(enterFrame) {
speed = 9;
this._x += speed;
}
what do I add to make it loop?
View 6 Replies
Mar 17, 2011
I made this menu : my menu
I am looking to make an improved and more advanced version of the same menu.
I made an animation of waves on the cofee's surface and am looking to make it loop when the mouse is moving and to stop looping when it's not.
View 2 Replies
Jul 26, 2007
I am currently working on a Flash application in which I have several vertical bars that go across the window, and when one of the bars is clicked on, the others move to either the left or the right to create space to the right of the selected bar for a large image.[URL].. I have already written enough of the script to get the bars to move to where they should be when they are clicked on, but they do it instantly--there is no show of movement between point 1 and point 2 (this being the starting and ending x coordinates for each movieclip).
If you're wondering about any of my number values, they are the way they are because the document is 800 wide, it has 5 vertical bars within it, each of them 30 wide, and the bars are 5 pixels apart when placed next to each other. Anyways, here's the script I am currently working with:
[Code]...
With this code, all the speed variable does is determine the length of the pause before the bar goes from its original x coordinate to its final x coordinate. I have tried to replace the line that reads "clip3_mc._x += speed;" with several variations ("clip3_mc._x ++;" , "clip_mc._x = clip_mc._x + 15"), but I don't think that's the issue.
View 1 Replies
Jan 21, 2008
I guys i am trying to make Movie clip movement to infinite loop to x axis.It should move like left to right on loop, without any jurk.i used this code. this is working fine to move left, but i am not getting how should i make it move on looop.
Code:
this.onEnterFrame = function() {
if (this.masked._x>-100) {
this.masked._x += -10;[code].............
View 6 Replies
Apr 25, 2010
I'm currently learning Flash (CS4, AS3) and am creating a game. I have currently 1 flv file with 4 scenes, I then move from left to right and then to scene 2 and go from left to right. This is the game where items pop up that need to be clicked on and you get points.
Is there any way I can combine these onto 1 scene? Flash only allows you to have a maximum of 2880px wide.The reason for this is the transition between the scenes is RUBBISH and that my AS is not working correctly in between scenes (it loses values).
View 2 Replies
Jul 9, 2010
I've been playing with carousel code, and was wondering how to change it from circular animation (carousel) to left/right linear (conveyer belt) style animation, how to change the mover code and 't.angle = i * ((Math.PI*2)/numOfItems);'
[Code]....
View 1 Replies
Feb 12, 2003
I have a mc (fStrip) which looks like a piece of filmstrip with thumbnail images in it. I want this mc to move when the users mouse is positioned over it, but I only want it to move only along it's x-axis and in a direction opposite that of the mouse. And I want it to move or flow smoothly.
I've been trying to figure this out (see my lame attempt below) but without much luck.
onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
[Code].....
View 3 Replies
Jun 22, 2004
I wish to get the effect of ants scuttering across the screen or up a tree, I have not decided which direction yet. I started with the tutorial code for the snow effect from kirupa, and changed it around to fit the little vector ant I created. The way I have it now looks pretty good, but the movement is a little too fluid. They obviously move in sinusoidal paths bc the code tells them to. I have about 20 copies of the main obj, and they're all a little different in size and specs (speed, transparency, etc) but what I was wondering was if there is any way I can change the code to make it a little more hectic, or erratic, not so fluid. If there is no way of doing so, it looks pretty good right now. If there is, however, I think it could look awesome. here's the code I'm using for the object.
onClipEvent (load) {
//stage
movieWidth = 850;
movieHeight = 50;
[code]....
View 5 Replies
Jun 10, 2011
how to get the camera to move with a character? At the minute he just moves off screen when i press right rather than the camera following him.
View 3 Replies
Oct 2, 2002
I have a Mogli (Junglebook-like) Character that i got to move with the arrow keys on the keyboard.
I want the character to jump (so for example , he must while moving to the right of the "gamearea" , you must be able to hit a key (say for example the "control" key ) and then the character must jump ( go up ) and as soon as the key is released he must obviously come down.
And also how do one set movement speed on any particular movement.
View 12 Replies
Apr 16, 2010
I would like to create a loop so the icons in the menu continually loop indefinitly.[code]
View 2 Replies
Dec 11, 2010
I am attempting to use a loop to create text field with the loop's current value. The code looks like this:
ActionScript Code:
for (var i = 1; i<=10; i++) {
var 'nameHolder'+[i]+'_txt':TLFTextField = new TLFTextField();
'nameHolder'+[i]+'_txt'.x = 40
'nameHolder'+[i]+'_txt'.y = 40
'nameHolder'+[i]+'_txt'.text = "Hello World"
}
So essentially what it should do is create 10 text fields at 40, 40 with the text: "Hello World".
View 7 Replies
Jun 13, 2004
i'm trying to do an infinate loop for my m.clip.the looping part does not want to loop...it loops back to my firrst frame even though there are two same picture in the movie clip.....here's a sample of what i use for the infinate loop script..
[Code]...
View 2 Replies
Jul 20, 2009
I have need of loops / nested loops that pick different figures depending on where you are in the loop. The whole function needs to run through 'ml' times. 'ml' is a dynamic figure. Loop 1 = While the loop is within the first 12 iterations, 'exconemp' must equal 100. For iterations 13 - 24, 'exconemp' must equal 102.5, for 25 - 36 it will be 105.06, for 37 - 48 it will be 107.69. This needs to change every 12th iteration until it has reached 'ml'. The calculation takes the value of the previous 'exconemp' and then multiplies that by 0.025.
Loop 2 = While the loop is within the first 120 iterations, 'abc' must equal 0.015 and any further iterations must use 0.01. This must also work in a way to figure out whether 'ml' is higher or lower than 120 and work accordingly. My main issue is this - how do I get the loops to run through as this: While the iteration is < 12, do this, THEN take the final figure (12th iteration) and start on 13 - 24, do this THEN etc etc. How do I produce a THEN statement? I can get the code to pick up the final values, but not change along the way.
[Code]...
View 6 Replies
May 5, 2011
Say, I had a loop in a function...
[Code]....
How would I refer to a in another function
View 8 Replies