ActionScript 3.0 :: User Can Paint Whatever Shape Onto Stage
Apr 26, 2009
I'm trying to make a "paint on" effect so that when the user clicks down, they can paint whatever shape onto the stage. I really need it to look like a "spray paint" effect, and I'm having a hard time animating this.
I`m working on a app that you can draw lines.....like circles, rectangles... my problem is when a user draw a circle for example....i wanna be able to paint (change color) inside of this circle. I`ve tried working on Shapes with cacheAsBitmap = true and Bitmaps with BitmapData but it doesn`t seens to work.
I'm on the user have to be able to draw/trace outlines of different shapes. So for example an "S" shape is on the screen, and the user needs to try to draw OVER that shape. So it's not just mouse recognition, it has to see if the user draw over that shape good enough. So it's kind of like a colorbook but you only draw the outline of the shape, if you know what I mean.
I've been searching the web and haven't found any pre made solution for this, but I thought that before I try to make it all from scratch I could ask you guys here about it.
I found a nice script for drawing a donut shape. I don't know why it only works with using 'this' or ' _root' . You should be able to apply this to a movieclip?Or am i missing something?[code]
How would I make it if I wanted a function (that happens to run on event MouseEvent. MOUSE_DOWN)to run while mouse is down, not just once. For example, I have this code:
My keepCreating function creates a random shape on the stage. But since it runs once during mouse_down, only one shape is created until you activate mouse_down again (by lifting the mouse button and pressing down again).
What I want it to do is keep creating shapes over and over again, instead of creating one shape per mouse_down.
I need to have a shape (black rectangle) that will cover the stage. It should resize with the stage when needed. I'm trying it with the following code, but when it's resizing, there is a clipping effect that is visible and it is not fluid. How can I prevent this? Code: Select all stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; stage.addEventListener(Event.RESIZE, resizeHandler); var blinder:Shape = new Shape(); [Code] ......
I am trying to make a so called pixel effect in witch I want to make a shape only from pixels that are positioned in some random place on the stage. And all these pixels move to a certain point and create that shape. I've been looking into BitmapData Class but I don't now if that is the best way to do it.
i want simulate Billiard ball in my project. but my code does not work good. when start with (for example) 34 degree , when hit with wall(stage in this example) return with true degree. in flash , as3
ActionScript Code: package { import flash.display.MovieClip; public class Base extends MovieClip { public var baseHP:int = 50; var newRect:Shape = new Shape();
1046: Type was not found or was not a compile-time constant: Shape. 1180: Call to a possibly undefined method Shape. What does it mean by "undefined method"? I am somewhat of a newby, so sorry if there are any stupid errors
Id like to know if there is a way to do a shape hitTest.Not as the normal hitTest would do, but shape colliding another shape, not the rectangleof a movieclip.It can be in a movieclip.
I've created a drawing app via AS and I'm trying to design a button that when pressed, the user essentially saves his/her drawing as an image file into a certain directory on the web
What is the difference between dragging a movieClip to stage from the user interface and inserting it from code? What I mean is....I noticed that if I drag a movie clip from the library to the stage, give it an instance name ('xx'), I can access it from code using "this.xx". However, if I add the movieClip from code using:
var ch = new MovieClip(); ch.name = 'xx'; addChild(ch); I cannot access it using this.xx, but I have to access it using this.getChildByName('xx');
I have a movie clip on the stage, which is a record. What I want, is for the user to be able to move the mouse over, click down, and spin the record left and right. To confuse matters, I would like to keep the record spinning (tapering to a stop) after they flick the cursor across the screen in either (any) direction.
I also need to set a maximum velocity (?), whereby when it is spun hard enough, an event is triggered. I gather this will just involve querying the number of rotations within a given time. The alternative is to just make a spin animation that activates when its clicked, but I figure this would make it a lil more interesting.
I'm a student at Drexel University and I just completed a basic platformer for a actionscript class. My professor docked me some points for the game not working until the user actually clicks within the swf. I've heard that this problem is caused on mac osx, but I don't have any concrete evidence to get the points back. Here's a link to the game if you want to check it out.
what I'm trying to do is allow the user to pick a section of the stage, click, and have the region defined be copied and show up on the other side of the stage. It may be better explained to think of it like a camera game. The player has cross hairs, can move the square (which tracks the mouse) around the stage, and click to capture that square's pixel information, store it to a new movieclip and display it on another area of the stage.
I've found many resources online about capturing BitmapData, including capturing from embedded FLV videos, but I haven't seem to be able to find anyone who has created something like this which captures from a moving region. However, I have seen it done before in a game that is no longer online from PBSkids.org.
Here is what I have so far. Right now, when I click the movieclip loads all white pixel data and I'm not sure why.
'i am doing a game for children where users can drag and drop resize and scale movie clips on stage! The drag and drop is not an issue...however im not quite sure how to do all the rest... is there a way or a tutorial to do this?
What I want to achieve is active links like in HTML websites.I have 3 buttons on the stage, when the user clicks on the first button it should be highlighted and should remain in that position till the user clicks on the next button. When he clicks on the 2nd button the previous one should come in normal state and the 2nd one should become highlighted and so on....
possible to create a button that will return the user to an exact postion on the stage? For instance, I want to create a back button at the bottom of the stage, and when someone presses it, it takes them to the top of the stage? I am using Flash CS4 on Windows.
I would like a single horizontal line to go across my 100% x 100% stage, but how do I do that? Im thinking its about knowing what resolution the viewer has, and the writing a script for the line, but how?