ActionScript 2.0 :: Does Math.round() Reduce Lag
Sep 1, 2009Does flash go slower if it has to check on points that are for an example: 6.1873128932 versus: 6?
View 1 RepliesDoes flash go slower if it has to check on points that are for an example: 6.1873128932 versus: 6?
View 1 Replieshow do you round a number to 4 digits... so 3.45356345345 is 3.456 and 1 is 1.000
View 5 RepliesHere is the problem:
var p:int = 0;
var n:Number = 0;
n = 32.999999999999999;
p = Math.floor(n);
trace(p); // returns 33
n = 32.11111111111111;
p = Math.floor(n);
trace(p); // returns 32
I would expect both of these to return 32. I have searched, and it seems this is an unreported bug in AS3. Or ... am I doing something wrong?
Wat is the diffrence between these two?
View 2 RepliesI have a code in which I have to use Math.round if a certain value is for example 3.67 (67 is higher than 50) and Math.ceil if a value is for example 3.23 (23 is lower than 50). What can I do to make flash calculate if what after the dot �.� in 3.23 (for example) is higher than 50?
View 2 RepliesWhat is math.round() do? In kirupa's Random numbers tutorial, he explained the use of math.floor(), but said round() was for another time. Yet I see that, and not .floor() in use in the random movement tutorial.
View 1 RepliesIs there a way to use Math.Round to ensure that ALL text boxes are on whole number, X,Y coordinates?
View 5 RepliesI have this number
2,555555556
and I want to round it dynamically into 2,60 how can I do this in flash?
I followed a tutorial from actionscript.org , the tricky part is that i wanted to change the Kb to a % display and it's messing up.Here's the previous code [AS]lastFrame = 1;
function loadedIndicatorFrame() {
var newFrame = int((_parent.getBytesLoaded() / _parent.getBytesTotal()) * 65) + 2;
if (newFrame - lastFrame > 4) { //too far
[code].....
I want to round a whole number down to the nearest whole 10th. Like 52, becomes 50. Or 49, becomes 40. Or 2005, becomes 2000. Does that make sense? I imagine it has a math.floor approach, but I can not figure it out.
View 5 RepliesHow do you round a number to 2 decimal places using the Math.round function?
View 3 RepliesI am trying to add an eventlistener to the stage to respond to a resizing. When doing so i want to keep the relative position of a movieclip-object constant to the upper and leftmost edges, without changing the alignmode of the stage to top left. This can be achieved as shown below - examplified with two classes and reference to fla implied. The problem is now: When supplying the crucial statements with a Math.round, the movieclip-object gets displaced pixelwise with each new resizing:
myMovieClip.x -= Math.round((deltaX / 2));
myMovieClip.y -= Math.round((deltaY / 2));
Whereas the solution without Math.round is rock stable so it doesn't move at all, as it is not supposed to either! Can anyone figure out why? I know it's a luxury-problem, as my use case is solved. The problem is that i don't know why? Shouldn't the use of Math.round just assure the int-value? Such a small issue could easily spoil the whole app! And i fear that i have misunderstood something fundamental in as3, and suddenly become unpleasantly surprised.
[Code]...
Is there a way to use Math.Round to ensure that ALL text boxes are on whole number, X,Y coordinates?
View 4 Replieshow to fix this:
theText.scrollV = Math.round((slider.y area.y)*theText.maxScrollV/90);
I'm getting error:
1084:Syntax error: expecting rightparen before area.
It looks like a proper statement to me... all open brackets are closed.
So here is a piece of code that I have seen used a lot but don't really quite understand:
myVar = Math.min(Math.max(myVar, this.min), this.max);
or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.why this is done? And how do you know when to use it?
So here is a piece of code that I have seen used a lot but don't really quite understand:[code]or some variation thereof. I understand that the function first finds the maximum value of two values then turns around and uses that to find the minimum between two values.And how do you know when to use it?
View 3 Replieshow can i reduce the swf size? it's 9MB and it takes a bit to load online. is there any solution to reduce its size so it can load faster? the pictures and loaded externally so they're not embeded in the file. There are some inside the movie but they were already reduced from their original size.
View 1 Repliesi decompiled a swf & convert it to fla .after geting swf ,again i decompiled it,results in increase in file size of fla.is there any way to reduce the file size of fla...as PC hangs when i save fla.
View 2 RepliesI am using Flash CS3. Now i did some image with mc(Movieclip) animation. Its come near 150kb. But i dont need this like file size. I want less then 75kb.also i did publish settings and reduce the jpeg quality near 40. But its come near 106kb...
how can i reduce this swf file size.
i have 8 movie clip and i use it as a navigation buttons and when clicked it should go to different links. i use these codes but i think these codes are not pure oop so reduce programming using oop but works in same way as it is doing right now.
the codes are follows
function buttonmode(link:MovieClip):void{
link.buttonMode = true;
}
buttonmode(rec1_mc);
buttonmode(rec2_mc);
[code]....
I have a Flash 8 a/s2 site but I feel the load time when a visitor visits the site is too long. The site does have music, pictures and videos but they are all loading externally.
Is there a way I can reduce the load time of the SWF?
I've uploaded an AIR-built .ipa file to Apple. From Apple: "The app binary listed below was 8 MB when you submitted it, but will be 20 MB once processed for the App Store"
So I'm trying to trim it. I've gotten rid of all unused .as classes and all unused assets. Does anyone have any clever way of reducing file size further? One way I thought of is this[code]...
My problem is... I import two sound files and give the linkage name snd1 and snd2. In the first key frame I add this
sound1 = new Sound();
sound2 = new Sound();
sound1.attachSound("snd1");
[code]....
reduce the file of flash file as well as swf file to upload.I am a fresher. I don't know advance actionscript, xml etc. reduce the swf file size. So that i can easily upload the file.Also briefly explain me how to externally load the swf file in flash.
View 1 Repliesreduce the file of flash file as well as swf file to upload.tell me a simple way to reduce the swf file size. So that i can easily upload the file.how to externally load the swf file in flash.
View 3 RepliesWill OOP reduce the performance of the application.I have to query 4 database with more than 1000 rows between each user inputs to give the output. The whole thing must be less than 5 seconds to the maximum extend and an average of 2 seconds. Which type of design is better for performance.
View 1 RepliesI am trying to reduce the size of my swf, and I see that I am using a movieclip on each frame on the Timeline, which has to be adding considerable size to my file, since I have placed the movieclip(animation) on every frame. How could I do this more efficiently and still acchieve animation between each frame? I have included a ripped version of the fla. , since the attachment limit here is pretty low. In the file the video - files and the picture files have been removed, but the rotate... mc's(animation) are placed in the interanim Layer and the Menustate Layer, on each frame.
View 1 RepliesI am designing a website. My flash file comes up to a size of 1.5 mb. It takes around 1 minute to load.reduce the file size.
View 1 RepliesI have a image sequence of 350 images. Is it possible to Reduce frame count in flash mx, (remove every other frame)automaticy, not by hand one frame at a time. I do also have flash cs5 can it be done in that?
View 1 Repliesi m using these setting
[Code]...
i am facing the problem of echo .i am speaking than i can also hera my voice . how to reduce that problem that user can not hear own voice .