ActionScript 3.0 :: Offsetting X Pos Of The Object For Move?
Jan 14, 2012Im struggling with the maths for this...basically if you use this...
Code:
function moveit(e:Event){
BTN.x = this.mouseX
[code].....
Im struggling with the maths for this...basically if you use this...
Code:
function moveit(e:Event){
BTN.x = this.mouseX
[code].....
how to do an object move towards the mouse when i move the mouse the towards the object and backwards when i move the move away, something liike the menu on [URL]
View 2 RepliesI know this is very noob, but I need a simple AS move and loop. Move an object across the stage and once out of site, loop and start over again? It needs to be a slow and endless loop.
View 3 RepliesI am trying to move a 'Shape' object across the screen. As the object moves, a copy is being left at the initial position. Almost as if only an instance of original object ahs been moved
This is not an issue for moving an image or MXML graphic. Is something wrong in setting to the move object?
The code is as follows
private var arrow:UIComponent;
private function resetAssets():void{
arrow = new UIComponent();
[Code].....
I'm still new to AS3, and I was wondering how to make an object point in the direction of another object and move towards it if they are a certain distance from one another. I haven't been able to find out how to do this from the Adobe devnet, so I thought I'd ask here.
View 1 RepliesI am having a major problem trying to move an object to another object with a set speed I want object1 to move towards object2 for collision. Right now I control object2 with my keyboard and I want the script to tell object1 to move towards object2.
View 2 RepliesI'm making a game with a character and wide backdrop. The charcter is spawned and can then move about the stage, and currently the stage only reveals part of the backdrop. I basically want my character to be able to explore the backdrop. I was thinking that maybe I could do some code that tells the backdrop's x-value to change in the same way as the character's.My charcter's code is all kept in a class file, so I'm also not 100% sure if I should create a new class file to relate to my backdrop.
Also I'll need to stop the character before he walks off the edge of the backdrop, so is there any way I could also say "the character cannot travels past these two x points (the two edges of the backdrop).
I'm trying to get used to the new way of doing things in CS4. Once I've created a MC and rotated it in 3D, how can I move it across the screen w/o rotating it further? I have a MC that rotates over several frames, and once it reaches the last one, I want it to stop rotating, then begin to slide in an X direction (while reducing the alpha). But no matter which tool I use or what I do on the timeline, the object is stuck in place and will only rotate and not move. Even the 2D X and Y settings in the properties panel are grayed out.
View 9 RepliesThe following code works fine when mouse is pressed at any position on the screen ,object moves that position...but what if I want the object move that position at a certain speed..say+10 using setInterval...I mean I want my object move slowly to any position I click on the screen..[code]...
View 4 RepliesI'm trying to create a script that locates the objects location, and moves it smoothly out of location (but not out of stage) when the mouse is close. When the mouse moves away, the object should return to its place. I've really been searching for hours, and I cannot seem to find anything that works.
View 2 RepliesOK, at first this seemed like the easiest thing to do, but I've tried to make it work a number of different ways and nothing seems to work. I have a movie clip that I want to have constantly moving back and forth across the stage, basically "bounce" off the left and right sides. What's the best way to do this using AS2?
View 6 RepliesI have a image of a car that I want to move with this code: _root.car._x+= 15; But I want it to happen after 5 seconds.
View 3 RepliesI'm new to flash and following a tutorial on how to make a small game. I've made some subtle changes, namely I imported .png's and made them into shapes and now am trying to move them. Here is the tutorial:
[Code]...
But the plan is to make a "Drag and drop" Object that we are supposed to move around til the finish line.The problem is basically that I can't seem to find any decent ways of making this happen..When this "object" hits the other "object" (finish line) we move to the next frame.should be a simple/short line of code I think, from own experience.I have on my own exploring found similar problems without beeing able to fix it for my purpose:"One Object Hits Another It Goes To Another Frame."
View 1 Repliesi am following a tutorial from a book, Learning Actionscript 3.0, A Beginners Guide, where it discusses how to move an object in an agle. I have managed to get the app working fine, but i'm tryin to test it out in different angles but everytime i change it seems to go into the same angle.[code]Can somebody tell me why for everytime i changed the value of the degrees, it does not updat the movement of the ball please
View 3 RepliesI have a image of a car that I want to move with this code:
_root.car._x+= 15;
But I want it to happen after 5 seconds.
i'm creating an interactive experience and I need to move a bar on screen reacting to the volume of people sreaming at a microphone. Like a CLAP-O-METER... is this possible with ActionScript?
View 1 RepliesI've gotten this code from another tutorial site but trying to modify it so I can apply it to my other flash movies. Firstly what this does is it moves the object around 300 x 300 document in random coordinates. But what I want it to do is make it transparent as it decelerates or have it's alpha go down to 0 as it nears the destination. And when it gets a new destination it's alpha resets back to 100 again to repeat the process.
Code:
onClipEvent (enterFrame) {
currentlocx = this._x;
currentlocy = this._y;
differencex = newX - currentlocx;
[code]....
How do I get an object to only move between two points if Iam moving it with the key arrows? The object moves right out the screen.
View 1 RepliesWhat is a good function to simply move an object to X and Y coordinates?I can find is actionscript that does movement plus other animations, like rotate and scale.I just want to let the user drag an object, but when they release it, that object moves back to certain X and Y coordiantes.
View 1 RepliesI got an instance I wanna move when clicking the background.. and I want it to move to the place I click, Its for my volume bar. At the moment you can drag the volume instance but if you click on the background you wont go there..
This is how the code looks like now:
Code:
var music:Sound = new Sound(vSound);
// initial x position fo the dragger
mp3Player.dragger._x = mp3Player.line_mc._x+mp3Player.line_mc._width+3;
mp3Player.dragger.onPress = function() {
[Code].....
anyone saw some open-source or tutorial where u can grab an object and move it around and at the same time rotate the object deppending on the place you grab it. some physics maybe. like a cd-case moving on ice
View 10 RepliesI'm trying to do some experiments with my webcam, I would like to move an object with my hands, put it somewhere else, but I'm not getting.[URL]..Someone could give me some tips or teach me how?
View 2 RepliesI want to have a few menu buttons on my web page (home, about, contact etc.) and above them a bar (we'll call it 'grey bar' to make it a little easier to understand). When you roll over one of the buttons I want a small 'orange bar' to run along the 'grey bar' and stay over the button that you are hovering over. Then if you choose to rollout of the button the 'orange bar' will return to the page destination button that you're on. For example, if you are on the homepage the 'orange bar' begins over the 'home' button, then if you rollover 'about us' the 'orange bar' moves along the grey bar horizonatally to stay above 'about us', if you rollout it returns to 'home'.
Sorry if this isn't making much sense, i've attached the flash file so you can see what i am working with. I am just looking for a tutorial or some actionscript that will make it work. It's driving me crazy, I don't know if i should be looking to use a startDrag function (but i don't think you can use this with a rollover function) or a way to get the bar to follow the mouse.
I have found a ton of tutorials with code that teaches you how to move a character, or move objects with arrow keys.... but I have found nothing that teaches you the code that allows the character in a video game to move an object around. like for example a character needs to slide a block across the ground so he can jump on it to reach platform that higher up.In my platformer game, I have figured out how to jump and move the character back and forth among the platforms with gravity, and thats as far as I have got.
View 8 Repliesi want to stop the move of one object when an other object passes over a specific point!!!!how i can do this threw a method?
View 8 RepliesI've gotten this code from another tutorial site but trying to modify it so I can apply it to my other flash movies. Firstly what this does is it moves the object around 300 x 300 document in random coordinates. But what I want it to do is make it transparent as it decelerates or have it's alpha go down to 0 as it nears the destination. And when it gets a new destination it's alpha resets back to 100 again to repeat the process.
[Code]...
Does anybody know how to make an object moving in a smooth circle?
View 9 Repliesso first off, this is AS 2.0. Second, i have a little character from a tutorial on how to move an object around with the arrow keys. The character faces on way on "up" another on "down" and so forth. There are 4 frames for it facing up, down, left, and right so that on the key presses it faces the proper direction and moves accordingly. I also want this little guy to move behind objects. When this happens, i want the object that the little guy is behind to be partially transparent so that you can still see him and he doesnt just vanish.
[Code]...
I have some basic experience with actionscript but have hit a wall with this. I am working on a swimming pool simulation and would like a swimmer to do a length of the pool in a fixed time. When a swimmer reaches the end they hit a pad and turn and this repeats. I can to the collision detection fine even have a running time. How can I for example get a length to take 30seconds.
View 1 Replies