Sketchfu.com enables a user to make a drawing, but how can it record and replay the animation? Could anyone do this for me or explain how it's done?
Hi its not complicated at all. in a nutshell (as2): declare your variables like linewidth, and color, and stuff make the buttons to enable the user to change those variables you have to declare an array, you will record the user actions into it draw the stageMC write the functions for stage mc there are need to be an onPress and an onRelease function and a drawing/recording function it has to be associated with a variable, like this: var draw_n_rec:Function=function(){ bla bla bla } Code (markup): the onPress function looks like this: stageMc.onPress=function(){ stageMc.onEnterFrame=draw_n_rec } Code (markup): the onrelease: stageMc.onRelease=function(){ delete stageMc.onEnterFrame } Code (markup): basicly the trick is that in the draw_n_rec function you create an object, in wich you "save" the mouse position, the actual linesize, line color, etc, and a time variable. push this object into the array you have declared previously. And draw out to the stage the current step. And because we have this function as an onEnterFrame, this will happens in each frame. If the user releases the mouse button the recording stops. simple, isnt it? you can create a function to play back the drawing. it should simple go over the array and repeat the steps. you have to work out the details (there is a few) but this is the concept of it, and if you know flash it shouldn't be too hard feel free to pm me
oh, and if you want your application to be able to save the data you have to use php or similar server side script.
Hi, I did a project like that a while ago, I didn't use onEnterFrame (it would kill the CPU if you're running 24 fps), I used onMouseMove since drawing will only occur on mouseMove. The saving was done with delta packets and a webServiceConnector. The application integrated user registration and login as well. Pretty cool. I can build you a custom solution. If you're interested, drop me a line via pm or through my site: http://www.sidani.info Here's the portfolio: http://www.sidani.info/portfolio/ Regards.
Guys, I'm still looking for a flash programmer to help with this? Anyone on DP available for this paid project?