Flash - Interpolate Between Two Points For Higher Resolution Drawing?
Jan 16, 2012
In flash, I use lineTo to draw a line between two points. This is working well, but I'm finding that on slower computers, the line is jagged because not as many mouse events are firing.I want to 'smooth' the line out, to add more points in between each point that the mouse registers:
The black lines show the result, the green ones are what I want. The red dots are actual points, and the green ones are interpolated.I have tried to code this myself but I can't seem to get it right, here is the code anyway:
var interX:Number = lastMouseX+(lastMouseSpeed.x/2);
var interY:Number = lastMouseY+(lastMouseSpeed.y/2);
//Also tried: lastMouseX+(this.mouseX-lastMouseX)/2;
// also jittery
[code]....
the result is much more jagged than the normal one.
View 1 Replies
Similar Posts:
Jan 13, 2004
I've gotten pretty far with my file. I have successfully been able to load higher resolution tiles when a user either draws a box of an appropriate size (area 50-100% of total loads low quality tiles, 25-50% of total loads medium tiles, 0-25% loads high quality tiles). The tiles also load correctly when the slider on the zoom tool is pushed up and down. Here is my problem:
1) I can't figure out how to call the SetScale function (defined on the slider MC) so that when the user draws a box on the main map it zooms into that scale (see the functions half way down the AS layer on the main timeline where the calcArea is calculated).
[Code]...
View 14 Replies
Oct 19, 2008
draw a squiggly or wavy line in the MOUSE_MOVED event as the user clicks and moves the mouse.
View 1 Replies
Oct 6, 2009
I want to draw a curved line between random point. How can I do this? The random points are actually x,y positions of movie clips dragged on the stage and I want to code curved lines between them.
Im looking at curveto in as2 but not sure how to to do it?
View 0 Replies
Sep 18, 2006
I have a world map on which I display some data. I read long and lat coordinates for two countries from an XML file which is updated with different coordinates everytime. I then map the coordinates to X-Y axis using some projection method.
So, I have x-y coordinates for two countries. I wanna draw a curved line between those countries but curveTo method draws the curve in one shot. I want to animate the curve drawing part so it looks like it is being drawn real time.
View 4 Replies
Jun 25, 2007
I'm trying to draw a curve based on 24 data points. I want to draw a curved line based on the average of these 24 points. I can draw a line from point to point no problem, but would like a smooth curve. The white dashed line is what I'm trying to achieve:
View 2 Replies
Feb 2, 2010
I found this code in AS2. It draws an outline of a circle:
[Code]....
I'm only just embarking on making the move to AS3
View 2 Replies
Feb 9, 2010
I want to know is there anyway to invisible title bar for a AS3 project? and how to force program to use fix resolution and change monitor resolution to what we want?
View 1 Replies
Mar 15, 2011
how to deal with unsorted arrays to get the next higher or next smaller value?
var _myArray:Array = (1,pizza,2,6,8,test,11,16,17,cola)
_myArray.splice(4,1) // > remove number 8 !
trace(_myArray) // > array contains now: (1,pizza,2,6,test,11,16,17,cola)
how can i get the next higher value (= 11) ?
View 2 Replies
Oct 2, 2010
I'm making a flash game and I've come to a halt in my code. This is how the game works: Where ever the mouse is clicked, the player will run towards thats spot. It's on a field. The problem is, I want the player's size to decrease as he gets higher up on the field(as the y gets closer to 0), giving the illusion of depth. But for the life of me I cant get it working! Im quite new to AS3 so im not sure about all it's tricks, but here was my go at it.
[Code]...
When I run the code, my character's size stays the same when I go up and down, but goes all wobbly when i go at angles without any real order. Clearly it's not working.
View 4 Replies
Apr 13, 2006
i am puttin together a calendar in flash, as it is ending up on a windows server in ASP, so the lovely PHP calendars wont work. I have been using the code from:[url]to get the months and days working, and have todays date highlighted. Now i need to work out a way that i can set this up to call a flash movie onto a higher level which contains the events of the day you click on. Such as: Because the dates are determined and inserted via AS, im not sure how to set this up, or if it is even possible...
[Code]...
View 3 Replies
Oct 3, 2011
I have been tasked with trying to create a drawing tool that draws dotted lines as you drag the mouse across the stage. I can easily capture the points on MouseEvent.MOUSE_MOVE and store them in a vector and then draw the points as dots:
The problem is that I need to calculate evenly distributed points on an ever growing Vector of points so I can only draw the line between say every 5th point (say using modulus). I have been battling away with Bezier curve equations both Quadratic and Cubic but still can't quite figure out how to convert my Vector of points into an evenly distributed Vector of Points without sucking the life from the CPU.
View 1 Replies
Nov 14, 2009
I dont understand why a simple vector mc TWEEN ANIMATION isnt smooth.Here is an example. I use 30 FPS and I dont want to use 40 FPS or higher.
View 1 Replies
Oct 20, 2009
I'm going to be creating a Flash presentation that will run on a flatscreen TV at a trade show. I'm not certain what resolution to set up my Flash movie to. The TV is a widescreen Panasonic 42" TH42PH10BK with 1024 x 768 pixels, however when I set my animation to those values it looks 'squarer' than the TV. It looks like I need to set up the animation to a different resolution, but I don't know which!
View 4 Replies
Apr 24, 2009
what would be the right resolution and format to create a flash as a tv commercial?
View 13 Replies
Nov 17, 2011
I've made a small app that captures and displays the camera feed. But the problem i'm having is that the app only displays a fraction of what the camera is showing (top left part of the corner), is there a way to shrink the resolution in Flash CS5 so that the app can show the full picture?
View 3 Replies
Dec 8, 2009
I have flash video files to display on to website.The flv files are in 1024*768 size.But , when i am displaying the flv on website with 960*720,the video quality is not good.
How can we handle the video sizes on webpage?
View 2 Replies
Jul 19, 2011
How to detect the Monitor current resolution in flex.
View 2 Replies
May 13, 2007
I am making a new site. I am using a looped video on the background but what I want the background flv movie to be resized on all the resolutions how can i make it fixed?
View 4 Replies
Jun 16, 2010
anyone know what type of script use in this website to manage screen resolutions automatically [URL]
View 2 Replies
Jun 16, 2010
anyone know what type of script use in this website to manage screen resolutions automatically [URL]
View 1 Replies
Sep 30, 2010
how can I set rezolution of my flash site that is fit to viewer's screen. [URL]
View 4 Replies
Jun 6, 2011
I have table named "highscore" like this:
nameQL scoreQL
piotr 50
And flash game with NAME and SCORE exported to PHP with this names.How to make this in PHP file:
IF (NAME exists in database (nameQL)AND SCORE> this.name.scoreQL){Raplace scoreQL with SCORE WHERE nameQL=NAME}
IF (NAME doesn't exists){Create new row with NAME and SCORE)
View 1 Replies
Nov 9, 2010
i've tried to simulate a pencil tool, for drawing above a imagem, but the drawing is below the picture. How fix it?
[Code]....
View 3 Replies
Dec 28, 2009
I am trying to figure out how to detect screen resolution through Flash.For example i want to move a "movieclip" to a specific point if the height of the screen resolution is smaller than 768.
Actionscript:
if(screen.height < 768){
movieclip._y = 200;
}
I think i should use this property but i don't know how to implement it!
trace(System.capabilities.screenResolutionY);
View 3 Replies
Feb 12, 2010
A few months ago, I started noticing a small annoyance in Flash and the Flash Player. This small annoyance quickly became a rather large inconvenience, so I recently started googling a solution. Nothing to be found, unfortunately.Here's my problem:When I open a swf file with the standalone Flash Player (any version), the size of the player is set to the size of the last swf file I loaded with the "File - Open" dialog. By the way, when I use the file dialog to open files, the player resizes appropriately.An example:I open a swf with "open with - Flash Player" and the Flash Player sets its size to 320x240 instead of the swf's size, 640x480. Or I open a swf that should be 550x400 and it opens at 320x240. The Flash Player always uses the dimensions of the last file opened with "File - Open."
This problem even affects the Flash CS3 built-in "Test Movie" player.The problem is a little difference within the "test movie" player. It seems to keep whatever the dimensions were the last time you resized the player yourself, and full screen mode doesn't work properly.I tried upgrading, downgrading, editing the
View 1 Replies
Mar 23, 2011
I've been grappling with this problem and am still in need of a solution. I've built a flash site that is image-rich. Images are JPEG files pulled into "createEmptyMovieClip" that I have in AS 2.0 on the flash file. Unfortunately the quality of the images are really bad and that seriously compromises my site.
View 1 Replies
Jun 14, 2010
I've met a problem while trying to stream with my camera. Whatever i try, by switching the camera (3 different UVC-cameras) or which Linux-OS (CentOs, Fedora Core) or testing at different Flash-Sites (incl. one of my own) - i always get a resolution of 160 x 120. Other applications manage up to 800 x 600.
Is this a known Bug/Feature? I've searched the Internet and found many people with the exact problem, but with no solution. What should i do? The tool flashcam didn't work either.
View 2 Replies
Apr 7, 2011
So I've been surfing the net trying to find a way to get a 100% resolution from Flash to Gif and can't find it.Here is the deal, I've got Adobe CS5 and I started doing animation in photoshop. It took forever but once I got it done it looked awesome and I could easily transfer it into a gif via 'save for web and devices".Because it was taking forever I decided to learn flash and after a day I got the basics pretty much figured out and made my first .swf file. I then went to turn it into a Gif and the resolution sucked and the timing was off.
View 1 Replies
Dec 26, 2011
I have a website layout of 1920x1080. What could be my stage resolution (in the swf).Do I need to set scaleMode?
View 3 Replies