ActionScript 3.0 :: Extending A Vector To The Edge Of The Window?
Oct 31, 2011
I'm trying to draw a line from a point, in a direction to whichever edge of the window it hits first.
I've really only come up with the most brute force solutions to this problem (getting the vector, finding intersections with the all edges, choosing the shortest) but I can't help but feel that some much more elegant solution is JUST out of my vision.
A followup:
This one is a similar problem in that I know there's got to be a really nice solution hanging out on the web somewhere that I haven't found, yet.
If I have a series of points along multiple edges of the window (up to all four) how can I sequence them to be connected to each other, and any window corners along the way?
In other words, let's say I have a series of points (generated at runtime, so without any order) along 2 edges of the screen and I want to draw the triangle that they make up. How can I connect them in order (so as not to get any of that ugly intersecting polygon nonsense) AND include the corner?
This one I really have very little insight on. The best I've managed is picking a point at the center of the stage and comparing the angles formed when drawing lines to each point. It's ugly, and requires that one find the largest angle between two of those vectors, first (making two passes necessary). It even breaks when the points extend to three sides as the largest angle is not always between the two outside vectors.
I'm trying to extend a line from any given point to the mouse by a certain number of pixels (say, 100). This is the closest I've got: link to SWF. As you can see, the red line is behaving as it should (connecting the "any" point, located at the center of the screen, with the mouse) but the blue line is extending a line from the origin to the mouse by 100 rather than from the "any" point.
The AS3 code on the first frame (shown above, complete below): Actionscript Code: import flash.events.Event; import flash.geom.Point; function findTermination( x0:Number, y0:Number, [Code] .....
I've expanded the findTermination function as much as I can to make it easier to read (I have a real bad habit of doing everything on as few lines as possible).
Using Adobe Flash CS3 on a sometimes dual monitor setup. After attaching back to my docking station, and starting up Flash CS3, the window is off the edge of the right hand monitor somewhere, and I am not sure where. The mouse cursor makes it look like the window is somewhere off the lower right hand corner of the screen somewhere, but even after holding in the left and up arrows for a long time, there is no motion, and the window never appears. I can maximize the program back to my primary monitor, but this is hardly an ideal solution.
I have found the following registry entry, but am unsure if it applies to what I'm having problems with or what the format of the entry is: HKEY_CURRENT_USERAdobeFlash 9SettingsWindow
ActionScript Code: 1067: Implicit coercion of a value of type __AS3__.vec:Vector.ie.aro.floorplanviewer.model.buildingVOs:ConfigurationVO>[code]....
which surprises me as ConfigurationVO inherits from NodeVO.Is the compiler really not able to figure out that a Vector of a superclass should be able to hold a reference to a Vector of a subclass?
I need to import a bunch of vector work from Photoshop into Flash. Is there a trick to it. So far, on import, it's converting the layer styles into black.
I am currently being confused by the Vector class.I wrote a beautiful XML to TypedClass parser. Works beautifully and without fault. UNTIL a co-worker noticed we got a Conversion Error for Vector.<Number> to Vector.<*>.
Every Vector I've ever tested all extend Vector.<*>.
Vector.<Sprite>, Vector.<String>, Vector.<Point>, Vector.<Boolean>, Vector.<TextField>, Vector.<CustomObject>, etc etc etc. ALL of them. <type name="__AS3__.vec::Vector.<String>" base="__AS3__.vec::Vector.<*>" isDynamic="true" isFinal="false" isStatic="false"> <extendsClass type="__AS3__.vec::Vector.<*>"/>
[code]...
But then when I use describeType on Vector.<Number>, Vector.<uint> and Vector.<int>.
Now I have accounted for these 3 vectors individually as even uint and int does not extend Vector.<Number> as I would have expected. And my parsing function works for all types correctly again. But my confusion comes as to WHY this is the case, and why I couldn't find any documentation on the subject.
I have a large vector drawing (imagine 5000x5000) that i want to break up into separate pieces. I know that I can convert this vector drawing into a bitmap and then use the copyPixels method to create many separate bitmaps of the different regions of the original vector drawing, but is there any way to subdivide it into movieclips that just contain vector graphics instead of a bitmap?The reason im dividing a big chunk of vector graphics into smaller pieces is for performance reasons, so flash would only render a small part of this big chunk at a time (only certain regions/voxels/subdivisions are rendered at a time). But bitmaps apparently take up a lot of memory and the system im using would take much less memory if these subdivisions could be preserved in their original vector graphics form.
I imagine I could use masks somehow to achieve this effect (for each subdivision, duplicate the huge image and mask only the region that the subdivision represents), but I dont know the performance costs of masking or if this will create other problems.So is there anyway to split up a movieclip of vector graphics into smaller movieclips of vector graphics the same way copyPixels can with bitmaps?
I'm trying to move movieclip Ball along the borders of movieclip Ground. You would move the Ball with the arrow keys which would increase and decrease its x value, but the y value will always be equal to the top edge of the Ground movieclip.
To do this I need to find the y value of the points on the edges of movieclip Ground. How is this possible?This is what the Ground MovieClip would look like. It is an irregular shape. What I want is for any x point a y point at the top edge of this shape.
I have written, based on some internet tutorials, a simple header for my website to display a slide show of images. I have set my animation dimensions to 845x295, the same as each of my images. The DIV tag I then embed this into is set to the same dimensions but when the animation runs I get a white border down the right and across the bottom.
Using Voetsjoeba's golden formula, I've made some panels that ease into place. But why can't they start at 0,0? It seems I have to start the panels from the middle of the stage or else they drift off the edge, even with x and y specified in the code.
I am having problem with the text tool on flash version 8 the problem is that I am seen some blur letters when I preview my swf on explorer using dreamweaver version 8. I trying to find out what could cause the blurring the properties of the text is arial size 10 and verdana size 10. For example the period on the small i in some words look different.
How do I determine where an MC's center is relative to its edges?
I'm developing a tool that a variety of noobs (as if I'm not still a noob) will be using, and I don't trust them to keep art with 0,0 being the top left corner.
How do I figure out that the left edge is now at -111px, and the top at -52, and the right at 12, and the bottom at 334?
Or what if they draw it so the left edge is at 56px and the right edge at 583?
Essentially, I want to determine the center of my artwork, wherever it is relative to the center of the MC
I have a tooltip that follows the mouse, but i need to to figure out where the edges of the screen are and always keep the tootip on the screen. Its something to do with screen width and height.
Im working on a system that loads text from an external source and scrolls the information across the screen. I've figured that part out but what I need to know how to do is get the loaded elements(which are textboxes in movie clips) to align to the right of each other respectively when loaded since they all will have different widths based on how much text is in there.
Example: [Loaded movie clip with text here number 1][Loaded movie clip with text here number 2][Loaded movie clip with text here number 3]
I'm creating a navigation bar for a website, and the client wants a little car to roll back and forth as you mouse over the buttons. Ok, that's easy enough, I say to myself, but I've run into a hitch.
When the page loads, (before you mouse over anything) the little car is sitting half off the stage, that is, only half the car is visible. I fixed that by putting the car symbol's registration point along the left side, but then the car's left edge is whats following the mouse. I need the cars center to be whats following the mouse, but at the same time, not be able to slide off the screen.[code]...
I am having a multi user application running in FMS. I need to cluster them using Edge/Origin with Origin failover.I went thru, http:[url]......My questions are,1) which software load balancer can I use? Is there possiblitiy of configuring the fms server to be reverse proxy.http:[url].... in the below link its mentioned that we can configure edges in 4 ways.Client auto discovery proxyServer auto discover (reverse proxy)Explicit URIImplicit URI (recommended)what configs do I need to do.I was successfut only Explicit URI way by configuring the Vhost.xml. How would I do for others?
Question basically is that, on server side it needs to pull an RTMPE stream coming out of an origin server. tried a demo setup but could not get it working. is this feature supported in 3.5?
I'm having a very basic problem, im trying to do a slow zoom/scale of an image (jpg), in this case its a company logo. the problem im having, as you'll see is that this causes edge effects, they are shakey/aliased.almost looks like some sort of antialiasing is required.
What im seeing is an odd white outlining around the edge of my sprite:Its really odd, the outline only becomes visible after applying my ColorMatrixFilter. There is no outline on the asset itself.[code] I have uploaded a small sample project here: URL...
Is it possible to use origin/edge setup when streaming using HDS ? I have succesfully tested using RTMP but when I try the HDS string - get error "we are having problems with playback". I can view the stream directly if I connect to the origin server. I have 1x origin server and 1x edge server.
I have a Flex3 LineChart component using an CircleItemRenderer and the datapoints are being cut off because they are too close to the edge. Here's what it looks like: [URL] As you can see, the circles on the left and right sides are being cut off. How can I make the LineSeries area, plus the horizontal labels, narrower so it fits in the chart area?
I use CollabNet's Subversion Edge to manage a repository for a PHP/ActionScript based project I am building in the Eclipse IDE. In my project's root folder, Eclipse included several configuration files that aren't directly related to the project. How can I set up my repository to ignore these files/folders via CollabNet? Would it be through the "Repository Access Rules"?
my stage is set at 500x400 in flash cs4. I created a rectangle for the background and set the same size as my stage that covers the whole stage but I noticed when I hit ctrl+enter to test the movie clip, it initially looks fine but when I expand the window large, you can see white area all around.