ActionScript 2.0 :: Set Boundaries For The Y Coordinates Of A Falling Box With Gravit?
May 20, 2004
how to set boundaries for the y coordinates of a falling box with gravity. i am using the gravity AS, and i could not find a specific tut for setting the floor boundary.
how to set boundaries for the y coordinates of a falling box with gravity. i am using the gravity AS, and i could not find a specific tut for setting the floor boundary.
I have some code here for some falling leaves. I was wondering how it can be altered so there is a delay between a group of leaves falling and the next group falling? also to slow down at the end of the fall? [code]
I was trying to convert global coordinates to local coordinates of a UIComplenent in my flex project using below code using below code
var gp:Point = new Point(e.stageX,e.stageY); //global point var lp:Point = uic.globalToLocal(gp); //local point
uic is UIComponent in which I have subclass of Sprite for drawing something I have set the sprite's mouseEnabled and mouseChildren to false to not interrupt the mouse event. above code is within uic's mousemove event where I was tracing the gp and lp gp was giving correct value and suprisingly lp was giving negetive values. when I move the move to the top left corner of uic i expect lp to be 0,0 but it is giving the -width of of uic. I broke my head for hours and ended up finding an alternate by using offsets. Infact my original code was much simpler like this which was same issue
var lp:Point = new Point(e.localX,e.localY);
I am not sure what exactly is causing this problem. the workaround had lot of issues and it creating a mess in my rest of the algorithms.Just now I found even more interesting thing (which is actually weird). for some reason I went and create a new lp2
var lp2:Point = new Point(e.localX,e.localY);
now surprisingly it was giving correct values as expected and I went back and changed the code as
var gp:Point = new Point(e.stageX,e.stageY); //global point var lp:Point = uic.globalToLocal(gp); //local point var lp2:Point = new Point(e.localX,e.localY); var lp2:Point = uic.globalToLocal(gp);
now it is expected to have all the lp, lp2 and lp3 variables to be same but weiredly lp two is giving wrong value and lp2 and lp3 were giving correct. I am suspecting using the variable lp has something to do. I am not sure about that but above proves it so right now I am using lp2.
I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:
transforms x,y,z coordinates into Flash x coordinate xFla = function (x, y, z) { // cartesian coordinates[code].....
I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:
red line style(1, "0xFF0000", 100); plot(0, 0, 0); draw(200, 0, 0);
Im making a little app in flash using papervision I want to make a regular movieClip show up in the same place as a papervision object. The coordinates seem like perspective is affecting the number displayed.
I did the excellent tutorial on Falling Snow for Flash CS4/AS3 on this website.I now want to add further graphics and animations to the snow for an e-card I'm creating.I have tried to add to the timeline and animate a logo, but then the snow just flashes on and off in one piece. Is there a way I can make the snow fall, say, halfway through my animation so I can add other things to it?
i am looking to make something like this for my page.[URL].. i can do all the vid work etc.. the thing im stumped on is how can they resize the working area it uses eg.. where the presenter comes up.. because to start with the swf looks like its only tiny little play start stop thing then it loads the clip outside of those boundaries?
What i am trying to do is move a MC around by dragging it, but i dont want the MC to move so far that it could be lost on the stage. i need some sort of parameters so that the MC is always showing. basically i have a large map of the united states and i want to be able to move it around and look at the individual states. the map is much larger than the stage and i am using a mask to clean up the appearance. i just want to make sure that the user cant move the map so far in one direction that it gets lost.
I am attempting to create a map that has the ability to zoom in and out as well as a click and drag feature.What I need help on is setting boundaries for the map. I can set them for the map when it is zoomed out, but they need to change as the map zooms in. I've been searching lots of forums lately to see if anyone can help, but no luck yet...
I can't find any info on this so I guess I'll just ask. I'm trying to make moveclips that will follow the mouse pointer on MOUSE_OVER but only up to a certain distance then tween back to its original coordinates (preferably with a bounce or elastic ease).I tried startDrag(); on mouse over and that works quit cool but the problem is stopping the drag...
I have been working with some code back and forth but am pretty much stuck now! I have four movie clips of different colored cars - two on the left side off the stage, and two on the right side off the stage. The clips move across the stage to the right and the left respectively. I have all the elements that I needed to get working, but now I am stuck because the animation only plays one time. I need it to play over and over again, never stopping. I tried to "reset" the _x boundary for each movie clip since they are in different starting locations, but have not been successful. Below is my code and I also attached a screen shot of how the clips are positioned so you can see how they will cross the screen.
Code: var loop:Number = 0; var messageTxt:TextField; var mc_name:String; function time():Void {
I have this code that I got from this site and I figured out how to stop the falling snow but it just disappears with remove moviclip function. Is there any way to have the snow fall to an end instead of just disappear? So it looks more natural? I would even take a fade to alpha =0. I have attached the .fla file for viewing.
I've done the tutorial on falling snow but what I really want it to do is fall upwards... like bubbles on water.what part of the code I need to change...
I'm using Flash MX and am following the falling snow tutorial in the actionscript section. What I'd like is for the snow to move from right to left, but still with the random y position.This code gives me snow (particle) moving right, left, and right again but most ends up along the top (y value of 0).
onClipEvent (load) { //specifies the size of the movie stage movieWidth = 131;[code]....
is it possible to have the snow moving from right to left?someone had designed something completly sideways as they were rotating there monitor 90 degrees instead of buying a video card that would do it for them.
I have this movie where there are dynamic buttons generated. When you click on one, a window(movieclip) slides in over them. All is well and good. However, the window covering the buttons does not stop you from being able to click through it and onto the buttons below. Is these anyway to tell the window to disallow this, or am I going to have to loop through the buttons and disable them when the window is open?
You notice that their are 'particles' falling from the position of the mouse but for some sort of stupid reason they get stuck at a certain point in time.
Also, the three white bars are dragable, but i want them to swing back in to place when you release them. Is this also possible with a tween ? or do i need to code something physic-like.[code]...
I'd like to ask if anyone knows how to create words (example Merry Christmas) from falling snow. I'm trying to build a xmas card and the customer wants the wishes to be created from the snow leafs.
I'm not very knowledgeable in terms of actionscript and I would like to know how I would go about into modifying a function that is currently running?I'm using falling snow 3.0 in the first frame of a movie :
The actionscript is applied on my FLA successfully. Here is a brief description :(a) frame 01 to 30 : without snow effect(b) frame 31 to 99 : snow effect appliedThere is no problem at all when the SWF is run for the first time.
take a look at my fla file? There has got to be an easier way of reproducing my snowflake movie clip? I don't want to get bogged down with AS just want a very simple example of falling snow. Using CS5 and CS5.5. Novice so please keep it simple to follow.
i am creating a game where the user has to collect random falling objects from sky .. i canot get the objects to fall random and be collected with a hittest
This project I am working on needs a top view on a snowstorm. I was thinking I can use code similar to a starfield coming at you, and then modifying it so that the objects start from around you and fall towards the center. (opposite direction). However, when I change the code the way I believe I need to, I get the right thing to happen but not to regenerate. It happens only once, and once they reach the center, they don't recreate around the edges of the screen. Here is the code I am using from a simple starfield tutorial:
_global.ppDist = 700; _global.speed = 50; //update function to handle perspective projection and scaling
how this tutoiral works:[URL].. i understand the ideas behind the script and what you are asking flash to do. the thing is my maths isnt that great. if someone could explain how some of the equations work, that would be excellent
examples: this._alpha = 20+Math.random()*50; ok, randomising alpha. got it. but where do these numbers come from? how did you reach them?
I need to animate little blocks to fall down when rollovered... but i want them to start falling and keep falling once mouse hittests with it... so when the mouse isn't over the clip... it keeps falling... does anyone know how i can do this? and if anyone knows some good actionscript for elastic falling with slight rotation that would be sweet....
I have a pointer that follows the mouse movement only in determined angles. lets say the pointer can only follow the mouse when the mouse is moving below the pointer. (it rotates perfectly and smoothly to the left and right) but the thing is, lets say that the mouse is now above the pointer to the right, the pointer stays to the last permited right/down angle BUT if i go down with the mouse from the left, the pointer obviously will jump from facing right/down to facing left/down...what i would like is the pointer to make a nice transition/rotation to the inverse side...just what it does when moving the mouse from left to right, right to left (having the mouse below the pointer).