Skip to main content
Participant
October 11, 2012
Question

Saving A Drawing on a Drawing Pad ???

  • October 11, 2012
  • 1 reply
  • 551 views

Hey,

I would like to save the drawing that users do on my drawing pad (so that anyone can contribute to the same drawing), does anyone know how to do this?? I have never used Flash before so I very much have no idea about whats going on. My drawing pad works fine, but I don't know how to save it or even how to test if it saves. I thought I might be able to use remote shared object with persistence, but I don't know how to integrate it to my actionscript.

This is what I have now:

lineThickness = 0;

selectedColor = "0x000000";

_root.onMouseDown = startDrawing;

_root.onMouseUp = stopDrawing;

function startDrawing() {

          if (_xmouse<455) {

                    _root.lineStyle(lineThickness, selectedColor);

                    _root.moveTo(_root._xmouse, _root._ymouse);

                    _root.onMouseMove = drawLine;

          }

}

function drawLine() {

          _root.lineTo(this._xmouse, this._ymouse);

}

function stopDrawing() {

          delete this.onMouseMove;

}

line0.onPress = function() {

          lineThickness = 0;

};

line3.onPress = function() {

          lineThickness = 3;

};

line6.onPress = function() {

          lineThickness = 6;

};

colorRed.onPress = function() {

          selectedColor = "0xFF0000";

};

colorGreen.onPress = function() {

          selectedColor = "0x00FF00";

};

colourPink.onPress = function() {

          selectedColor = "0xFF66FF";

};

colourBlue.onPress = function() {

          selectedColor = "0x0033FF";

};

colourLGreen.onPress = function() {

          selectedColor = "0xCCFF33";

};

colourOrange.onPress = function() {

          selectedColor = "0xFFCC00";

};

colourYellow.onPress = function() {

          selectedColor = "0xFFFF00";

};

nc = new NetConnection();

nc.connect("webaddress";

so = SharedObject.getRemote("drawLine", nc.uri, "/a/b/c");

so.connect(nc);

so2 = SharedObject.getRemote("drawLine", nc.uri, "/a/b/c");

Please help me!!!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 11, 2012

check the bitmapdata class'es draw method.  make sure it's available for your fp target.  i believe you can use it with fp 8.

check the filereference class to see if it's available for your fp target.  i don't believe it is.

if either are not available you should consider changing your publish settings.