okay, so i have a basic drawing app based on http://jerryscript.hostrocket.com/flash/draw/SWFDrawing2JPEG.html which looks something like this:
drawing = false;
data = ‘’;
_global.linethickness = “2”;
_global.linergb = “0xFF0023”;
_global.linealpha = “80”;
with(_root){
onMouseDown=function(){
if(_root.board.hitTest(_root._xmouse,_root._ymouse)){
drawing=true;
xposition=_xmouse;
yposition=_ymouse;
moveTo(xposition,yposition);
}
};
onMouseUp=function(){
drawing=false;
};
onMouseMove=function(){
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,_ymouse);
if(drawing==true){
lineStyle(linethickness,linergb,linealpha);
lineTo(_xmouse,ymouse);
root.data+=xposition+'‘+yposition+’‘+xmouse+'’+_ymouse+‘-’;
xposition=_xmouse;
yposition=_ymouse;
}
updateAfterEvent();
};
}}
send.onRelease = function ()
{
getURL(‘create-swf.php’, ‘_blank’, ‘POST’);
};
when ‘send’ is pressed, it loads a php script which retrieves the line data and redraws it thanks to MING like:
$data=$HTTP_POST_VARS[“data”];
$movie=new SWFMovie();
$movie->setDimension(500,300);
$movie->setBackground(255,255,255);
$s=new SWFShape();
$s->setLine(1,0,0,0,255);
$lines=explode(“-”,$data);
for($l=0;$l<count($lines)-1;$l++){
$lineData=explode(“_”,$lines[$l]);
$s->movePenTo($lineData[0],$lineData[1]);
$s->drawLineTo($lineData[2],$lineData[3]);
}
works fine.
problem is, i can change the colour and tha alpha and the linethickness in the flash bit (changing the ‘line…’ variables) but i cant figure out how to store the different info and then bring it back in the php file…
anyone help?
stuck.