Ok, basically, how do I add input fields ONE AT A TIME at runtime, so that I can UNDO them, one by one ?
This is a ‘Whiteboard’ function and I’ve done the above for lines and shapes, no worries.
However, when I try to add Input text fields in the same way (one by one) nothing appears on screen.
This is the working code for drawing squares:
_root.canvas[“stroke”+d].lineStyle(2, 0xcb6f14, 100);
_root.canvas[“stroke”+d].moveTo( xm, ym );
//_root.canvas[“stroke”+d].beginFill( 0xcb6f14 );
_root.canvas[“stroke”+d].lineTo( (xm + _global.dia), ym);
_root.canvas[“stroke”+d].lineTo( (xm + _global.dia), (ym - _global.dia));
_root.canvas[“stroke”+d].lineTo( xm, (ym - _global.dia));
_root.canvas[“stroke”+d].lineTo( xm, ym);
…so you can see _root.canvas[“stroke”+d] is the array which increments with each item drawn. This works fine, users can UNDO one entry at a time.
Now, the same idea for the input text fields:
_root.canvas[“stroke”+d].createTextField(“mytext”,1,_xmouse,_ymouse,300,20);
_root.canvas[“stroke”+d].mytext.type = “input”;
_root.canvas[“stroke”+d].mytext.selectable = true;
_root.canvas[“stroke”+d].mytext.multiline = true;
_root.canvas[“stroke”+d].mytext.wordWrap = true;
_root.canvas[“stroke”+d].mytext.autoSize = true;
myformat = new TextFormat();
myformat.color = 0xcb6f14;
myformat.bullet = false;
myformat.underline = false;
myformat.size= _global.textsize;
myformat.font = “_sans”;
_root.canvas[“stroke”+d].mytext.setNewTextFormat(myformat);
Does this make sense to anyone ? Has anyone achieved this before ?
I can send the full code…
Thanks so much.
Puzzled, Australia.