ActionScript 2.0 :: [fmx] Travel In Direction Of Rotation?

May 14, 2003

I have a MC(a small army tank) that I can rotate using the right and left buttons. I want to make it move forward when I push the up arrow - The Catch . . . I want it to move in the same direction it is currently rotated. Example: I rotate the tank 10 degrees and then I push the up arrow off it goes in that direction.

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Choose Rotation Point And Direction?

Nov 11, 2010

I am creating a a small site with a spinning menu but I want it to spin only in onedirection ( clockwise) and around the centre of the 3 point cross I am using as a menu.I have this currently to rotate the menu but I want it to only rotate on way and around centre.

Code:
content_mc.draw_btn.addEventListener(MouseEvent.CLICK,drawClick);
function drawClick(e:MouseEvent):void{

[code]....

View 2 Replies

ActionScript 2.0 :: Simple HitTest With Rotation And New Direction?

Apr 11, 2012

I'm having a bit of a problem with my script. I currently have a square that moves across the screen. There is another square on the stage as well. I want the other square to call a hitTest with the first square (that moves), which we'll give an instance of "hero". The hitTest should make the "hero" (or first square) rotation a specific degree (in this case 30) and then move him in a specific direction, either up, or down the y-axis or left or right on the x-axis. This is my current code, attached to my second square.

onClipEvent(enterFrame){
if(this.hitTest(_root.hero)){
_root.hero.rotate += 30;

[code]....

View 1 Replies

Professional :: MovieClip Smooth Rotation And Direction Change

May 19, 2010

I want to make a movieclip moves smoothly and when it changes the direction, it can turn smoothly but not a sudden turn, I try out the code below. and the truning is odd:
this.rotation = (Math.atan2(targetY-this.y, targetX-this.x )/Math.PI)*180;

View 2 Replies

ActionScript 3.0 :: Top Down Shooter Player - Rotation Equals Direction

May 7, 2011

I am very new to flash, I got a player, and the idea is for a top down shooter kind of thing, I got the player to rotate with left and right, and its rotation equals its direction, now how can I make it move forward in its current direction when I press up?

View 3 Replies

ActionScript 3.0 :: Calculate The Total Rotation Of An Object In Either Direction?

Jan 27, 2010

How to you calculate the total rotation of an object in either direction?

I need to end up with a number of total radinas(or degrees) that is posotive or negative depending which way the object was rotated.

View 4 Replies

ActionScript 3.0 :: Flash Converting A Rotation Angle To A Direction Of Motion?

May 1, 2011

I have a rotation value in degrees(0-360) and a value for magnitude, ie (1-10 pixels per second).

How to apply this information to determine what to add to an objects x and y values to send the object off in a given direction at a given speed ?

View 8 Replies

ActionScript 2.0 :: Scrolls Continuously In A Direction Until The Direction Of The Mouse Is Changed?

Feb 24, 2009

i have a scroller developed in as2. it basically scrolls continuously in a direction until the direction of the mouse is changed. the images of course loop in the continuous scroll. now the problem is that for 10-15 photos its ok. but when i feed it with 180 photos, it seems to show only 11. why would this be? any restriction on flash ??

View 1 Replies

ActionScript 3.0 :: Direction Of The Ball In The Direction Of The Mouse

Mar 17, 2011

have a ball with the name of mc which can be moved using the keyboard .. when you press the left mouse button shoots the ball, this ball and the other flies in the face where the cursor was in the shot .. but if you move the cursor to another location and shoot a second time then the second ball is also flying in the direction of the cursor and the first ball change direction toward a second shot ..

ActionScript Code:
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;

[Code]....

how to make that first ball did not change its direction and continued to fly in the direction of the shot?

View 5 Replies

ActionScript 3.0 :: Travel Along 3d Plane

Nov 10, 2010

Im trying to figure out how to travel along a plane to a point in 3d space. It needs to feel as though travelling down a road. I have attached a swf with the desired effect. Im using the formula scale = fl/(fl + z);the problem im having is it looks fine until scale is > 1. I need the plane to stay central to the screen.

View 0 Replies

ActionScript 2.0 :: Limit The Travel Of The Scroll Thumb?

Mar 26, 2007

I am currently working on a curved scrollbar. I want to limit the travel of the scroll thumb using two clip instances that mark the top and bottom of the scroller. To do this, I believe that I'll need to use localToGlobal on my top (topMark) and bottom (botMark) markers. Unfortunatly, my attempts to get the global coordinates has failed. In the attached file, the code can be found in the actions layer of the curvedScrollbar clip.

View 1 Replies

IDE :: Using MC Tween 2, Updating Travel X, Y Coordinates On Runtime?

Aug 11, 2009

what I am trying to achieve using MC Tween 2. I need to be able to update X, Y coordinates while the tweening is running. I don't want to restart it but update X, Y values. For example, I want to modify the distance to travel on an object in given time. It means that if tweening started with distance to travel 100px on Y coordinate and time to ravel is set to 10 seconds and if I change Y coordinate within 1 second of 10 to 200 px the the rest 9 seconds will tween the object to the 200 px point. I hope I described clear.

View 4 Replies

ActionScript 3.0 :: Flash Travel Distance Calculator

Jan 18, 2011

I am given a task by my client to develop a calculator which will calculate the Cab fair from one location to another. There is a list of Cab fairs as well as their corresponding Location Name. It would be displaying the results on the screen.

[Code]...

View 1 Replies

ActionScript 2.0 :: Make A Mc Bounce Then Travel Forward Again?

Apr 24, 2011

I managed to get the bounce working how do I make it continue to move forward after the collision?

View 5 Replies

ActionScript 2.0 :: Using MC Tween 2, Updating Travel X, Y Coordinates On Runtime?

Aug 11, 2009

what I am trying to achieve using MC Tween 2. I need to be able to update X, Y coordinates while the tweening is running. I don't want to restart it but update X, Y values. For example, I want to modify the distance to travel on an object in given time. It means that if tweening started with distance to travel 100px on Y coordinate and time to ravel is set to 10 seconds and if I change Y coordinate within 1 second of 10 to 200 px the the rest 9 seconds will tween the object to the 200 px point.

View 1 Replies

ActionScript 2.0 :: How To Make Object Travel In Straight Line

Jan 3, 2012

How do you make an MC travel in a single straight line (not two, not three, only one) according to mouse position and current position?

View 3 Replies

ActionScript 2.0 :: How To Get Playhead To Travel Randomly In Fixed Manner

Feb 26, 2011

There are 10 frames where playhead travels from frame 2 to frame 11. If I want the playhead to travel randomly in fixed manner such as :
frame 2, 4, 6, 9, 10, 3, 5, 7, 8, 11 not using gotoAndPlay, just using script in first frame.

View 4 Replies

ActionScript 3.0 :: Rotation Center Is In Left Of The Image - Aren't 3D Rotation From Transform Panel

Jan 7, 2010

I have a movieclip and when I do 3D rotation from Transform panel, It rotates perfect, center is in the middle of image, and when I apply mc.rotationY, rotation center is in left of the image, aren't 3D rotation from Transform panel and mc.rotationY from AS same? what's up?

View 2 Replies

Actionscript 3 :: Augmented Reality Flartoolkit Rotation - Trace The Rotation Of The Marker

Mar 23, 2011

I'm trying to do some augmented reality projects with flartoolkit . I can now put simple 3d objects on my marker and it works fine , but I wanna give my project some events that the user can interact with. I'm trying to trace the rotation of the marker. there's a container:DisplayObject3D which my application uses to add the 3d objects , I traced this :"trace(container.rotationZ)" but it's just returning 0 . I studied another AR application's source code and it was using the rotation of it's container object without problem .and I think I should mention that I'm using the exercise file of seb lee delisle papervision3d course from [URL]. anyone has any experience with flartoolkit? the main functions of my my code is as below:

[Code]...

View 1 Replies

Boundaries - Ball Will Get Stuck In The Wall And Slowly Travel Upwards

Feb 8, 2009

I am making a pong game and am having some problems with the boundaries. The ball bounces off just fine but if i hit it to close to the boundary, the ball will get stuck in the wall and slowly travel upwards. Bouncing back and forth. It happens on both sides. Also How do you set a key press movement to stop. I want to be able to stop at the boundary if i hold the left key down but it would stop the game entirely. I have it set now so that the controls reverse every time a boundary is hit. My big problem is the boundary though. I will eventually figure out the paddle movement on my own. Another problem I am having is getting my score value to increment correctly. It always reads as a NaN until I score. When I do it goes 1, 11, 111, and so forth. I have the variable set as number values but the dynamic box, I think, is still reading them as strings

View 1 Replies

ActionScript 2.0 :: Can't Get XML List To Scroll Because The Variables Won't Travel Outside The Xml.onLoad Process?

Jan 29, 2008

i have a list cranked out from an XML file (movieclips attached to empty clip). currently it loads as the SWF launches. i can't get it to scroll because the variables won't travel outside the xml.onLoad process. what i'm wondering is once i bury this process into a button activated function, will i be able to access the list's properties? (sweet Buddha i hope that made sense...)

it seems the fundamental principle i'm struggling with is var/scope issues: how and where variables/properies can travel. i can't seem to find an explanation that makes sense from a C++ perspective. everytime i think i get it, something like this kicks me in the nuts. for those who want to dig, i'm using Kirupa's custom scrollbar modified (seemingly unsuccessfully) to my own setup. if you can recommend a different one more suited to this sort of thing, i'm open to it. if this doesn't make sense, i can attach the FLA but its a bit of a read and i'm in need of an answer before Thursday. methinks once this project is done, i'm going to hire someone for a week to fill in the gaps in my knowledge!

View 4 Replies

ActionScript 3.0 :: 3D Rotation Of Nested Movieclips, Separate Of Parent Rotation?

Aug 11, 2010

Is it possible to have the child movieclip rotate separate of the  rotation  properties assigned to the parent? so ultimately giving the  child  element it's own axis?I've customized Lee Brimelows (gotoandlearn.com) 3D carousel to spin  on  the x axis to make it a vertical carousel. I've also rotated that by 45 degrees on the y axis to see all the items, and wrote a snippet of   code to hide the left portion of the carousel. The entire  carousel is contained within the 'container' movieclip, and  inside of  that are my carousel items (as seen below), with the larger  item being  the item in focus.

On rollover of the item in focus, I want to rotate it so it faces the   viewer (as seen below),basically removing the 45 degree rotation   applied to the container.The problem i'm running into is when you rotate the container (changing   the rotationX of the container), the axis basically rotates with it, so   when i rollover the next item 'in focus', the following happens..(in  the  example where it appears how it want it to, the carousel is at a   rotationX of 0, so it works fine)

View 2 Replies

Actionscript :: Flex : Ensure That Events All Travel Down One Object Tree, Regardless Of Target?

Mar 5, 2011

I have numerous objects, many of them are stored within other objects (and overlap in physical space). As I zoom into an object, it begins to fade away. At the moment it begins to fade, I load in the child object (or create a child object if one doesn't exist). I want to turn off the parent object's ability to respond to most events. The exception is the scroll wheel, which needs to be sent to both objects simultaneously so that the parent can continue to fade out as I zoom farther in. Try as I might, I can't find a way to tell Flex "hey, for right now dispatch these types of events ONLY to this object." I either end up with event dispatch stack overflows from trying to manually redirect the events, or I get events that don't activate at the correct time or on the correct object. What can I do?

View 1 Replies

ActionScript 3.0 :: Object Travel At A Constant Speed Across The Stage Area From Left To Right?

Oct 28, 2009

and theres probably a simple solution but i dont know. I have an object travel at a constant speed across the stage area from left to right, How do i stop it at the Right side of the stage??

View 2 Replies

ActionScript 1/2 :: Inconsistent Rotation - 270 Degrees Of Rotation Disappear?

Apr 21, 2009

Program A has a cannon that aims to line up with where-ever the mouse is pointing, in 360 degrees, and fires when the mouse is is clicked. Program B has an eye instead of a cannon that should in theory do similar functions when the capslock key is toggled, but instead only has a 90 degree range of motion from the Right of the eye toward the bottom (quadrant 4 only). Where did the ther 270 degrees of rotation disappear to?

[Code]...

View 4 Replies

ActionScript 2.0 :: Create A 3d Rotation Much Like The Widely Used Carousel Only The Rotation?

Aug 11, 2006

i.m trying to create a 3d rotation much like the widely used carousel only the rotation i desire consist of four upright(90 degrees) movieclips resting on a slanted, 30 degree plane which rotate onEnterFrame or following a tween on a oval like path - then pause for a given number of seconds at the four movieclips positions equal in distance on the plane

function around() {
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);

[code]....

View 7 Replies

IDE :: Z - Rotation X And Rotation Y Missing In Motion Editor Panel

Feb 23, 2009

Why isn't there the Z, rotation X and rotation Y fields in my motion editor panel?

View 1 Replies

Actionscript 3.0 :: Rotation X Rotation Y Don't Show?

Oct 8, 2009

I am watching the tutorial on the motion editor and when he opens the motion editor to edit the Rotation X and Rotation Y values I'm in trouble.My motion editor now only shows Rotation Z but, no Rotation X or Rotation Y. What am I doing wrong?

View 1 Replies

ActionScript 3.0 :: 3D - Rotation Via MatrixTransformer - Do A "pseudo 3D" Rotation Of A Movie Clip

Dec 2, 2008

I am trying to do a simple "pseudo 3D" rotation of a movie clip. The clip would "flip" on to the screen. I have created the effect using PaperVision3D, however, the final SWF is about 64k and my project requires a smaller file size. I tried to create the flip effect manually by creating skewed versions of the clip and tweening between them, except this doesn't work because the shape is not tweaked along the vanishing point as it should be. It looks like perhaps I could accomplish what I want to do using the MatrixTransformer but I've not had much luck so far.

View 3 Replies

ActionScript 2.0 :: Pause Rotation On Rollover Of A Movieclip And Restart Rotation On Rollout Of The Movieclip

Oct 3, 2006

I'm trying to pause my rotation on rollover of a movieclip and restart rotation on rollout of the movieclip. Here is my current code,

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved