Object Drawing Poorly Aligned Bounding Box?
Oct 6, 2009
Whenever I draw a shape with Object Drawing turned on the blue bounding box that appears whenever it is selected isn't aligned properly to the outer edgers of the shape. Like this:
Admittedly it isn't a major problem it's just a bit irritating especially when people I'm teaching to use Flash ask me why it looks the way it does.
Does anyone else have this problem?
View 11 Replies
Similar Posts:
Jan 16, 2010
The AS3 getBounds function returns a rectangle that is not fitting tightly to a rotated ellipse. Instead it returns an axis-aligned rectangle based on the bounds of a rectangle whose width/height corresponds to the max/min diameter of the ellipse and follows its rotation.
Stack Overflow Q/A about the math of ellipses and bounding boxes
Based on this I took a stab at coding a solution in AS3. So far I have been able to produce a rectangle that fits perfectly along the x-axis, but as I rotate my ellipse it acts very weird along the y-axis. Rather than alternating between 2*r_min and 2*r_max while rotating, it alternates between 2*r_min and 0. My best guess is that I have done something wrong when solving the differentiated t for gradient -> infinity...
Here is an example from my code:
var r_max:uint = 45;
var r_min:uint = 20;
var rot:Number = ellipse.rotation * (Math.PI / 180);
var t_nil:Number = Math.atan( -r_min * Math.tan(rot) / r_max);
[Code].....
View 1 Replies
Nov 6, 2011
I need to draw bounding box surrounding a movieClip with arbitrary registration point with AS3. The movieClip may be of any shape and can have it's registration point anywhere.
View 5 Replies
Dec 29, 2010
I want to make an XML document from an HTML one so I can use the XML parsing tools. My problem is that my HTML is not guaranteed to be XHTML nor valid. How can I bypass the exceptions? In this string <p> is not terminated, nor is <br> nor <meta>.
var poorHtml:String = "<html><meta content="stuff" name="description"><p>Hello<br></html>";
var html:XML = new XML(poorHtml);
TypeError: Error #1085: The element type "meta" must be terminated by the matching end-tag "</meta>".
View 3 Replies
Feb 11, 2009
It seems that dropTarget only returns the name of the object that is directly under the mouse. Does anyone know whether there is a simple way for it return the name of the object that is under the entire bounding box of the object being dragged?
View 1 Replies
Nov 1, 2010
Is it possible to make a bounding circle instead of a bounding box?The objects should bounce INSIDE the circle.I have now a bounding box outside the circle, but the objects exceeds the circle at the corners.
I was thinking of making an array of Points on the edge of a circle and when the object is < or > then do something... but that would be a lots of if/else statements.
View 3 Replies
Jul 22, 2009
Basically I've got a reasonably complex drawing object in a fla and I want to reproduce it in a class definition using the drawing api. However obviously this is a tedious task, so is there some trick or automated method of doing this?
Last time I needed to do this it was a drawing of an arrow and I ended up writing down x,y,width,height values for everything but this one has curves in it which I don't have experience with drawing anyway.
View 2 Replies
May 6, 2010
So I am loading some very poorly built AS2 swfs into an AS3 file.I am able to open them and close them (addChild and removeChild)The problem I am now faced with is each of these AS2 swfs contain video using the AS2 FLVPlayback component. When I open the first SWF, the video plays fine, I close the SWF(removeChild). Then I go to open the next and the video will not play.
If I reload the page and open that second video first, it works.It seems when I watch a video for the first time no matter which AS2 swf I pick, it works. Its when I close it and open another one is when it doesn't work..
View 1 Replies
Oct 20, 2011
I'm scaling text from small to large using tweens, but when the text is scaled, it turns into these unreable blobs. The text is still editable, just not useful. (The output looks fine, however.)Is there a setting, or a different method, I should be using to scale text in a tween to prevent this?
View 3 Replies
Aug 28, 2009
I've received a number of graphics from an Illustrator user - they imported as symbols containing drawing objects. When I opened one of these symbols and tried to tween (fade out) the drawing object, I don't have the Alpha option. I don't use Illustrator myself and I had to install CS4 so I'm not used to that either.
View 4 Replies
Apr 16, 2009
I'm having a hard time with strokes. First I selected a stroke and the properties panel would not let me change it's thickness. How to add a stroke to an object. We used to have a tool that allowed us to apply a stroke to an object. That is gone now. How we attach a line to an object now?? It looks like Adobe has changed Flash CS4 to be more like Photoshop. It is about as intuitive as a tax form.
View 1 Replies
Oct 23, 2009
Well, I've been using flash a while, but I just ran into a newbie problem.. I must have hit some sort of hotkey, but I can't figure out how to undo it or anything in the preferences. Anyways, I'm running Flash CS4 and normally when you draw a shape and select that shape it selects the fill and it looks like little dots all over the shape when its selected. Now when I click on a shape it has a border around it and I can't just select a piece of the shape. Also, what's bothering me is that when you draw two shapes on top of each other, Flash used to merge those shapes automatically, but now they are staying separate unless I manually Union them. It still says they're drawing objects, its not converting them to symbols or anything, but they are kind of acting like symbols in the way I can interact with them. How can I turn this setting off?
View 2 Replies
Aug 10, 2009
In my movie I have a round drawing object, which I wish to view enlarged (about 2000% of original size). While editing it looks fine and round but after publishing all the roundness is lost and instead I get visible angles. I attach 2 images to visualize, one from the editing stage and the other after publishing. Is there any way I can get around that strange effect? I created the image from some text i "broke apart" to a drawing object.
Attachments:
edit.png (2.5 K)
published.png (1.3 K)
View 6 Replies
May 26, 2010
I got a europe map designed in flash (1 movieclip, 1 frame, really simple), which contains the map as drawing objects directly inside the scene and in addition some specific countries as clickable buttons. So far it's working fine. What I need now is to make all the other drawing objects clickable without having to edit and script each object. I'm thinking about something like this (pseudo code):
foreach(obj in MovieClip) {
if(obj !typeof(Button)) {
obj.addEventListener(MouseEvent.MOUSE_DOWN, genericClickListener);
}
}
I just don't know the syntax how to achieve that.
View 1 Replies
Oct 5, 2010
I'm trying to debug AS3 code on production. I have no access to trace(), can't write to disk or open a socket. What I want is to display something on screen.
With AS2 I could just access _root and create a text field with my trace data.
how I can pull this off with AS3? My class extends Object, it is not a sprite and is never added to a parent display object.
View 1 Replies
Sep 26, 2009
This is one of those things that seems like it should be really simple but doesn't work.
I'm trying to create a movieClip using the drawing API, but once I do so I can't get it to move with ActionScipt. My code looks (basically) like this:
Code:
drawBox = function (options) {beginFill();
lineStyle(blah);
moveTo(blah);
[Code].....
View 2 Replies
Oct 28, 2009
I have 2 shapes, in different color, and i would like to have this effect ( see the attached file ).
How can i achieve that by using pure actionscript 3, or using source like TweenLite, TweenMax etc...
View 4 Replies
Apr 21, 2009
I'm doing this project, about 2 lines intersecting each other(the 2 lines are not always on the same position). I try to find the intersections point using collision detection method but how do I place an object on the intersections point?
if(line1.hitTestObject(line2)) //
So this is how we find the intersection point but we do not know how to draw / place an object on the intersection point.
View 6 Replies
Aug 24, 2011
how to turn that "Drawing Object" thing off! I cant even fill it in! (the thing i draw) Im using Flash Pro CS5
View 1 Replies
Jan 13, 2009
I have a movieclip containing a vector drawing, can I dynamically change the color of the fill and line in AS2, or do I need to use setRGB and divide the movieclip?
View 1 Replies
Feb 6, 2011
I have the following display hierarchy:- - container- - - objectI need to draw 'object' to a BitmapData instance which matches object.getBounds(stage) rectangle area. So the first part is easy:
ActionScript Code:
var rect:Rectangle = object.getBounds(stage);
var bmp:BitmapData = new BitmapData(rect.width, rect.height, true, 0x00000000);
[code]......
View 2 Replies
Jul 1, 2010
I'm creating a flash based dynamic electrical circuit board and have come across a problem. I have a function that is a fired from ENTER_FRAME event that loops though an array where each element contains the following:
'#parentObject1#ChildObject1#parentObject2#ChildOb ject2#Colour'
To Clarify - A line should be drawn from ChildObject1 to ChildObject2 in the saved colour. The above is a string. I slice at each '#', which is working. Each object gets added through my created toolbox so added dynamically.I can get the DisplayOBject of the parents by using - var obj1:displayObject = getChildByName(sliced[1]);
But cannot do the same for the Child object by - var subobj1:displayObject = obj1.getChildByName(sliced[2]);The reason for this is that each parent can be dragged so I would like the drawn line to move with the children.how to find the child objects
View 4 Replies
Oct 23, 2009
I'm trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framework is the Graphics object being passed around in the hierarchy to achieve the drawing. I want to get to the level of 2D API.
View 1 Replies
Jan 26, 2009
Right now I can create a straight line from mouse down to mouse up. What I can't quite get is a preview of that line. does anyone know of a simple way to show a preview of the line while the mouse is still down and the user is moving the mouse?
What I have now:
Code:
var clip:Shape = new Shape();
addChild(clip);
stage.addEventListener(MouseEvent.MOUSE_DOWN, startLine);
stage.addEventListener(MouseEvent.MOUSE_UP, drawLine);
function startLine(evt:MouseEvent) {
clip.graphics.moveTo(mouseX, mouseY);
} function drawLine(evt:MouseEvent) {
clip.graphics.lineTo(mouseX, mouseY);
clip.graphics.lineStyle(1, 0xff9933);
}
View 2 Replies
Jul 12, 2011
i am trying to take photos using webcamera from online web application and i got sample code from [URL] It is working fine to take photos online with the attached web camera and saving it into server for future purpose. Here my problem is i want to keep horizontal and vertical lines on top of the camera area but what ever line i am placing all displaying behind the video area and camera area is displaying ontop of all layers.
View 1 Replies
Mar 25, 2006
make a drawing object move around the browser randomly and incresing it's size from 100% to 200% at anytime. Plus changing it's alpha.. all those with actionscript.
View 1 Replies
Jun 14, 2006
i am trying to make a drawing board(like colouring book) where when i click and MOVE THE MOUSE it colours the object(more like a brush and not as a paint bucket)i would like to know how to colour objects individually(without coloring background) and the most IMPORTANT is there any way to detect what percentage of object had been colored(like if 100% of object coloured something happens!)
View 2 Replies
Jan 18, 2009
please look at this jpg its a screen shot of a standard flash doc on my comp - as you can see the page is aligned to the left and i don't know how to centre this in a page its frustrating because i cant bleed objects off the left of the page.
View 2 Replies
May 21, 2009
I'm pretty new to flash but recently got an assignment at college to produce a childrens game, I've been following a tutorial online to produce a jigsaw puzzle, so I can get use to actionscript and gain a little experience. I cant get some alignment right. I've followed this tutorial exactly and this is where i am stuck, below are the instructions and how it should look:
This is how mine looks, as you can see its out of place:
View 2 Replies
Jan 28, 2011
I have my movieclip follow my cursor but it appears in the top left cornor of the screen when I click the button and never alligns with the cursor.
Code:
public function gomust (e:MouseEvent):void
{
var mustMC:mustmc = new mustmc;
[code]....
View 6 Replies