Flash - Draw 3d RGBA Point On Stage Not Using 3d Engines?
Dec 17, 2010
we have values generator that outputs someting like FF00FF5F. We have some coordinates like 50, 300, 10. We want to draw a point in 3d on stage. Not using PV3d or anething like that. thay say there is going to be no default z sorting but I can live with that...
We have values generator that outputs someting like FF00FF5F. We have some coordinates like 50, 300. We want to draw on stage. (I mean we opened new .fla doc in flash, pressed f9 and started coding, sorry - I am new to flash)
I didn't know where this should go; I thought this was the best place. In Actionscript 2.0 I'm trying to draw the shelf of a closet (wall-to-wall) but I don't know how to.
This should be a bit of simple geometry: How do I calculate the points to draw the lines in the code below so that it makes a 2D cone or wedge shape?
import flash.geom.Point;
//draw circle var mc=new Sprite()[code]...........
UPDATE:I should have mentioned my aim is not to draw a wedge shape, but to draw a line from a random point to the edge of an existing circle.If you're more comfortable with algebra than actionscript,
I am using the draw() method of the BitmapData to encode a jpeg of part of the image. Now this should be easy enough given the object I want to draw to the bitmap is on the stage at design time so I know its location and dimetions exactly! Heres the code I have in place.
Code: var myBitmapSource:BitmapData = new BitmapData ( street.width, street.height, false, 0x333333); myBitmapSource.draw(street, null, null, null, new Rectangle( 96, 5, 571, 450 ), true );
I know for a FACT that no part of the street clip I am drawing out is in negative space, and it's registration is (0,0). However, it cuts off A lot of the top of my image. y=5 in the above rectangle is where I need the top to be, but it cuts the top off of the image... even if I change it to 0, it has no effect.
I've got a bunch of text that I need drawn on a bitmapdata. I was wondering if there was a way to draw them at certain spots on that bitmapdata WITHOUT creating individual bitmapdatas for each of the pieces of text.
I am having an issue with using BitmapData.draw(stage). I am getting the following error:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: file:///C|/Documents%20and%20Settings/bla...bla...bla.swf cannot access null. No policy files granted access. Here is a portion of my code:
var bd:BitmapData = new BitmapData(2800, 2100); bd.draw(stage);//this is where the error happens All of the files referenced (.xml/.jpg/.swf) are located in the same local folder as the main .swf. How do I get around this error? The main objective is to print the stage using PrintJob(). I am using Flash Professional CS5.5 and publishing to Flash 10.0/10.1. Let me know if I need to supply any more info.
I am trying to make an animation where there are several locations(say A,B,C,D,......) made on a map. If a person clicks on one location A and then another location B, I wanted to draw a dotted line from point A (from destination of the plane) to point B (to destination of the plane) using AS3.
I have a motion tween right now with a moving point that is following a copied and pasted motion path. Is there a quick way to have the point draw a line behind it as it moves along the motion path??? I can't seem to find a good way to do it in AS3.
I wish to draw a (hair-)line, from one point to another. The drawing-api at [URL] gives a nice explanation, but flash is slightly off. The lineTo statement draws a line towards the specified point, not to. It's probably a matter of opinion, but I'm fairly confident that we all agree that drawing a line from (1,1) to (5,1) should result in a line 5 pixel long. That's how we've all learned it when we were young, that how other programming languages do it, etc. (One could state that 'going to school' doesn't mean you actually enter the building , but that's just avoiding the issue) But not Flash. Drawing this line results in a line of only 4 pixels long, the line stops at coordinates (4,1). I can see the benefits in this when drawing (transparent) connected lines and closed shapes, but it has it's drawback when creating single lines.
I'm probably not the first one to run into this problem. Maybe it's just a setting somewhere? How do I get flash to draw a line to the exact point I specify? Preferably without having to analyze the direction of the line and moving the destination coordinates one pixel further.
I have a movieclip on stage that I draw into a bitmap, how do I change the registration point, the code below produces bitmap with half chopped off:
var bitmapData:BitmapData = new BitmapData(mc.width, mc.height, true, 0x00FFFFFF); var matrix:Matrix = new Matrix(); matrix.translate(0, -mc.height/2);
I am very new to actionscript 3.0 & currently i have a project to do that required actionscript. ActionScript Code: package{ //package import flash.display.Sprite;// for sprite, to prevent 1046 error code import flash.events.MouseEvent; //for mouseEvent, to prevent 1046 error code import flash.display.Shape; //for shape, to prevent 1046 error code public class gridDrawLineTesting extends Sprite //for mouseX mouseY [Code] .....
This is the code that I have found from various web and paste it into one. I want to draw straight line & snap to that point at the same time. My problem is when I click at 2nd point, there is a 'extra' line at (0,0) joining towards my 2nd corrdinate point. I want to get rid of that 'extra' line.
I'm attempting to make a curve drawing tool a bit easier to use.Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?(I googled this, but found mostly info on cubic rather than quadratic curves)
I'm attempting to make a curve drawing tool a bit easier to use. Rather than drawing a basic curve and then clicking on the control point to change it, I would like the user to be able to click on the curve itself to change it, much as you do in the FlashIDE.
So, given start and end points, and a point on the curve, how do you determine the control point for use with the MX API?
I need to have 2 kinds of masks, one with a registration point in the top left so that when I tween its height it expands downwards, and one with a registration point in the bottom left so that when I tween its height it expands upwards?how do i do that, with code ofcourse?i have made something but i dont know if its the right way:(this expands downwards, but i dont know how to get it to expand upwards)
Code: import gs.TweenLite; var subMask:Shape = new Shape();
I'm working with a few designers, each of whom have created 3D animations (using fp 10 capabilities) for use in the same flash application. Each 3D animation is a unique movieclip that will ultimately be part of the same .fla file.
The problem I'm having is that each of the movieclips was created in a separate .fla, and each .fla had different settings for the vanishing point for the stage. This means that after importing the various moveiclips into my library, none of the visual assets are aligned as they were in their source .flas.
The good news is that only one of these movieclips is displayed at a time, so I don't need to be able to have multiple vanishing points; all I need to do is change the global vanishing point programmatically at various points during runtime.
What should I do? I've tried accessing root.transform.perspectiveProjection.projectionCenter and dynamically assigning it new Point(x, y) values, but they don't seem to be having any effect on the 3D movieclips.
I am currently digging into the whole Flash 3D stuff and I am quite unsure which engine I should use. I really prefer haXe for development but ActionScript 3 is also fine.My current candidates are:
Papervision3D Alternativa3D Sandy 3D (only engine with native haXe version) Away3D
I have the following code to create a Sprite with a rectangle in it:
container = new Sprite(); container.graphics.beginFill(0x00CCFF, .5); container.graphics.lineStyle(1, 0x00CCFF);[code].......
The only thing is, I'd like the registration point to be in the middle (not the top left corner). Is there a way to set up the registration point in the middle of the rectangle, but still have the position of the rectangle be correct?
i.e. not moved over so that the top left corner of the rectangle is in the "middle" of where I want the rectangle to be...
I am kind of new to flash and I want my flash site to get the best results from search engines.So I found SWFOBJECT is this the way to go? Also how do I use it? Is there any learning videos out on the web.
What are the pros and cons of various Flash 3D engines with regards to performance on mobile devices? Which do you prefer -- which have you tried (examples of apps developed) implementing on mobile devices?
why flash player on MAC dosen�t handle well to many tweens at the same time, I tried using laco tween engine and MC Tween, so far this last is the best, but the performance is so bad on mac, why this happens?
Is there any clear view on how to build 3d apps in flash? I have heard of paperview(?) and recently saw something called Away3d. Are there any other choices and any clear leaders?
Can someone explain me why flash player on MAC dosen't handle well to many tweens at the same time, I tried using laco tween engine and MC Tween, so far this last is the best, but the performance is so bad on mac, why this happens?
I am trying to have flash draw a line from the center of the stage out and increment around the stage. Not sure what math I would use to do this though. So far I have the line going out to a certain point but not sure how to change that point so that it circles around whatever the dimensions of my stage would be.
So far I have this:
var linetox=0; var linetoy=0; var _stage=this;[code]...
which obviously moves the destination ending of the line lower and lower, just trying to get it to draw around the screen (like a clock)
I am trying to style a DataGrid component so that the background is transparent (Flex 4). Rgba colors work fine if I make "alternatingItemColors" an attribute on the component, but if I try to declare it in my css stylesheet, I cannot declare the alpha value.
If I enter the values as "0xFFFFFFFF", I get a parse error, because it's not proper css (of course, most of flex's css isn't proper css, but I digress...). So, is there any way to declare the alpha value of these colors in the css?
I want to make an editor like this site. [URL] If you browse this link you will find "Button. If you press this button you will navigate to a editor to design your layout. After draw a rectangle or circle or line you can resize that or can rotate that. When you finish if press the "you will back to the previous page where your desinged layout display. If you press the "" again then you will navigate the editor with the previously designed layout. I want to make a site like this. I want to use the flash cs4 to make the editor. Anybody knows how to draw a rectangle or circle shape with mouse and how to scale by setting the point and how to rotate by setting the rotation point also by using flash cs4 and as3?.