ActionScript 1/2 :: Gradient To _rotation - Please Explain Trigonometry?

Oct 28, 2011

From what I have gathered, _rotation uses radians?Basically, my initial goal was to make a movieclip rotate towards the mouse. I'm not very good at trigonometry.Using the help files I found atan2 which seemed to be what I needed. A little fiddling got me to this code:

var xDist:Number;
var yDist:Number;
var angle:Number;
onMouseMove = function () {

[code].....
 
However,the _rotation is opposite what is expected. This is not a problem as I can just flip the movieclip. But really what im here to ask is, please ecplain this code for me? I don't correctly understand how atan2 works.. and why it needs to be *60.Basically: How to get a movieclip to rotate towards the mouse.. and why does the code work, I want to learn trigonometry.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Flash Rotate And Drag Within Cos(_rotation) Or Sin(_rotation)?

Aug 25, 2007

I have a project which will allow the user to upload an image, drag it within a certain area, and rotate it.The trouble is, that the user is allowed to rotate the image. When they do, then because the area is defined by the width of the rotated image, then the image will not go as far as it's boundary,or it will cross over it's boundary.I have searched the web for a solution, and have found nothing.I am currently thinking it has something to do with Math.cos() or Math.sin()Here is my current code(which doesn't work):

r = mc._rotation;
mc._rotation = 0;
w = mc.clip._width;
h = mc.clip._height;

[code]....

View 1 Replies

Flash :: Create A Vertical Color Gradient (or Any Other Angle Besides A Flat Horizontal Gradient)?

Mar 2, 2010

my first time trying to draw a multi-color gradient in actionscript 3. So I got this code from the help docs, but I can't seem to get a vertical gradient, whatever formula or number I use for rotate, it stays stuck on the default horizontal gradient :(

[Code]...

View 3 Replies

ActionScript 3.0 :: Flash : Create Gradient Fill, Transparent Background And Radial Gradient?

Dec 26, 2011

I'm trying to create spinning rays in actionscript to use in my website.Below is the rough idea of what i'm trying to create.Is it possible to create absolutely with 0 images.Following is the actionscript code in which i couldn't figure out how to add gradient, transperant background and little radial gradient to create glow effect.

Code:

function CreateRays():Shape {
var ray:Shape = new Shape();
ray.graphics.beginFill(0xFF9900,.5);
ray.graphics.lineStyle(1,0xFF9900,.5);

[code]....

If you paste above code in 1st frame of your scene with nothing on your scene, it will give you sweet rotating rays!

View 2 Replies

ActionScript 3.0 :: Explain Syntax For (X ^ (X >> 31)) - (X >> 31)?

Oct 15, 2009

explain in very very basic terms (or direct me to tutorial) what is happening in this syntax:

[code]...

this was part of and example on how to optimist code (posted in this forum awhile ago), specifically for replacing either:

[code]...

I understand how the brackets work, and that X is a variable (I presume a Number).

I assume that '^' == 'to the power of'.

I dont understand why they are using >> or 31 at all.

View 2 Replies

ActionScript 3.0 :: Moving Movieclips Using Trigonometry?

Apr 16, 2011

I have this game where a movieclip moves towards the mouse point by finding the difference and dividing by its "speed". This isn't very good though because different users will have different cursor speeds. What I really need is a method that finds the angle between the two points then uses that angle and a "speed" to calculate the next position of the moving movieclip.Here's something along the lines of what I am looking for but it doesn't quite work?The function runs and everything. All that works, it's just the maths that isn't right.Something needs changing with the maths.

ActionScript Code:
function moveCircle(e:Event):void
{

[code]......

View 4 Replies

ActionScript 2.0 :: Trigonometry In Flash Mx - Go To Images?

Apr 22, 2004

I need some help with trigonometry in flash mx. I was inspired by this site and was wondering how you do it...go to 'images'..I dont want to just copy and paste a script you would give me..

View 1 Replies

Javascript :: Looking For Resources To Explain A Security Risk?

Jun 18, 2010

I've a developer which has given users the ability to download a zip archive which contains an html document which references a relative javascript file and flash document.The flash document accepts as one of it's parameters a url which is embedded in the html document. I believe that this archive is meant to be used as a means to transfer an advertisement to someone who would use the source to display the ad on their site, however the end user appears to want to view it locally.When one opens the html document the flash document is presented and when the user clicks on the flash document it redirects to this embedded url. However, if one extracts the archive on the desktop and opens the html document in a browser and clicks the flash object, nothing observable happens, they will not be redirected to the external url.

I believe this is a security risk because one is transferring from the local computer zone to an external zone.I'm trying to determine the best way to explain this security risk in the simplest of terms to a very end user. They simply believe it's "broken" when it's not broken, they're being protected from a known vulnerability.The developer attempted to explain how to copy the files to a local iis instance, which I highly doubt is running on the users machine, and I do not consider this to be a viable explanation.

View 2 Replies

ActionScript 2.0 :: Trigonometry - Rotate Slowly To The Mouse?

Dec 20, 2005

i know how to check the angle between my object and the mouse, but i dont know how to make it rotate slowly to it...

i tried this codes:

Code:
//first method:
onClipEvent (enterFrame) {
this._rotation = (Math.atan2(_root._ymouse-this._y, _root._xmouse-

[Code]....

View 9 Replies

Flash :: Which Apps Are Available To Create Start Up Explain Videos

Jan 25, 2012

I was wondering if there is any easy tool to use in order to create a start up video? I know there is the Adobe After Effect option, which is extremely expansive.

any tool that allows you to create an animation, easily? for a startup site, a video that explains what the startup do?

View 1 Replies

ActionScript 2.0 :: Trigonometry - Finding Angle Of MovieClips With X And Y Diff

May 7, 2003

Basically I have two movie clips. I know the x diff and the y diff, now how do I find the angle at which the movie clips are at?

Code:
v MC 2
/|
/ |
/ | < y diff
/ |
MC 1 > /__|
^
angle x diff

View 10 Replies

Professional :: Incorporate Audio (Voice) To Explain Flash Animation

Apr 6, 2010

I am doing a project on an interactive website that contains flash animations. I have to incorporate a voice that explains what is happening in the animations. I am using my own voice for this. I have recorded my voice and saved it as .mp3 files. between each animation there are about 6-10 audio files. I am pretty sure I can import the sounds into the flash library and drag the sounds on the timeline and sync the sound with the animations that way but is it possible to control the sound using actionscript as I have to incorporate buttons that allows the user to play, pause and stop the animation and the audio. Or can I only use actionscript to achieve this.

View 7 Replies

Flash :: Animation Tool To Explain Software Project Visually

Dec 10, 2011

I have a software project, which involves complex process and calculation. Rather than writing it's logic and business flow in a document, i want it to be explained in some sort of animation visually, which would be easier for some one new to my project.

View 1 Replies

Actionscript :: Javascript: Explain The Meaning Of :Number After A Function Declaration?

Mar 28, 2012

Remark from editor: Op miss-classified actionscript as javascript.I am new to Javascript and am confused by the following function declarations in ECMAScript.js2.

public class String extends Object {
...
public native function charAt(pos:Number):String;

[code].....

View 3 Replies

ActionScript 2.0 :: Trigonometry - Line To Continue After The Points In Both Directions And With The Same Steep

Sep 27, 2005

Is there someone who is good at trigonometry? I have two points punkt1 and punkt2 and a line that is drawn between them. Both points is dragable. I want the line to continue after the points in both directions and with the same steep. I have counted the steep between point1 and point2 and tried to continue to drag to a point with the same steep, but it doesnt succed.

[Code]....

View 3 Replies

ActionScript 2.0 :: Character Walking, Without _rotation?

Jul 29, 2006

I am trying to make my character look as he is walking around on the stage. I can make him, but what do I to make move his arms and legs? Also, I want the character walking animation when one of the keys is pressed, and stop walking when that same key is released. I have looked and looked with google and I can't seem to find the answer

View 3 Replies

ActionScript 2.0 :: Why Height And Width Changes When _rotation= 45 Or 135

Oct 16, 2008

for examlple i have box. height=16 and widht=100 the problem is when i apply rotation on that movie clip it changes its height and widht. is there any way to control that? or any one can tell me using what formula it reduce the height and widht when we apply rotation on it??

View 3 Replies

ActionScript 2.0 :: Use The _rotation On A Mc - Let It Rotate Slowly?

Sep 15, 2003

i know how to use the _rotation on a mc, but how can i let it rotate slowly

[AS]
onClipEvent(enterFrame) {
rnd = parseInt(Math.random() * 2);
if(rnd == 0) {[code].....

this way it only flips to another degree, but you can't see it go round...

View 2 Replies

ActionScript 2.0 :: Determine If Angle X Is Within Y Degrees Of Mc._rotation

Sep 14, 2005

I'm having a problem determining if the angle created between two movie clips (which I've calculated with Math.atan2) is within +/-35 degrees of movie clip b's rotation.

View 3 Replies

ActionScript 2.0 :: Rotate About A Point Using ._rotation Method?

Apr 1, 2007

Is it possible to make a movie clip rotate about the center point of it using the ._rotation method?

View 1 Replies

ActionScript 2.0 :: _parent[vehiclename1][vehiclename2]._rotation?

Mar 29, 2005

how would i write this _parent[vehiclename1][vehiclename2]._rotation, it doesn't like the two breackets next to each other need quick reply.

View 3 Replies

ActionScript 2.0 :: Flash8 Can't Get Person To Follow Mouse Using _rotation

Jun 3, 2010

So far i have done:

[Code]....

Which is currently very glitchy it will not look at the mouse directly instead it will just continuosly rotate trying to find it, is there any way to fix this? The game... I have tried several different methods... Is it because it does not know how to face the mouse and what part of him to use to face it, if so how can i fix it?

View 3 Replies

ActionScript 2.0 :: Assistance With _rotation Property For Tween Class?

Feb 4, 2006

if there is a way to use the _rotation property with the Tweening class to make a movie clip continually to rotate from it's current position instead of starting back at the original position and doing the same rotation again.

I'm trying to make an movie object rotate 90 degrees by clicking on a button and then when you click the button again, the movie rotates 90 more degrees. I don't want it to start over and do that same 90 degree rotation with the Tween class.

View 4 Replies

ActionScript 2.0 :: Change An Object's _rotation Based On The Xy Coordinates?

Jun 4, 2006

how do i change an object's _rotation based on the xy coordinates of another object (so it is facing it)?

View 3 Replies

ActionScript 2.0 :: Rotate Movieclip Of A Starfield But When Use _rotation Get Flickering Effect Every Second

Jul 10, 2004

im tryin to rotate this movieclip of a starfield but when i use _rotation i get this flickering effect every second or two of rotation see [URL] left and right keys change rotation hold down a key and you will see what i mean ,is there a way to prevent this flickering here is the code i used

[Code]...

View 1 Replies

ActionScript 2.0 :: Controlling Duplicate Movieclips - Make Draggable And Change The _rotation With Key.Right, Key.Left

Aug 5, 2004

I found the tutorial on duplicating movieclips, especially the line-by-line translation of the code. how to communicate with those clips�specifically to make them draggable and also to change the _rotation with Key.Right, Key.Left.

View 7 Replies

Actionscript 3 :: Trigonometry - Radius Out To The Outer Concentric Circle And Calculate The Position Of That Outer Point?

May 29, 2011

I've got two concentric circles with their centers at (centerX,centerY). The inner circle has a radius of 100 and the outer circle has a radius of 400. If take a point on the circumference of the inner circle, I can draw a line from the center to that point. Let's call that point x1,y1). I now want to continue that radius out to the outer concentric circle and calculate the position of that outer point (x2,y2).

I'm adding a 3px 'dot' just to show where x1, y1 is on the screen. (Subquestion: I can't see it...not sure why.)This is what I'm trying:

var x1:Number = 100;
var y1:Number = 50;
var x2:Number;[code].............

View 1 Replies

IDE :: Gradient Mask In CS5?

Nov 13, 2010

Is there a way to create a gradient mask in Flash Pro CS5? I am able to get it to work in FPCS4 but apparantly the process was changed or the functionality eliminated in CS5.

View 1 Replies

Gradient Tool No Worky

Apr 20, 2006

When I create a gradient and fill with it, sometimes the gradient transform tool works perfectly. Other times, I click on the gradient fill with the gradient transform tool and the gradient is selected as if I clicked it with the "Selection Tool."I can't get the gradient transform tool to give me any handles to adjust the gradient once applied.

View 11 Replies

ActionScript 3.0 :: Draw Gradient Box?

Nov 7, 2009

i have drawn a gradient shape on the stage and i want to replicate it with code now.how the gradient looked on the stage.how do i spread it out more?, you can see on the picture that its wider than shape's height.and i am also guessing the angle...

Code:
var upColor:uint = 0x9999cc;
var downColor:uint = 0x000000;[code].....

View 0 Replies







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