ActionScript 2.0 :: Make A Symbol/instance "bounce" Off A Wall
Jan 19, 2010
Attached is the red blood cell (rbc) animation. Each rbc is derived from the same symbol under multiple instances. And they all move randomly in the same x direction at random speeds. Unfortunately, I am unable to code for an arterial wall (ie. a boundary) so some of the rbc's end up leaving the animation at the wrong point (eg. from the top and bottom, instead of the right side).
I have two boundaries (named "top" and "bottom") but would like some help with AS2.0 to make these boundaries active rather than a part of the background. The code is inserted below, however it may be better to take a look at the actual fla:
Imagine loop that contains a ball_mc that bounces off walls for how ever long the loop. I am asking what the math part would be to make the ball_mc bounce off at the correct angle and such.
I am familiar with hit test, but how do you make a ball bounce off a wall with the same angle that it bounced on it with?ex. it hits the wall at 45 degrees, and it bounces off the wall at 45 degrees
i want to make a ball move at a constant speed into a wall and bounce of, initially it should move back but then It should carry on moving towards the wall.
I managed to make it bounce but once it hits the wall it carries on in the opposite direction!
I have a symbol that I have already used and I would like to use the same symbol in another frame(s), except that when i edit the symbol the original object also edits, for example if i delete a part of it, it also deletes in the object that I have already placed, I have tried the 'duplicate symbol' method but nonetheless my symbol still gets modified and changes the way I want it to show it in certain frames.
I want to make a new instance of an existing symbol (movie clip or graphic) when an object hits the side of the stage. I have the code to figure out if it hit the side of the stage, i just need to know how to make a new instance and make it show up where the ball hit. I also want to be able to have multiple of these instances on screen.
I would like to make a dynamic text field wich write the instance name of the symbol when the cursor is over one. I have more than 1300 symbols so it would be a really big help if I wouldn't have to write thousands of lines.
I have a project in Flash Professional CS5 and ActionScript 3.
I have a movieclip symbol (referred herein as "background" with scripts on various keyframes inside of that symbol. I need to hide or show another symbol (referred herein as "object") sharing a stage with "background".
To put it another way, I need "object" to be hidden when "background" reaches a certain internal keyframe. However, as "object" and "background" are both children of the same stage, how do I do this?
My problem is quite simple but I havent found a way to solve it yet. I want to make my symbol/instances (dont know the difference) transperent. And, when I have a button, I want only the button itself to be clickable not a bit of the white space around.
When I draw something directly in Flash it seems to work fine just as I want it, but I work in paint for the moment and will be using Photoshop too, so then I cant use just Flash's tools.
I followed the bit101 tutorial on gravity and now have a movie clip called "ball" (instance name) with an embedded invisible button (so you can throw it all over the place).I also have a movie clip called "block1" (instance name too! what a coincidence, isn't life lovely). I want to make them collide, and make the ball bounce away.
Okay, so I have a movieclip of a letter (done in photshop to look like jelly). I want to animate it to fall from above, bounce on an invisiable plane, squash when it hits, and squash and go back up and decrease it each time until it comes a rest.I have the bounce but I need to squash.
I am just restarting my flash adventures and am trying to learn AS3. I can a real quick code request. I am trying to make a MC bounce off the sides of the stage. When I use the following code, the MC gets stuck going -2 then +2 at the edge of the stage.
[Code]....
How do I get it disregard the first part of the if/else and then go the other direction? know this is a really beginer question,
this will make your movie clip bounce. that i need to know is why does it bounce. i cant quite get my head around it. i start of and accelerate, hit 300 on the stage but then go up decreasing my speed by 0.8 every frame..
I have this game, got various levels. The point of the game, is you have to shoot all the zombies in the level to proceed. But I need it so the 'cannonball' bounces of the walls so there is more of a chance to hit multiple zombies.
Incase you wanted to see my document class here it is below.
So I am trying to get a ball to move around the screen, and when it gets to the walls of the stage I want it to change directions. So far, I have this code:
Code: import flash.events.Event; var ballVelx:Number = Math.random() * 15; var ballVely:Number = Math.random() * 15; var ballDirx:Number = 1;
[Code].....
This is not in the main timeline, it is in the symbol timeline for Ball. With this, I have the ball moving around and when it reaches the end of the stage it resets with a random velocity/angle. When I uncomment the ballDirx and ballDiry lines and comment out the this.x = 0 line, the ball doesn't change directions, it just stops moving when it reaches the end of the stage.
I have a number of random balls bouncing around the stage.What I am having difficulty with is making them bounce off each other when they run into each other.The balls bounce off the walls just fine, but I can't seem to figure out the hitTest thing.
I haven't done much actionscript stuff ...and at the moment im trying to make a ball bounce across the stage, but im unsure how to go about doing that.
I'm having problems with my flash game, i am making slimeball and im using the hitTest to make my ball bounce off of the players, but because my players are semi circular when it hits off the back of my player the ball still goes forward when it should bounce off the player in the direction that it came from, if that makes sense
I haven't done much actionscript stuff ...and at the moment im trying to make a ball bounce across the stage, but im unsure how to go about doing that.
I am currently working on a game and I am stuck. I do not know how to make a rounded surface that will act as a wall/barrier. It is pretty much a semi-circle. I know you can make a circle act as a barrier but I would need to use the perimeter of the circle. Also is there a way you can make an actual image a barrier? I am new at this but I know from reading up that making a rounded wall is pretty tough. I am going to use this wall to make a ball bounce or "roll" around it. Below is a picture of what I am trying to do. The black dot is the ball.
All I really need is to make a post to the Facebook wall of the user from flash movie.Been trying to find any decent tuts for Flash IDE but everything seems to be for Flex mainly.
im trying to make a custom cursor that when it hits a wall it bounces off and i cant seem to get the right AS. ive got the cursor and i can write AS for a hittest. ive typed in
This bounces the ball off each 'wall'. how to add more balls (using actionscript - ie not copying and pasting on the stage) and to make the balls bounce off eachother too?