ActionScript 2.0 :: Calculation Of Infinity?
Dec 28, 2002
I have a actionscript calculation that initially calculates a value of infinity. Is there a "if" statement you can perform until the calculation actually calculates a real number (0-100)?
View 14 Replies
Similar Posts:
Nov 24, 2009
I have a counter (number) to display. When the counter exceeds limit (counter > 100) it should display "infinity" symbol.How to do this in AS2 ?
View 2 Replies
Jul 22, 2003
i need to rotate a clip into infinity... what are the actionscripts needed?
View 3 Replies
May 27, 2004
I'm trying to write a script that will move a mc in a figure 8, kinda like the way that water flows from side to side inside a container... flowing in one direction and rising, then hitting the wall and ebbing as it flows back the other way... slowing down over time To say that I'm not that mathematically inclined is an understatement, but i think it can be done using trigonometry, like sin and cos...??
I found this page on here - [URL]- this is similar to what i want to do, except when the clip passes the center to move away in a figure eight and then back, instead of just going around in a circle. And i think i want the mc to come to rest in the middle over time, so the figure eight is gradually reducing in size.
There's also a method that looks like it could be adapted to do what i want using elasticity -[URL], bottom example. i've put up a page on my site with a bit of a visual representation of what i want it to do:[URL]
View 2 Replies
May 3, 2011
ActionScript Code:
if(Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY){
trace(Number.POSITIVE_INFINITY/Number.POSITIVE_INFINITY);
} if(5 == 5){
trace(5/5);
}
Outputs:
NaN
1
View 4 Replies
Mar 16, 2011
i can test in flash and load complete 100% but in my website can't load
and return infinity %
this is my code
[Code].....
View 1 Replies
Mar 6, 2009
I made a 2 frame flash. The first frame has a container that holds the movie clip, masks, audio & transitions for the intro. This frame I only want to play once. Then I want it to advance to frame 2 upon completion. Frame two is a leader/score board that will hold score tallies (it is linked to a TXT file that is linked to an ASP, which has not been completed yet), and therefore, it needs to loop into infinity. When I have the FLA open and I press CTL + Enter the intro plays then automatically advanced to the 2nd frame which loops to infinity.
(This is perfect -- this is how I want it to perform). When I go to the folder where the SWF and EXE are published, and I double clidk to open either one of them up, the intro keeps looping and never advances to the 2nd frame. I have to manually press next frame on the pull down menu -- and that is not feasible since this leaderboard will inevitably end up on a big monitor with an audience. Here is the link to the file: [URL].
View 3 Replies
Aug 12, 2009
Trying to recode a scrolling thumbnail panel I found as an example of the web into AS3 mostly for educational purposes but getting stuck in a couple of places. The panel works but my problems are:
1) lower boundary doesn't work, panel continues to scroll into infinity.
2) as it is written, the mouse event that activates the scrolling is MOUSE_MOVE, which is kind of a pain as the scrolling is kind of "jerky", I have tried to make it an MOUSE_OVER event, but I think it may be conflicting with the prior MOUSE_OVER event.[code]
View 0 Replies
Mar 18, 2010
I am trying to adapt Ruben Sweringa's Flex-based interactive mindmap [URL] and I've got most of it sussed out. I'm just having a little difficulty with the tooltips and I was hoping someone/some people might be willing to help me out or offer some guidance on these three things:
1) How and where do I set hideDelay to Infinity so the tooltips don't disappear? I think that because Ruben's model uses FXCToolTip and FXCHTMLToolTip to extend ToolTip and ToolTipManager, if I try to modify ToolTipManager.hideDelay in the mxml, the value is ignored.
2) Is there a way to enable HTML formatting in the tool tips? FXCHTMLToolTip looks like it's supposed to read this code, but whenever I add such coding, Flex says "Error: XML is invalid" and the whole mindmap fails.
[Code]...
View 7 Replies
Mar 17, 2012
So i think i have fully coded my calculator but it still doesn't seem to be performing the calculations correctly. I can't see where i am going wrong. If i perform a calculation let's say 6*2 it outputs NaN then i straight away + by let's say 5 it outputs NaN again. And it doesn't make the operators display only once, so if i click on '+' twice it will display twice in the display when it is meant to only display once and in one of my functions i cleared the display field so that it would replace the number's when the next operation is performed but it doesn't seem to be doing that. I have been going over the code several times but i can't seem to identify where the problem is coming from.
Actionscript Code:[code].....
I have not added the full code as it is too long, i have just added the parts which relate to each other. I am just doing everything entirely through actionscript, nothing is on stage apart from the display and answer text fields.
View 6 Replies
Mar 3, 2010
I'm trying to calculate age in flex. I've found this previous question url...[code]but I don't understand 100% whats going on.How do I go Implementing this into my code say if the date was 12/23/1990?Also How would I go about modifying this code to calculate the age if two dates are provided instead of using the current date? eg. 12/23/1990 - 10/15/1999
View 2 Replies
Feb 16, 2011
59.99 + 10 = 69.99 is true.but if we trace it with flash as bellow trace(59.99 + 10 == 69.99)it says false.is the above condition is an exception?
View 7 Replies
Jan 14, 2009
Is there a way to calculate the distance between the origin of a movieClip at, say, (x:500, y:0, z:0) and one at, (x:500, y:0, z:50)?? And lets say the vanishing point is (0,0) and the perspective angle is 50.
I know that the eq for finding the distance between two points in 3D space is:
d = ((x1-x2)^2 +(y1-y2)^2+(z1-z2)^2)^(1/2)
the problem is I dont know x2 (the x value of MC2 (the one set at z = 50)).
[URL]
View 2 Replies
Feb 9, 2011
So got a very odd result from a maths operation:
Code:
var myNumber = 6.3 + 9.1;
trace(myNumber);
[code]....
View 11 Replies
Apr 8, 2009
I'm making a game based on pong. At the start of a round, the ball will go in a random direction and when the ball hits a paddle the ball will move in a certain direction depending where it hit the paddle. The more centralized the hit is, the more straight the bounce is. Here's the tricky bit: the ball may hit either a vertical or horizontal paddle and I want the xspeed(horizontal movement) or yspeed(vertical movement) of the ball to increase/decrease in proportion to the opposite speed while keeping the same general speed of the ball(it can decrease and increase). Here's an example(you might want to get a pen/pencil and a piece of paper):
Let's say the ball is moving at 45 degrees(so it's going downward right) and hits a horizontal paddle smack dab in the middle, thus it goes at 270 degrees(straight up). So, at first the xspeed and yspeed are both the same, then the xspeed is zero and the yspeed is at the max(to the general speed).However, let's say that the ball hits the same paddle but at the edge(either edge will do the same) thus making the ball go at a near 360 degree angle, making the xspeed near max and yspeed almost zero. Like I said, I want the two speeds to increase/decrease in proportion to the general speed, this is so that xspeed or the yspeed don't exceed the general speed.
View 3 Replies
Sep 21, 2010
I need to do a simple calculation and have it update and display the result without me having to click a button.On the stage I have two text fields.The one on the left is a input text field with the instance name of "input" (without the quotes)To the right is the other text field. It is a dynamic field with the instance name of "output" (again, without the quotes)When typing into the input field I want it to multiple the value by 10 and display the result in the output field.If I then change the input value it needs to automatically update the output field.
View 4 Replies
Jan 14, 2009
Is there a way to calculate the distance between the origin of a movieClip at, say, (x:500, y:0, z:0) and one at, (x:500, y:0, z:50)?? And lets say the vanishing point is (0,0) and the perspective angle is 50.
And its not just straight geom because we dont know the ACTUAL x value of the second MC. It thinks its at x:500 but when you look it will look farther to the right than 500
see: [URL]
View 4 Replies
Dec 14, 2002
EXAMPLE 1
Code:
a = 98587
b = 0711
c = a - b
This results with c = 98130 which is wrong it should be 97876.
[Code]...
View 12 Replies
Jul 19, 2005
[Code]...
How can we split this kind of calculations
View 1 Replies
Apr 30, 2004
I have XML data that looks like this: 197,168,198,168,204,168,206,168,207,169,208,etc This stuff is XY coordinate pairs, X1, Y1, X2, Y2, X3, Y3, etc. and are used by a drawing function to trace out a particular freeform shape. This array of data is usually 200-400 items long.Here is the AS code that is handling the reading of the XML and the drawing of the shape. This all works wonderfully:
[code]...
I am looking at the array and grabbing some points out, namely the first and last XY pairs, which I need for something else. That's the origXexp, origYexp stuff.The real problem is that I need to run a mathematical calculation on the data in this array. While this is a little hard to explain, I need to create a variable, let's call it expert_area, and then sequentially rip through that long string of numbers and do the following math (I'll use the simple X1 Y1 example): expert_area=0 expert_area = expert_area+((X1*Y2 - X2*Y1)/2)
where we move through the long string a pair at a time. So the first calculation would be (X1*Y2 - X2*Y1), the next would be (X2*Y3 - X3*Y2), (X3*Y4 - X4*Y3), etc. I've tried building loops to get the length of the expertArray[i] and then using that as the basis to proceed through the data. But everything I try either produces no results, or gets Flash stuck in an infinite loop. I'm unsure of where to put this, and how to construct it.
View 3 Replies
Feb 15, 2005
The following is the code for the press button:
Code:
on (press) {
var charges:Number = Number(charges_txt.text);
var payments:Number = Number(payments_txt.text);
[Code]...
on the dynamic text labeled PERCENTAGE I cant get it to give me just 2 decimals.
View 2 Replies
Jan 3, 2011
I´d like to know how would I make a formula for the calculation of speed.It´s not as simple as distance divided by time.I want something different.I have an helicopter.This helicopter is landed.He will take off with a small speed, but increasing speed.What I want is.This helicopter movement. In other words, increasing vertical speed, in a given time, say, 2.4 seconds, in a give distance, say, 100 pixels.After that he keeps vertical speed constantly. So I think the helicopter will start with its vertical speed slow, increasing, then, decreasing untill it reachs its constant vertical speed.
View 1 Replies
Jan 4, 2010
I am trying to center an image in the middle of the stage and scale it proportionally to the correct aspect ratio based on its loader's size when the image is loading.
In my main app runner I do:
private var rec:Rectangle = new Rectangle();
private var img:BitmapDisplay = new BitmapDisplay();
stage.addEventListener(Event.RESIZE, setRect);
img.imageURL = "some/path/to/image.jpg";
addChild(img);
[Code]...
View 1 Replies
Jul 9, 2010
I'm trying to work this out if anyone can help. I have a function:[code]....when I pause the movieclip set at 30fps the sec,min stop but the frame var keeps running in the onEnterFrame loop. Basically I am trying to count frame by frame in a movieclip, and every 30 frames the frame var will reset to zero.
View 9 Replies
Dec 18, 2009
Basically I have used PerspectiveProjection so I may rotate multiple images about their centre so they don't appear differently rotated because of their x-position on the stage.My problem is calculating the width of the rotated images. When I rotate an image 45 degrees, my width ends up being ~146, but based on the following (my comments from my code), it should be closer to 141:
Code:
// ^C
// / |
[code]......
View 7 Replies
May 5, 2010
I'm trying to display a range of dynamic textfields, using an array.
I can place everything on the stage fine, but I just can't figure out the maths behind placing each textfield next to each other horizontally. So, despite the length of the word, the spacing between each textfield is the same, e.g. 10px.
I'm sooooo eager for this one little calculation!
Code:
var myArray:Array = new Array("little", "looooooong", "huuuuuuuuuuuuuggeeeeee", "tiny");
var container_mc:MovieClip = new MovieClip();
container_mc.x = 80;
[Code]....
View 2 Replies
Jul 27, 2010
im new to Action script 3 and im having problems i cant get a calculation to work across multiple frames and then to have the answer passed to an other frame plz help
View 1 Replies
Aug 15, 2011
I am in a requirement where I need to calculate the bandwidth usage of rtmp streaming. Is there any way I can calculate the number of total bytes I have download during the rtmp streaming?
View 2 Replies
Jan 16, 2010
I've created a series of calculations, and I've got that part down. Now, I just need it to show up in the movie.
I've created the dynamic text box in Flash (CS3), but when I hit test, it won't show up.
After all the calculations, I should have a figure that I call totalmoney. My dynamic text box is called total. The user doesn't need to hit anything for it to appear. It just appears as part of the movie.
Here's my code:
stop();
var startDate:Date = new Date(2010,0,12); // use your startyear, startmonth, startdate in the new Date() parameters.var currentDate:Date = new Date(); // assuming user's clock is correct and in your timezone. else use server
[Code]......
View 5 Replies
Feb 3, 2009
I want to get a value between 1 and 50 placing a value of 100 which will be the variable computerTotal:
Code:
computerPlay = Math.ceil(Math.random()*computerTotal);
Here of course it will display a number between 1 and 100 (computerTotal = 100)
What i want is to have a random number between 1 and the half of computerTotal
How could this be accomplished?
View 2 Replies