ActionScript 2.0 :: X, Y To GPS - Convert A Decimal Value (like 10.25) Back To Degrees And Hours?

Apr 18, 2006

if I have a map of say, Wisconsin, and I know what the Latitude coords (degrees, hours, minutes) of the top and bottom of the map, and I know how many pixels tall the map is, then I should be able to convert, with math, degrees:hours:mins to pixels. (same thing with longitude, but lets just focus on one way first)

I would first find out how may hours (minutes would be over kill for my app) there are to a pixel. Thats pretty easy. But this gives me a decimal number. How do i convert a decimal value (like 10.25) back to degrees and hours (in other words, how do i make .25 a "60" based value)? Ultimately, i want the user to be able to input coords in the form of degrees, hours, mins. Then convert that to X, Y (to place a marker on the map).

Has any one had experience with this or know how to do this?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Convert Slope To Degrees?

Jul 7, 2011

I'm having trouble with this mainly because Flash's Math.atan() doesn't give the same results as my TI-83's tan^-1 function.

If I have a line with a positive rise and run for the slope and use tan^-1( (the slope) ) on my calculator, I get a value between 0 and 90, with 0 being a horizontal line and 90 a vertical line. A negative numerator with a negative denominator for the slope puts it in quadrant 4 where tan^-1(slope) gives 0 to -90 values, again with 0 being horizontal and -90 being vertical.

Putting the slope of the blue line into tan^-1() would give a value of about 80 degrees, while the red line would calculate to about -50 degrees. The rotation property Flash uses rotates objects clockwise and can range from 0-360. Using the -90 to 90 values and figuring out if the rise and run of the slope are positive or negative, I can determine which quadrant the line is in and calculate the degrees.

However, this so far is not possible for me because Math.atan() gives odd results.

A practical application for this knowledge would be a player in a game throwing spears from (0,0) to the mouse x,y. The slope would take care of the trajectory of the spears, however if your spear sprite is a spear flat and facing toward the right, you need to rotate it appropriately from 0-360.

View 1 Replies

Flex :: Calculate Total Working Hours Where Hours Passed As A Number?

Dec 9, 2011

I am using FLEX version 3.0I want to calculate the total working hours. I am giving you the details and what i have done in it.

var a:Number = 2.00;
var b:Number = 2.00;
var c:Number = 1.45;

[code].....

View 3 Replies

Flash :: Flex - 3D - AS3 - Convert Degrees Of Rotation To Visible Height

Nov 5, 2009

I need to know what the visible height of a display object will be after I change it's rotationX value. I have an application that allows users to lay out a floor in 3D space. I want the size of the floor to automatically stretch after a 3D rotation so that it always covers a certain area. EDIT: I guess what I am really trying to do is convert degrees to pixels.

On a 2D plane say 100 x 100 pixels, a -10 degree change on rotationX means that the plane has a gap at the top where it is no longer visible. I want to know how many pixels this gap will be so that I can stretch the plane. In Flex, the value for the display objects height property remains the same both before and after applying the rotation, which may in fact be a bug.

EDIT 2: There must be a general math formula to work this out rather than something Flash/Flex specific. When viewing an object in 3D space, if the object rotates backwards (top of object somersaults away from the viewer), what would the new visible height be based on degrees of rotation? This could be in pixels, metres, cubits or whatever.

View 5 Replies

ActionScript 2.0 :: Convert Decimal To Hexadecimal

Sep 13, 2001

how to convert a decimal value to a hexadecimal with actionscript...

I want to make a funtion which will assign a random color to a movieclip... And the "set rgb" function requires the variable passed to be in hex. Bummer.

Also I could solve this problem if I could convert a string to a hex number insted of a decimal like with parseInt()

I think the solution may lie within the bitwise operators >> and <<, etc,... But I have no clue as to their use...

View 5 Replies

ActionScript 3.0 :: Possible To Convert Decimal To Binary?

Mar 19, 2012

I would like to know if you can convert decimal to binary using actionscript 3.0?

View 6 Replies

ActionScript 3.0 :: Convert Decimal To Fraction

Sep 8, 2009

I'm not familiar with actionscript 3.0, but I must use it for a project I was assigned. The final product will be a program that will take a decimal input value and then convert it to a fraction. I have searched the web for a couple hours now and have found very useful info on this topic in the actionscript 2.0 forum, but nothing for 3.0.providing a function that will convert a decimal value to a fraction?

View 2 Replies

ActionScript 2.0 :: Convert Decimal Minutes Like 90 -> 1:30?

Dec 11, 2002

I need to make a dynamic text field display Sound.duration like 1:30sec instead of 90sec (for exemple...). I was not a maths major... I studied that long ago... I think... But I have no clue...

View 8 Replies

ActionScript 2.0 :: Convert Character To Decimal?

Apr 9, 2007

I can't seem to find a function to convert a character to a decimal.

Example: Convert string 'A' into its decimal form '65'.

Background: I'm trying to take an input character value (anything from a to ZZ), substring its characters, and into uppercase (eg. G, Z), covert each character to decimal (eg. 71, 90) and then reduce those numbers, such that A=0, B=1, Z = 25 and finally add them. GZ = 6+25 = 31.

It's for an X,Y co-ord system that uses A-ZZ for X, and numbers for Y.

View 7 Replies

ActionScript 2.0 :: Convert Total To Decimal?

Jun 27, 2009

I am having trouble converting my total price in the cart text field to decimal. I have on the main timeline I have a several numeric steppers and add to cart button.

In my .as file I have the following code that takes the price * quantity and displays the total but not in the decimal $10.00 format. I have tried everything from Math.ceil, round, etc. It either will round up or just display the number with no decimal.

.AS File Code

Code:

public function GetCartValue(decimals:Number) {
var dataforAlternate = _level.BodyOilsMc.my_nstep.value;
moneysign= "$";
//trace("AS File"+""+dataforAlternate+" Products");

[Code].....

View 4 Replies

Convert Variable To Money With 2 Decimal Places?

May 6, 2010

I have a program that adds values together. I need the variable to display with 2 decimal places. Right now $1.50 would look like: 1.5

How do I make Flash display the zero automatically?

View 2 Replies

ActionScript 3.0 :: Convert Decimal To Binary Ive Got The Formula?

Mar 19, 2012

Im having a problem with this code to convert decimal to binary ive got the formula but it wont print to the screen_txt only on the console and also my calculator wont let me change any other number other than 3 so if i press 7 binary should be 111 but it stays 11...

[Code]...

View 3 Replies

ActionScript 3.0 :: How To Convert Base 10 Decimal To Twips

Mar 17, 2009

Basically, I am experiencing an inconsistency with the behavior of an equation that is calculating the change in y position from one movieclip sequentially from frame to frame, and transforming the amount of change from a smaller range to an amount of change to a larger range; moving the target mc between two points. The inconsistency is that target mc doesn't always reach the top and bottom .y points, even though the slider mc does.

View 2 Replies

ActionScript 2.0 :: Convert Decimal Number To Scientific Notation?

Jul 21, 2010

I've got a calculator that i created in as2 that converts different units of measurement. However, right now it always converts the numbers into a decimal number like 0.33333333 or 450.72. How in the world would i convert these decimal numbers to scientific notation? For example, say i have a number: 12,700. Expressed in scientific notation, this would be 1.27x10^4.I hope there is an easy way to make flash convert to such a number system? I know its easy to round numbers in decimal, but have never worked with scientific notation before.

View 9 Replies

ActionScript 2.0 :: [FMX] Convert Decimal Time To Standard Format?

Sep 19, 2005

I am trying to do a calculation which will eventually (hopefully) yield the total length of time it will take to download a certain size file over different broadband speeds.

//amount_total is the total file size (GB)
//multiplied by 1024 to give me total megabytes
mb = Number (amount_total*1024)
//15 is time (s) to download 1MB

[code]....

So, I am left with a total time of eg: 4.5 hours.i would like a standard number I can use across my movie to convert 4.5 hours to 4hrs 30, or 4.30 for simplicity.If I have 0.5 hours as a total, it would be much easier for the user to read it .30 hours.

View 7 Replies

ActionScript 3.0 :: Convert Decimal To Hexadecimal And Vice Versa?

Jun 15, 2011

I have started working with colors and have got a need for playing with hexadecimals. I tried making a variable which adds two hexadecimals, and it works but when I trace the answer, it comes out in decimals. How can I make it remain in hexadecimal or convert the decimal to hexadecimal?

View 6 Replies

Actionscript :: Convert Character Entity References Into Decimal (charCodes) In It?

May 10, 2011

Is there a native method for converting character entity references into charCodes in ActionScript? For example, has a decimal or numeric entity reference of a. I assume that the charCode would be 8736 since I've found that charCodes of lower decimal values match.

View 1 Replies

ActionScript 2.0 :: Convert A Flash Binary-decimal Converter To Another Programming Language

Nov 28, 2005

Im trying to convert a flash binary-decimal converter to another programming language (TI-Basic). I've got all of it down except one key part. I've got a solid backing of actionscript understanding but find myself unable to understand the following statement:

if (iNumber%2) { bin = "1"+bin; }
from this tutorial

I realize that inumber%2 will return a value being the remainder of inumber divided by 2, but how can this be a conditional? "if (2) { }" doesn't work for conditonals im used to. Or if your a TI-Basic wiz

p.s. how do you wrap actionscript tags around content in a post on the forum?

View 1 Replies

ActionScript 3.0 :: How To Convert Time ("4:22") Into A Decimal?

Jan 14, 2009

I have song times stored in a MySqual DB in time format: 4:22 I assume this is a string... What does the code look like that that will convert this into seconds so I can use it in my timers? var seconds:number = (everything left of the column x 60) + everything right of the column;

View 3 Replies

IDE :: Convert Back To Cs3 Form Cs4?

Feb 2, 2009

I have Flash CS4 but my school has CS3, i did a project in CS4 brought it to the school and the file will not open, what sould i do about this? How do i change the file format? The error message was unable to open file format.

View 1 Replies

ActionScript 3.0 :: Convert The Tree Back To XML?

Feb 19, 2009

I am using the Astra Tree component.I am passing XML to the tree's DataProvider.I want the user to be able to add nodes to the tree.The most convenient way seems to be to add the node directly to the tree component.This works but I need to be able to save the new tree back out as XML.Is there an easy way to convert the tree back to XML?I have not been able to find an easy way to convert from DataProvider to XML.

View 0 Replies

ActionScript 3.0 :: Convert 3d Object Back To 2d?

Jun 17, 2009

If I set the rotation for any object on the stage, flash renders it as a 3d object, even if I set the rotation to 0 like this..[code]3d objects render differently and look fuzzier when you look at it dead on than when it is rendering as a 2d object. How do I convert the 3d object back to 2d so that I get the better quality 2d rendering back?

View 1 Replies

ActionScript 1/2 :: Convert A Datagrid Back To A String?

Oct 6, 2010

I want to convert a datagrid back to a string. I tried Code:var myString = _root.myDatagrid.toString();But this does not seem to work.

View 5 Replies

ActionScript 3.0 :: Convert Movie Clip Back Into 2D Space

Feb 7, 2010

My project has a center-registered movie clip with a z-axis setting of 850 that I need to keep centered on the stage at all times, including when the stage is re-sized.Code like this for centering 2D objects doesn't seem to work:[code]My guess is that I need to convert the movie clip back into 2D space somehow, center it using the code above and then change the z-axis back to 850.

View 4 Replies

ActionScript 3.0 :: Convert String Representation Back To ByteArray

Oct 2, 2011

My program saves text files, which contain various text, some of which is a string representation of a ByteArray. It does this by using the toString() method of the flash.utils.ByteArray class, which I assume converts a ByteArray (for example, 13x$) into its string representation "13x$". So how do you reverse the process, and turn the string ("13x$") into a ByteArray (13x$)? Even if it's not that simple, I just need to have the ByteArray, put something in a text file, and extract from it the same ByteArray.

View 1 Replies

ActionScript 3.0 :: Convert Julian Dates To System Date And Back In It?

Aug 26, 2010

How can convert Julian dates to system date and back in AS3.

View 2 Replies

Professional :: Convert A Movie Clip Back To The Main Timeline?

Feb 23, 2011

The entire .fla animation consists of nothing but two really long movie clips. Which are placed on frames 1 and 2 of the main timeline. Now for reasons that are too deep for me to go into explaination about my boss is telling me that I have to have everything main timeline -no movie clips. I've tried copypasting all of the frames but they all paste wayyy to large on the main timeline and they wind up in different places on the stage.

How can I move all of the frames from my two movie clips onto the main timeline without everything breaking? Better yet - is there any way to just convert a movie clip into an .fla?

View 2 Replies

Actionscript 3 :: Convert A String To ASCII Codes And Back In Flash?

Jan 23, 2011

In AS2 you had the functions ord() and chr() which specifically converted ASCII codes to their string equivalents.

However in AS3, String.charCodeAt() and String.fromCharCode() work with Unicode values.

Is there any way to convert a string character to its ASCII equivalent and back?

View 4 Replies

Flex :: Zend AMF - How To Convert To MongoDB Compatible Date And Back

Jul 26, 2011

In flex (flash builder 4) I have a Date() property that I am passing to Zend AMF (php) and I want to store that (as well as other data) in mongoDB. Mongodb is complaining about the date because it comes across as a Zend_Date object, which appears to be an object containing several properties and Mongodb is saying that it can not accept blank properties. So, I take that to mean it needs to be converted to something else before I can store it? If so, how do I do that?

At the moment I have taken the approach of converting the Zend_Date object in to a date string to store it (in php):
$object->readyDT=date("m/d/Y H:i", strtotime($object->readyDT)); //convert to string

That works fine, and I have a string in mongodb of that date. Now, when I load the date from MongoDB, I need to convert it back to a Zend_Date so it properly converts back in to a Date() object in flex (I have to check that it's not blank or it throws errors in php):
if (isset($object->readyDT) && $object->readyDT!=="") $object->readyDT = new Zend_Date($object->readyDT, 'MM/dd/yyyy hh:mm');

This all works, but it seems like there should be a much easier way to take a Date() from flex and get it stored in MongoDB via Zend AMF/PHP. ?

View 1 Replies

Actionscript 3.0 :: Encrypt Files And Then Convert Them Back To Normal On Fly As Game Loads?

Feb 13, 2010

I am working on a game that will have couple of XML files and couple of images external to the game.

i would like to protect those files so that they cant be changed/editted

is there a way to encrypt all files and then convert them back to normal on the fly as the game loads?

View 1 Replies







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