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.
I have 2 shapes drawn with the drawing api - the points are stored in an array like this... Code: Select allprivate var shape_points : Array = [ [81,61],[81,46],[84,43],[84,0],[11,0],[0,5],[0,48],[69,48],[81,61 ] ]; Both shapes have the same number of points. I need to tween the points from one shape to the other using tweenlite/max or tweener.
What I'm trying to build is what you could call a scrolling drawing board - just like a drawing board but when the mouse comes close to the edge of the window, it scrolls and lets you continue your drawing. I have no problem creating a drawing board with API, but i can't make it scroll. Usually when i want to scroll a background image i make it move along with the mouse when the cursor is near the edge of the window (for example, if the mouse's coordinates are above a certain number, the background image starts moving in one direction so it "scrolls" in the other direction). So i wanted to do this with the movieclip of the drawing in a drawing board (make it move according to mouse's coordinates near the edge of the window), but when i scroll i have to stop the mouse at the edge of the window because i cant go any further :p so the drawing moves but it stops drawing. Or maybe what i need is some way to draw even when the mouse is not moving.
I have imported a lot of paths from an Adobe Illustrator document right into a flash file. The paths exists as Drawing Objects inside the scene. Using pure actionscript, how can I move a symbol following each of the lines, without using predefined Motion Guides.
EDIT: I've attached the Flash file, full of drawing objects.
http:[url]....
The question is: Are these drawing objects accessible through AS3 or I should convert them to symbols / whatever format necessary.
I know Sprite.graphics is pretty easy to use, but I was wondering if there is any ready made libraries for drawing, resizing, moving, layering, etc.. of various display elements? Also, stuff like tool selection, maybe some effects, premade shapes. Anything you would recommend?
I drew a line (stepVoltage) in a fla using the graphics class. Once drawn, I want to move it to the right in an update function, but am having trouble. I tride just moving the line with statements like stepVoltage.x = newX; stepVoltage.y = newY; but this didnt work. Then I tried to delete the previous line and draw a new one with a clear () function (see below) but this blocked the next drawn line from showing up.
The code:
var stepVoltage:Shape = new Shape (); stepVoltage.graphics.lineStyle(2,0x000000); addChild (stepVoltage);
I'm trying to dynamically addChild a Sprite to an already tweened MovieClip (tweened on the Flash timeline). Let's say ObjectA is the tweened object, I published it in my swc and linked it to my Actionscript project in Flash Builder. I make an instance of ObjectA in my class, and then try to do the following:
var objectA:ObjectA = new ObjectA(); var objectB:ObjectB = new ObjectB(); objectA.addChild(objectB); addChild(objectA);
Now, the problem is, objectB doesn't tween along with objectA. Is there any logical solution to this?
I am trying to do a apply a tween for the width property on a MovieClip Object but every time it changes the width and the position too, and I don't want that. I want to change the width going to one side without changing the x and y of the object.
I tried both of thes and they gave the same result.
var c:Tween = new Tween(left, "scaleX", Strong.easeOut, 1, 1.5,20,true); var c:Tween = new Tween(left, "width", Strong.easeOut, 20, 200,20,true);
I think it is applying the transformation according to a center of the movie clip. but I don't know how it can be changed.
Im working on a small project and it involves a guy which you move with the arrow keys. The arrow keys add to his x, y velocities and his position is updated accordingly. How can i get this man to grab onto an object and spin around it (like when you grab pole and letting your momentum swing you around) . I can make him grab the object but I dont know how to modify his x,y speeds to simulate the arc.
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.
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.
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?
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)
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?
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):
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.
I am using the reflect class at [URL]. It works fine for the first playthrough. Yet, when the movie loops again, it creates another instance and again on the next loop through. There is only one object on the page and the script is: import com.pixelfumes.reflect.*;var r1:Reflect = new Reflect({mc:box, alpha:50, ratio:50, distance:2, updateTime:0, reflectionDropoff:1});
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.
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?
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);
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:
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
class Stand { public static const STAND_LIST:Array = new Array(); STAND_LIST[0] = new Array(); STAND_LIST[1] = new Array();
[code]...
is the STAND_LIST[0] keeps created every new instance of Stand created? or is it created just once?if it's created every new instance of Stand created, how do i make it run just once?(like initializing const)