Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Ants Movement (based On Snow Movement)



Hey! I have a question for those who think they can help and might have the time to do so. 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; //mods for ants i = 1+Math.random()*5; k = 1.2*(-Math.PI)+Math.random()*Math.PI; //each ant diff this._xscale = this._yscale=38+Math.random()*30; this._alpha = 75+Math.random()*100; this._y = -10+Math.random()*movieHeight; this._x = -10+Math.random()*movieWidth;}onClipEvent (enterFrame) { rad += (k/70)*Math.PI; this._y -= Math.cos(rad); this._x += i; if (this._x>=movieWidth) { this._x = -3; } if ((this._y>=movieHeight) || (this._y<=0)) { this._y = -2+Math.random()*movieHeight; this._x = -3; }} (I apologize for posting the code without one of those code boxes ppl use, I do not know how to do that yet....) Any help is greatly appreciated! I wanted to congratulate everyone here at kirupa for having a great community, and great help to those that need it. I am so glad to be a part of it. Luke



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-22-2004, 01:57 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Ants Movement (based On Snow Movement)
Hey! I have a question for those who think they can help and might have the time to do so. 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;

//mods for ants
i = 1+Math.random()*5;
k = 1.2*(-Math.PI)+Math.random()*Math.PI;

//each ant diff
this._xscale = this._yscale=38+Math.random()*30;
this._alpha = 75+Math.random()*100;
this._y = -10+Math.random()*movieHeight;
this._x = -10+Math.random()*movieWidth;
}
onClipEvent (enterFrame) {
rad += (k/70)*Math.PI;
this._y -= Math.cos(rad);
this._x += i;
if (this._x>=movieWidth) {
this._x = -3;
}
if ((this._y>=movieHeight) || (this._y<=0)) {
this._y = -2+Math.random()*movieHeight;
this._x = -3;
}
}

(I apologize for posting the code without one of those code boxes ppl use, I do not know how to do that yet....)

Any help is greatly appreciated! I wanted to congratulate everyone here at kirupa for having a great community, and great help to those that need it. I am so glad to be a part of it.

Luke

Image Movement Based On Mouse Movement
I have my Flash canvas. In the Canvas I have an image that's centered and larger than the canvas. Obviously the entire image isn't shown. How can I use actionscript to move the image according to where the mouse is? So if I move my mouse to the top right corner I want the image to move accordingly to display the top-right corner (obviously in a smooth fashion . I tried looking for examples but wanted to know if anybody out there new.

Any ideas?

Little help and thanks in advance!
Brian

Object Movement Based On Mouse Movement
Not sure how to word this but. I have a object on the stage lets say that is 300 pixels wide. The actual stage is only 100px wide. I want to be able to "pan" the object left and right based on mouse position/movement. I saw a tutorial for it a while back but cant seem to find it. Anyone have a link to a tut or can throw out a little source code? It would be greatly appreciated.

Snow-flake Like Movement Opposite Way?
I'm trying to create a dust like scheme and I came across a lot of snow tutorials. I managed to tweak it to look a bit like dust, but instead of moving up in goes down.

Is there anyway to make the dust move from the bottom of the stage to the top rather than top to bottom?

Thanks.

Snow-flake Like Movement Opposite Way?
I'm trying to create a dust like scheme and I came across a lot of snow tutorials. I managed to tweak it to look a bit like dust, but instead of moving up in goes down.

Is there anyway to make the dust move from the bottom of the stage to the top rather than top to bottom?

Thanks.

Falling Snow Tutorial (on This Site) - Horiz Movement Question
I just followed your fabulous falling snow demo. It is quite beautiful and relaxing to watch. My only problem was that in my version, the snow was falling straight down, not meandering side to side. The .fla download works fine. I followed directions exactly, then compared my version with the downloaded one. I noticed in the downloaded version there is a separate layer for action, which I included and moved the actionscript but it did not fix the problem. Has anyone else done this tutorial or have any advice on this? At first I thought it was because I was using CS3 but then the downloaded file works fine so that's not it.

Thanks,
Matt

Time-based Movement
Hi all

I am using the code below to move a movieclip by a certain amount ('from' & 'to'), over a specific time period ('start' & 'end');
I am using getTimer() to create a trigger that controls the movement so that the clip arrives at it's destination position by the correct 'end' time.
My problem is that, due to the trigger firing every second, movement is jumpy and not smooth.I have tried to make a millisecond trigger with no success and have become brain-dead in the process!

can anyone help me with this.....??? Thanks if you can.

Here's the code I'm using...
onClipEvent (load) {
function doCalculateMoveAmount (start, end, from, to) {
this.duration = (end-start);
if (from>to) {
this.totPixelsToMove = (from-to);
} else {
this.totPixelsToMove = (to-from);
}
this.pixelsPerSec = (this.totPixelsToMove/this.duration);
}
//
function restartTimer () {
firstStart = Math.floor(getTimer()/1000);
}
}
onClipEvent (enterFrame) {
this.runningTime = Math.floor(getTimer()/1000);
this.trigger = (runningTime-firstStart);
if (this.trigger == 1) {
if (this.runningTime>=10 && this.runningTime<=20) {
doCalculateMoveAmount(10, 20, 0, 50);
_root.clip._y -= this.pixelsPerSec;
}
restartTimer();
}
}

(if anyone has a better method of time-based movement I would be pleased to hear that too).

Movement Based On 2 Variables
I wasn't sure how to title this problem...anyway, the scenario is as follows...
The user drags 2 charged particles (ParticlePositive1_mc and ParticlePositive2_mc) to a ruler...when they come into contact with the ruler (HitTest_mc), a hitTest is run to determine if they're both on the ruler and then their location in relation to each other is checked to determine which direction they are to begin traveling...(it's for an animation demonstrating like particles repel and opposite particles attract)...
Everything works up until when the movement should begin...here's my code...

Code:
ParticlePositive1_mc.onPress = function() {
this.startDrag(false, 213, 50, 574, 294)
}
ParticlePositive1_mc.onRelease = function() {
this.stopDrag()
if ((this.hitTest(HitTest_mc)) && (ParticlePositive2_mc.hitTest(HitTest_mc))) {
delete this.onPress
delete ParticlePositive2_mc.onPress
if (this._x < ParticlePositive2_mc._x) {
this.onEnterFrame = function() {
this._x = this._x--
ParticlePositive2_mc._x = ParticlePositive2_mc._x++
}
}
else if (this._x > ParticlePositive2_mc._x) {
this.onEnterFrame = function() {
this._x = this._x++
ParticlePositive2_mc._x = ParticlePositive2_mc._x--
}
}
else if (this.hitTest(ParticlePositive2_mc)) {
this._x = this._x
ParticlePositive2_mc._x = ParticlePositive2_mc._x
}
}
}

Movement Based On Direction
Hi, I currently have a problem with moving a MC sprite. The rotation is fine, but I want to have the sprite move forward in the direction it's facing. Any suggestions?

[F8] MC Movement Based On Time Of Day
Hi all,
I have this project that I'm working on and there's a slight issue with the side menu. I need it move according to what time of the day it is... ie. in the morning mc._y = 50; afternoon mc._y = 0 and evening mc._y = -50;
How does one go about referencing the getTime (or getHours, getMinutes) command with a variable? Should it be compared as a numeric or a text string? And in saying thus, I'm sure I just lost a lot of people. I'm sure how else to put it. Hope someone can figure my mud out.

[CS3] (AS2) Math-based Movement
Hi guys.

I need a bunch of movieclips to move like this:



- I'm not very good with the Math-stuff, so I need a big hand here.


What I'm after must be something controlling how far up the y-axis the mc is, and somehow slowing it down, ultimately pulling it down the y-axis until the opposite situation is reached and so forth..
Does it make sense?

I would paste how far I've gotten, but it's really no more than mc._x -= 10;


Cheers,
Rasmus Landgreen

Movement Based On 2 Variables...
I wasn't sure how to title this problem...anyway, the scenario is as follows...
The user drags 2 charged particles (ParticlePositive1_mc and ParticlePositive2_mc) to a ruler...when they come into contact with the ruler (HitTest_mc), a hitTest is run to determine if they're both on the ruler and then their location in relation to each other is checked to determine which direction they are to begin traveling...(it's for an animation demonstrating like particles repel and opposite particles attract)...
Everything works up until when the movement should begin...here's my code...

Code:
ParticlePositive1_mc.onPress = function() {
this.startDrag(false, 213, 50, 574, 294)
}
ParticlePositive1_mc.onRelease = function() {
this.stopDrag()
if ((this.hitTest(HitTest_mc)) && (ParticlePositive2_mc.hitTest(HitTest_mc))) {
delete this.onPress
delete ParticlePositive2_mc.onPress
if (this._x < ParticlePositive2_mc._x) {
this.onEnterFrame = function() {
this._x = this._x--
ParticlePositive2_mc._x = ParticlePositive2_mc._x++
}
}
else if (this._x > ParticlePositive2_mc._x) {
this.onEnterFrame = function() {
this._x = this._x++
ParticlePositive2_mc._x = ParticlePositive2_mc._x--
}
}
else if (this.hitTest(ParticlePositive2_mc)) {
this._x = this._x
ParticlePositive2_mc._x = ParticlePositive2_mc._x
}
}
}

Delay Based Movement
Hi,

Heres the deal. Im making a news scroller that loads in news from a php file and creates a textbox for however many headlines I have. So when you enter the frame it creates the boxes and then will display one at a time, wait 5 secs, and then move up ~20px and the next one will move up also and then repeat.

basically my problem is that I dont know how to make it delay, I can make it move and import the variables and everything but I cant make it delay.

Im also having a problem with it recieving hte number of records. I recieve the variable but its a string and not and Integer so it wont calculate, but for right now im just setting num=5 (num being the number of text boxes it's supposed to make from teh records) so if you can help me with that also, it would be appreciated.

Thanks

Delay Based Movement
Hi,

Heres the deal. Im making a news scroller that loads in news from a php file and creates a textbox for however many headlines I have. So when you enter the frame it creates the boxes and then will display one at a time, wait 5 secs, and then move up ~20px and the next one will move up also and then repeat.

basically my problem is that I dont know how to make it delay, I can make it move and import the variables and everything but I cant make it delay.

Im also having a problem with it recieving hte number of records. I recieve the variable but its a string and not and Integer so it wont calculate, but for right now im just setting num=5 (num being the number of text boxes it's supposed to make from teh records) so if you can help me with that also, it would be appreciated.

Thanks

Movement Based On Position
I am trying to move a movieclip based on its and another clips position on the stage. I have this so far, but it is not working. Is there a better way to do this or am I just missing a critical piece that is causing this to not work?
Code:

work_mc.onRelease = function():Void{
    if ((this._y = 442.4) && (firm_mc._y = 459.9)){
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
   } else {
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
      new Tween(firm_mc, "_y", Strong.easeOut, 403.4, 459.9, 1, true);
      firm_mc.gotoAndStop(1);
      }
};

Movement Based On Mouse
Hi,
Looking for a tutorial on this:
When the site loads up and the logo block moves around based on where the mouse is.
http://www.karimzariffa.com/

Thanks!

Object Movement Based On Variable
I have a certain movie clip moving on actionscript.
onClipEvent (enterFrame) {
if (Key.isDown(Key.DOWN)) {
_y -= 10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_y -= -10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x -= 10;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= -10;
}
}


How could I use a variable to get this to work?

Tile Based World Movement
OK I got the map working..
got to making multiple mcs and attaching them correctly
selecting them
deselecting them
deleting them..
and moving them, well not all the way...
So what I have so far here is:This beta/alpha/not done yet thing..

If you check it out you'll see that it can move after being selected
but.. it wont move if there's a tree in front of the soldier(pathetic drawing .. I know just working on the engine..)
and another thing is that some times it just go crazy and leave the stage..
and one last thing that i might be able to fix is that it can move to the same tile where there's another soldier...

well I need some help in the moving algorithm(witch is not an algorithm now.. but still )
and.. why the thing is going crazy
when anyone here is interested in helping ill post the code or the fla or both :P

ok well hoping for a responce

How Do I Play A MC Based On The Mouse Movement?
Hi everybody,
How do I make a MovieClip play based on the mouse movement? Like if the mouse is stopped, the movie clip stays in one frame, and when you start moving the mouse, it goes to the next keyframe continuously till you stop the mouse again.
Thanks a lot!

Scrolling Based On Mouse _x Movement
in case SPOCK doesn't get back to me, i was hoping one of you fine folks could help explain this script.

onClipEvent (load){
xcenter=400;
speed=0.4/10;
}
onClipEvent (enterFrame){
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-1893;
if (_x < -1893) _x=0;
}

I assume you'd attach it to the mc. but what other properties should this mc possess? what is the significance behind xcenter? i'm sure i could play with it all day and figure it out. but i'm pressed for time and i really want to get this site done ... and move on. help. thanks. -b

Object Pan Based On Mouse Movement
I recently found a nice tutorial for image panning based on mouse movement in AS 2. I'm still getting aquainted with AS 3 and am not getting the expected results after conversion.

As some background, I have a horizontal bar (divided into five sections) at the bottom of my stage that is going to serve as a menu bar for loading different flash movies into a player. There will be five different "chapters" to choose from but only three can show at any given time in the menu bar via a mask on top of it.

My goal is to have the menu bar pan to the right or left depending upon the direction you move your mouse over it, but the bar should not go past its left-most and right-most edge (the left-most edge of the bar should not go further right than the left-most edge of the mask; the right-most edge of the bar should not go further left than the right-most edge of the mask). I apologize if that explanation is confusing.

Code:







Attach Code

chapterBar_mc.addEventListener(MouseEvent.MOUSE_MOVE, panChapterBar);

function panChapterBar(e:MouseEvent):void
{
var dir:Number = 1;
var mousePercent:Number = chapterBarMask_mc.mouseX / chapterBarMask_mc.width;
var mSpeed:Number;

if (dir == 1)
{
mSpeed = 1 - mousePercent;
}
else
{
mSpeed = mousePercent;
}

e.target.addEventListener(Event.ENTER_FRAME, determinePanBounds);
e.target.destX = Math.round(-((e.target.width - chapterBarMask_mc.width) * mSpeed));
e.target.enterFrame;
}

function determinePanBounds(e:Event):void
{
var speed:Number = 4;

if (chapterBar_mc.x == chapterBar_mc.destX)
{
delete chapterBar_mc.enterFrame;
}
else
{
chapterBar_mc.x += Math.ceil((chapterBar_mc.destX - chapterBar_mc.x) * (speed / 100));
}
}

Tween Mouse Movement Based On...
Searched the forum and couldn't find the mouse movement using the ._x/._y tween class to move based on another mc's dimension to give me the idea how to work on it. Could use some help here to nudge me the right direction...

jace

Easing In And Out For Actiocscript Based Movement?
hi there.

i've figured out how to move objects with actionscript but am having trouble pushing it a bit further.

i'd like to:

a) ease in and out with actionscript

and

b) have the object move to a certain distance, then move back.

Can anyone help me with these ideas?

thanks for the help!!!
S

Mouse-Based Image Movement
Ok, I've searched all around for a tip, maybe I'm just not searching for the right terms...

Basically, I'm trying to create an image that scrolls left or right dependant on mouse position on that clip, subtle closer to the origin and more acceleration as the mouse is moved to the border.

Any thoughts? Examples?


Thanks!

SB

Movement Based On Position On Stage
I am trying to move a movieclip based on its and another clips position on the stage. I have this so far, but it is not working. Is there a better way to do this or am I just missing a critical piece that is causing this to not work?

ActionScript Code:
work_mc.onRelease = function():Void{
    if ((this._y = 442.4) && (firm_mc._y = 459.9)){
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
   } else {
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
      new Tween(firm_mc, "_y", Strong.easeOut, 403.4, 459.9, 1, true);
      firm_mc.gotoAndStop(1);
      }
};

Stage Movement Based On Mouse Position
Hi, I'm looking for the stage (An MC) to move in the opposite direction of the mouse to allow the user to browse the entire image. I want it to ease in and out when it gets to close to the mouse or to the edge.

Basically I'm looking for http://www.bobscube.com/ type effect exactly.

I've played with code to move mc's based on the mouse position but I'm clueless on how to stop the image when it reaches a certain point and to have the easing work both when your close as well as when your far.

I've tried a number of different things which is why I'm not posting anything. Everything had a flaw.

Thanks in advance

[flash MX] Actionscript Based Random Movement From X1,y1 To X2,y2
I can do normal movement, or accelerating and decelerating, and just random, but the issue I'm having is a random-ish type of movement that still manages to wander across the screen from point a to point b.

Is this doable?

Scrolling Screen Based On Mouse Movement HOW?
Hello all,
I am trying to solve how to make the content of my scene scroll left or right depending on mouse movement whether it goes left or right from the middle. Also the more to the left edge of the screen you get from the middle the faster the screen scrolls. This is for the game.

Many thanks for any help. Best idea on what i am trying to achieve is to look at http://www.4x4.mercedes-benz.ru/flashindex.php the site is in russian but just click through and you will get in. :)

Scrolling/sliding Images Based On Mouse Movement
Does anyone have a link to a good tutorial on creating scrolling/sliding images that react to the users mouse movement? Ideally, the images would scroll right to left on their own but when the user mouses over they would control the images scrolling left or right. Any help would be great.

Hour Hand Movement Based On Senocular Code
Hi all, Hi Senocular,

I´m trying to replicate the movement of the hour hand of an analogue clock, I am using Senoculars excellent code for the mouse to minute hand movement, but I can´t seem to get the right equation for the hour hand. The idea behind this is that I would like the user to have the ability to set the time base his/herself by moving the clock hands.
the code:


ActionScript Code:
// On the minute hand
on(press){
    trace("minute");
    dragging = true;
    orig_mouse_angle = Math.atan2(_parent._ymouse-_y, _parent._xmouse-_x) * 180/Math.PI;
    orig_rotation = _rotation;
    _parent.hourhand.orig_rotation = _parent.hourhand._rotation;
    orig_x = _parent._xmouse;
    this.gotoAndStop(2);
}
onClipEvent(mouseMove){
    if(dragging){
        curr_mouse_angle = Math.atan2(_parent._ymouse-_y, _parent._xmouse-_x) * 180/Math.PI;
        _rotation = orig_rotation + curr_mouse_angle - orig_mouse_angle;
        _parent.hourhand._rotation = (_parent.hourhand.orig_rotation + curr_mouse_angle - orig_mouse_angle)/60;
        updateAfterEvent();
    }
}
on(release,releaseOutside){
    dragging = false;
    this.gotoAndStop(1);
   
}

Dividing the rotation angle of the minute hand and assigning it to the hour hand does not work as expected. Any ideas?
I appreciate your anticipated help.

Thanks

How To Make Circular Movement Based On Ouse Axis ?
Hello,
I have a round arrow on stage (like half of a circle) and I want to make it turn left when mouse moves right and vice versa. How to accumulate this turning thing ? Thanks for help

Dynamic Image Animation Based On Mouse Movement
Hi All,

We have made a dynamic image animation using xml. We are attaching the source code herewith. At present, when you place your mouse over the images, the animation will start backwards. I.e., it will reverse the way the images are loading.

We want this animation order (normal and reverse) to control based on the mouse movement. By default, now the images are animating in one direction. That is fine now. But, we want the animation should get reversed when you place your mouse at bottom of the page. And again when you move the cursor towards top of the page, animation should again start as normal (vice versa).

Any idea how we can achieve this task using mouse placement?

Thanks in advance.

Krishhhhh

How To Make Circular Movement Based On Ouse Axis ?
Hello,
I have a round arrow on stage (like half of a circle) and I want to make it turn left when mouse moves right and vice versa. How to accumulate this turning thing ? Thanks for help

Mouse-movement Triggers Background Movement - Help Me Find Tutorial
I want to learn how to make an image react on my mouse-movement, so you get the effect as if you're looking around. You move the mouse to the right, and the image on the screen moves to the right, etc. I've seen an example of that on http://www.center-of-the-world.com/ - but I don't know how to find a tutorial for that on the Flashkit-site. Can anyone help?

Capturing Mouse Movement/locking Out A Direction Of Movement
does anyone have a good solution in AS 2 for simulating horizontal and vertical finger gestures like on an iPhone?

I have a Mouse listener that calculates movement in both directions and whichever one is larger in value (primary movement of mouse) then it locks out the other using a boolean value. And then once the mouseUp event is triggered, it sets the values to true again to listen for another horizontal or vertical gesture movement.

the problem I'm running into is that every once in awhile while I'm "gesturing" or moving the mouse in a particular direction, I'll get some funky results which clues me into that the other direction might not being totally locked out.

Make any sense?

Flowing Mc Movement Opposite Of Mouse Movement
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. Can anyone help me out? Thanks.


onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
diff=mymouse-_root.fStrip._xmouse; //find amount of movement
_root.fStrip._x-=diff/buffer; //buffer & set strips movement
updateAfterEvent(); //adding this makes the movement cleaner
}
}

Sluggish Movement With ActionScripted Movement...
I really enjoy using the following bit of code for quick little flash animations:

=======================================

onClipEvent (load) {
_root.targXscale = 50;
_root.targYscale = 200;
}
onClipEvent (enterFrame) {
cXscale = this._xscale;
cYscale = this._yscale;
difXscale = cXscale-_root.targXscale;
difYscale = cYscale-_root.targYscale;
setProperty(this, _xscale, cXscale-(difXscale/5));
setProperty(this, _yscale, cYscale-(difYscale/5));
}


=======================================

It comes straight from the tutorials ("Basic Animation via ActionScript"). Anyways, whenever I view the .swf (via IE) on my computer (2.4 Ghz / 512 MB RAM), it looks great... better than great... it looks AWESOME! But, if I check it out at work (550 Mhz, 256 MB RAM) it looks terrible. It's choppy, mouse movement is sluggish, and the entire animation looks like it's running at 1 or 2 FPS.

I know it can't be completely dependent on the computer speed, b/c I've seen other flash sites that look great on the slower PC. Even some of the non-scripted movements are sluggish on my work PC... what the?! Is there a snippet of code that would / could help?

"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 Of One Object Dependant On The Movement Of Another Object
I am trying to get the browser to move the levers which in turn moves a constant laser beam.

The two levers control the beams position if you move the top beam it moves left to right, and the side beam controls the horizontal movement. I only want the beam and the levers to be moved to the following.

Horizontal lever between positions 10 and 2 o'clock (the levers rotate at a central point)

Vertical lever - between 2 and 4 o'clock

The laser beam to be moved anywhere in the red circle but once the lever is not being moved then the beam also stops moving.

I appreciate this is a big ask and would be grateful for any help

Please see attached.

Falling Snow Based Animation
Hi all,

I have an animation based upon the excellent falling snow tutorial. My animation is falling leaves. Now, in the falling snow tutorial random rotation wasn't a problem because all the objects were circles. I'd really like randomness in the leaves, I've added a line of code to the original AS - it should be in bold... am I on the right track?


onClipEvent (load) {
// specifies the size of the movie stage
movieWidth = 600;
movieHeight = 500;
// variables that will modify the falling leaves
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
// giving each leaf unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._rotation = this._rotation=360+Math.random()*100;
this._alpha = 60+Math.random()*100;
this._x = -15+Math.random()*movieWidth;
this._y = -15+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
// putting it all together
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = -5;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*movieWidth;
this._y = -5;
}
}


What can I say I'm just not a coder.

Falling Snow Based Animation
Hi all,

I have an animation based upon the excellent falling snow tutorial. My animation is falling leaves. Now, in the falling snow tutorial random rotation wasn't a problem because all the objects were circles. I'd really like randomness in the leaves, I've added a line of code to the original AS - it should be in bold... am I on the right track?


onClipEvent (load) {
// specifies the size of the movie stage
movieWidth = 600;
movieHeight = 500;
// variables that will modify the falling leaves
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
// giving each leaf unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
this._rotation = this._rotation=360+Math.random()*100;
this._alpha = 60+Math.random()*100;
this._x = -15+Math.random()*movieWidth;
this._y = -15+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
// putting it all together
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = -5;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*movieWidth;
this._y = -5;
}
}


What can I say I'm just not a coder.

Arc Movement Via AS?
Anyone know a way to make a MC move in an arc to a specified location no matter where it is on the stage - via AS? - I can do the straight line movement but the MC will be in a random location and need to "arc" into the new position - any ideas? Thanks AGAIN!

Movement
|-----[rectA]-------------------[rectB]-------------|B
A

can someone pls teach me how could i make 2 rectangles slide along a straight path( those ----) and when they collide they will move in the other direction. collision also occurs when rectA reached point A and rectB reaches B.



also..how can i change the speed of the movement ?

thanx alot

Movement
im trying to make something move horizontally about 20 pixels when rolled over and then go back when rolled off, how can i do this?
Thanks in advance

Movement
I made a movieclip that has actions in it to move left and right when you press the left and right keys. but i want the movieclip to not be able to move right at a certain pixel in the movie... Can any experts tell me how i could do it?

Eye Movement
Hi I am new here but not to FLash I know I good amount but I want to know how to make characters eyes move when you have your mouse over the flash anim. I see a lot of examples in it in peoples sigs. If you culd tell me, or direct me to a tutorial I would greatly apreciate it.

MC Movement?
Is it possible to move a MC with an onClipEvent?

I just do not want to use an actual button to trigger the movement.

My reason is because I do not want my cursor to change with that silly hand icon.

Any help would do,
Preston

Movement Help
(Flash MX)


i was lookin at the tutorial on how to build a starship game or somethin lie that and it shows you how to move the ship with the arrow keys. well i got that down but i want to know how to get it to stop at certain points, kinda like the constrain to rectange option on the startDrag

also im workin on another one (im just getting into games so i really dont know what im doing)with a plane as the "custom cursor" and when you click it fires and when you let go of the mouse button its supposed to stop, well it works except i have it "constrained to rectangle" and if i try to click while at the edges of the rectangle it wont fire. i've uploaded the .fla to http://www.geocities.com/unicoscc/plane2.fla
in case anyone wants to take a look
(dont forget this is my first venture into gametype stuff and i've only looked at that one tutorial and the in program help so if it looks nappy thats why)
any help is appreciated even if you tell me the movie is set up completely wrong (which i suspect it is)
thanx RegalKnight

Movement With As
I have a pair of mc´s some are part of a menu and other are just objects , i like to move those to a specific location with as , but with inertia, a soft movement.
which one is the easy way?
thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved