ActionScript 3.0 :: Get A Mc To Move Around The Screen At Random?
Oct 20, 2009but i have a problem i am triing to get a mc to move around the screen at random and bounce off the walls so it doesnt go off screen
View 1 Repliesbut i have a problem i am triing to get a mc to move around the screen at random and bounce off the walls so it doesnt go off screen
View 1 RepliesI am using the random motion code found here at Kirupa. [URL]I have the code working fine but I have a question about fixing it to my needs. The way it is now, you change the height and width variables so that the objects don't move off the screen. This works fine, if you are using the whole screen area at:
[Code]...
tutorial where when you click on a movie clip it moves to a certain location on the page and then zoom in and makes it a certain size. Also i want it to move back to its original location if you click it again.I want the move and zoom to be smooth so the users can see it move across the screen then gradually get bigger.
View 5 RepliesI have a picture on the stage covered by 12 squares (sq1, sq2, sq3.......sq12)
When the movie opens I want the squares to move down, but i want a random sequence ( 3, 9, 2, 12...........8). I already made de function for the movement:
[Code]...
I am having some dificulty making a path for this enemy i'm trying to create... cause i want him to rotate + move, then stop, then shoot, then rotate back and move off screen... Its easier if you see it.. you can download the swf file in the zipped archive to demonstrate what i mean. I did it there with tweens. Anyway.. i tried and make it but i'm a little stuck on the stopping part... you can also see what i did in the fla file attatched...
View 1 RepliesI'm getting into flash and am having a great time. I'm working on games and want to join a community that is active that I can hopefully learn from and contribute to. It will be a few months before I can probably be of much help but I certainly hope I can learn more from the thread. With introductions out of the way...I can't get a simple MC to move given this code:
ActionScript Code:
clickTest.addEventListener(MouseEvent.ROLL_OVER, rolldown);
function rolldown(event:MouseEvent):void {
[code]...
I found a cool 3D menu at developphp.com and want to fit it into my hud. I can get the button navigation working, add internal animations (eg, glowing) but for some reason I can't get the dang thing wired to a button.I put the object in another MC container with the hopes of accessing it that way but no luck.
I am making a small flash game where my character releases a balloon into the air. I can get everything to work but when the character produces a balloon it will not float towards the sky. The code is below:
Code:
stop();
var tobpos:int;
tobpos = toby.x
[code]...
I've tried doing a loop but it gives me an error telling me that the script has run for too long.
I'm making a game like Super Smash Bros., and so far it's pretty good. However, I came across one problem: I can't get the camera to move. Basically, I somehow want the camera to always show 100% of everything on the screen. If a character goes really far down, I want the camera to zoom out. If they're next to each other, I want it to zoom in. How do I do this? I didn't get a single dang response to like the last 4 posts I made.
View 2 RepliesI have just re-installed Flash CS4 onto two Vista machines (laptop and desktop) and the response time of the authoring screens is ridiculously slow on both. For example with the Actions Panel displayed, it takes 18-20 seconds to move the cursor along a line of code.
All other CS4 appilcations such as Photoshop, Fireworks and Illustrator all work very well and have no such problems. The computers have plenty of hard disk space and RAM (eg. Acer Aspire Desktop new computer with 1Tb disk and 3Gb Ram) and the CPUs are running at less than 50% (task manager) and there are no other apps running. I have disabled Kaspersky Internet Security 2010 with no effect.
This the code to move my hero mc around the screen However, when you click directly under or over the mc it doesn't move. When I say directly above I mean the angle not the distance. ie: I am well above the mc but it doesn't move. Little kids are going to play this and it needs to be more responsive or they get frustrated.
[Code]...
I've 3 different MovieClips that I need to move at the same time across the screen. (From bottom to top) What is the best way of doing this without using a tweening class like Caurina?
View 2 RepliesI have my character movement down, and now I want the create a map. I want the screen to move with the character, and eventually I will have it so that at certain spots on the map, the screen will not let you move and stop and enemies will come out.
View 0 RepliesI've created a walk cycle using bone tool on a character but i don't know how to make it move from one part of the screen to the other. The character is made up of 6 layers, 4 of which are armatures and 2 have motion tweens.
View 1 Repliesi saw some site tat can make the whole screen move and it look interested, sample site below
View 3 RepliesHow exactly do I cause the screen to move in time with the players character?
View 5 Repliesive made an xml slideshow on my application however when i try and move to another screen the slideshow keeps going in the background this is the webite of the tutorial i used:
[Code]...
I'm programming a game in as3 using flashDevelop the player (among other things) is moving across the screen using EnterFrame event which update his coordinates while he moves its hard to see details of the animation and its look kinda blur how do i fix this problem?
View 3 RepliesI have implemented a pan and zoom function on my code.Whern I zoom in all components look perfectly rescaled, all shapes and lines.
However my text becomes pixelated and isn't redrawn. Is there a method to make it appear smooth and readable even when I zoom in or move the screen around from its original position?
Hi, I am tring to make an object move across the screen randomly..I want it move up-down left or right acording to the values created..for example I want my object move between value (-5 and +5 ) whats wrong with this ? because it always moves downward ???
[Code]...
I have various instances of an object that I want to animate.
Code:
var obj = new obj_class();
I'm using the Tween class to move them around the screen.
Code: var tw:Tween=new Tween(obj, "y", None.easeNone, y1, y2, framerate);
tw.addEventListener(TweenEvent.MOTION_FINISH, removeObj);
addChild(obj);
I start the animation on a button press.Code: stage.addEventListener(KeyboardEvent.KEY_DOWN,key_down); When I click the button the animation of the instances seems ok, but if I click the button quickly sometime the animation doesn't end, the object seems freezed in the middle of the screen and also the MOTION_FINISH isn't called.
making a game, and in html, on press arrow key up or down, moves the object and the screen
View 2 RepliesKinda of new to all this Flash stuff and need some help working on an animation. I want to have four circles move around the screen randomly. When the user moves his mouse over a circle, I would like it to stop and be bale to use it as a link.
I have used the Flash MX script off the site and can get the circles to move about fine. Just haveing some problems getting them to stop when the mouse is moved over them, and making them into links.
I want to make a movieclip move on random sine wave. (sine path)I m trying to do this for a week and cant get it good.I want to make the curves random. and acceleration too.(it will be a fish like character swimming)Like as in this game : http:[url]..........(the small character which swim and move smoothly)this is the portion of code im using now.
var tempEnemy:MovieClip = _root.attachMovie("enemy1","enemy_1,1);
tempEnemy._x = 500;
tempEnemy._y = 0;[code]..........
I would like the Ball to move in a random direction 0-360,Then i would like the Ball to richoche off of the BallBoundry in its reflected direction.
View 2 Replieshow i can make objects move with random speed.i have 3 objects but their speed is handeled by the timeline how i can make them move with random speed
View 4 RepliesI want to validate the user detail screen and infrom user ifany error when he moves out of flex screen.Basically we have submit button out of flex area and userenters detals in flex screen and submits using jsp header
View 1 Replies1. When you click on the buttons for 2 and 3, ALL three buttons move to a different part of the screen.
2. When you click on the button for 1, ALL three buttons return to their initial position.
Ideally, when the buttons move they would in fact travel across the screen rather than disappear for an instant and reappear in the new locations. Usually I would do this via a motion tween, but I can't figure out how to incorporate one here without conflicting with the other actions and thus messing everything up! I have to use a site structure similar to the one in the example because I need the intros/outros to be different for each mc.
I'm creating a simple game and I need to move objects down the y-axis from the top of the screen to the bottom.I want one object specifically to randomly appear and then exit the screen. I'm using a random number generator to test against and call the object to the screen and to move from top to bottom when the random number is greater than 950.The problem is that when the random number generator, generates two numbers in a row over 950 the objects skips back to the top.The animation is nested within the mc. I tried animating it with as3 but it jumps down the screen and doesn't look like a smooth animation.Is their a way that I can track the progress of the mc animation and use an && conditional to only play the animation when it's on, say frame one of the animation?What I want is to say if the movie clip is at frame one(stopped) and the random number is greater than 950 play the clip. If the clip is begin played not at frame one. Don't replay it.[code]
View 1 RepliesI want to create a preloader that is essentially a block of colour moving across the whole stage (610 x 300 pixels) - i don't want it to show the percentage loaded, just the colour will move across the screen and obviously when it reaches the other end, that will indicate that it has loaded all the external swfs and goes onto play them....
View 2 RepliesI want to have something on the screen move at a constant speed when a button is pressed. I'm not sure how to go about it. I have this for it to move 5 pixels at a time but I want it to move continually on holding the mouse down.
on (release) {
_root.bar.ball._x += 5;
}