RE: [Flashcoders] Text Editor Undo/Redo Stack
Apparently that works in IE 5 and 6. IE 7 and Firefox throws an alert requesting permission for clipboard access; who'd what a website accessing the clipboard without permission? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Marsden Sent: 12 September 2007 11:46 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Text Editor Undo/Redo Stack skillz, thanks :) Muzak wrote: > Use javascript: > > //HTML > > > function getClipBoardText() { > var t = window.clipboardData.getData("TEXT"); > return t; > } > > > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
show us! :) James Marsden schrieb: Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. I've got everything working apart from the pasting of text. Does anyone know how it is possible to do this? Any cool tricks to access the clipboard from ActionScript (I've had a look online and found nowt). Cheers! James dr.ache wrote: Command done on the text! A command representing the action and the amount, like cut from location 3 to 24 of the text. The text you cut of must also be saved, certainly! James Marsden schrieb: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
ha, ok It's pretty fugly. All the functionality is accessed through ExternalInterface from JavaScript, so there are no Flash based buttons at all. As the person responsible for building the HTML hasn't focused on it yet, it mings a considerable amount. There are a few bugs still too, where undo/redo does unexpected things, and TextFormats aren't maintained throughout, but the guts of it are done! http://www.futurlab.co.uk/clients/kowari/ J dr.ache wrote: show us! :) James Marsden schrieb: Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
skillz, thanks :) Muzak wrote: Use javascript: //HTML function getClipBoardText() { var t = window.clipboardData.getData("TEXT"); return t; } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Text Editor Undo/Redo Stack
> Hallo, > > The text editor app is up and running now, thanks to those > folks that offered suggestions. I've got everything working > apart from the pasting of text. Does anyone know how it is > possible to do this? Any cool tricks to access the clipboard > from ActionScript (I've had a look online and found nowt). It's not possible without a wrapper. Our text editor runs within Director, so we paste the text into a Director cast member, then send it through to Flash. Unfortunately this messes up with non-Western text, so we search for "?" characters, and if there are more than a few in a row, we throw an alert that recommends the users use Ctrl-V instead. Never really understood the value of this security feature, especially given that Shockwave doesn't have it. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Use javascript: //HTML function getClipBoardText() { var t = window.clipboardData.getData("TEXT"); return t; } //FLASH import mx.utils.Delegate; import flash.external.ExternalInterface; function pasteClickHandler(evt:Object):Void { var t:Object = ExternalInterface.call("getClipBoardText"); trace(t.toString()); } paste_btn.addEventListener("click", Delegate.create(this, pasteClickHandler)); No idea which browsers it works/doesn't work in though. Check google for "javascript clipboardData" or "javascript execCommand paste" regards, Muzak - Original Message - From: "James Marsden" <[EMAIL PROTECTED]> To: Sent: Tuesday, September 11, 2007 11:32 AM Subject: Re: [Flashcoders] Text Editor Undo/Redo Stack > Hallo, > > The text editor app is up and running now, thanks to those folks that offered > suggestions. I've got everything working apart from > the pasting of text. Does anyone know how it is possible to do this? Any cool > tricks to access the clipboard from ActionScript > (I've had a look online and found nowt). > > Cheers! > > James ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. I've got everything working apart from the pasting of text. Does anyone know how it is possible to do this? Any cool tricks to access the clipboard from ActionScript (I've had a look online and found nowt). Cheers! James dr.ache wrote: Command done on the text! A command representing the action and the amount, like cut from location 3 to 24 of the text. The text you cut of must also be saved, certainly! James Marsden schrieb: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Yes, it is that "simple". :) Charles P. On 9/4/07, James Marsden <[EMAIL PROTECTED]> wrote: > > Hello, > > This is what I was thinking - I find it hard to conceptualise the time > aspect of undoing and redoing actions, and how to capture events such as > cut and paste... > > I guess cutting you just read the selected text at the point a Keyboard > event for X gets fired at the same time as CTRL is held down? Is it that > straightforward? > > J > > > > > dr.ache wrote: > > Command done on the text! A command representing the action and the > > amount, like cut from location 3 to 24 of the text. > > The text you cut of must also be saved, certainly! > > > > James Marsden schrieb: > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Yes, command based. If you were to follow Omar's version you could end up with a memory hog. Imagine a 4000 character text field/document. Storing a snap shot if that x20 is overkill in a bad way. Copy/Paste/Delete are all fairly simple. You might want to enhance your undo feature when you type. If a capture is made for every key stroke then you would quickly spend all your undos on a sentence. You should consider bundling like commands (such as typing) into a single command. Look at typing like adding characters to a paste command. For example, if you were to type a whole sentence and then UNDO, the whole sentence would be removed. But if you type most of the sentence and then paste text and then finish typing the sentence, you would end up with 3 commands (latter part of the sentence, paste, first part of sentence). You might also consider having the backspace count as a different command than typing alphanumeric characters. You could also look at the Enter command as a different command than alphanumeric as well. Both of these make natural breaks in command groups. Charles P. On 9/3/07, dr.ache <[EMAIL PROTECTED]> wrote: > > Command done on the text! A command representing the action and the > amount, like cut from location 3 to 24 of the text. > The text you cut of must also be saved, certainly! > > James Marsden schrieb: > > Hello all, > > > > I'm looking at building a very simple text editor application in > > Flash, which needs an undo/redo stack of around 20. > > > > My question is related to capturing the events in the stack; whether > > the done thing is to capture the state of the text field contents at > > every step, or just to record commands that are operated on the text > > field. For example, when cutting a piece of text, does the system > > record the state of the textfield when the cut is made, or does it > > just record the action and values related to it, ie. "cut /piece of > > text/ from string position 344". > > > > Any advice from bods with experience in this area much appreciated! > > > > Thanks, > > > > James > > ___ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Hello, This is what I was thinking - I find it hard to conceptualise the time aspect of undoing and redoing actions, and how to capture events such as cut and paste... I guess cutting you just read the selected text at the point a Keyboard event for X gets fired at the same time as CTRL is held down? Is it that straightforward? J dr.ache wrote: Command done on the text! A command representing the action and the amount, like cut from location 3 to 24 of the text. The text you cut of must also be saved, certainly! James Marsden schrieb: ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
Command done on the text! A command representing the action and the amount, like cut from location 3 to 24 of the text. The text you cut of must also be saved, certainly! James Marsden schrieb: Hello all, I'm looking at building a very simple text editor application in Flash, which needs an undo/redo stack of around 20. My question is related to capturing the events in the stack; whether the done thing is to capture the state of the text field contents at every step, or just to record commands that are operated on the text field. For example, when cutting a piece of text, does the system record the state of the textfield when the cut is made, or does it just record the action and values related to it, ie. "cut /piece of text/ from string position 344". Any advice from bods with experience in this area much appreciated! Thanks, James ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Text Editor Undo/Redo Stack
I think you should register every step by capturing what is written in the text field into an array. when u press the undo button you set the text field to show what is in the last index (and by using a counter or something, u get the index before and so on). hope this helps theretically :) cheers On 9/3/07, James Marsden <[EMAIL PROTECTED]> wrote: > > Hello all, > > I'm looking at building a very simple text editor application in Flash, > which needs an undo/redo stack of around 20. > > My question is related to capturing the events in the stack; whether the > done thing is to capture the state of the text field contents at every > step, or just to record commands that are operated on the text field. > For example, when cutting a piece of text, does the system record the > state of the textfield when the cut is made, or does it just record the > action and values related to it, ie. "cut /piece of text/ from string > position 344". > > Any advice from bods with experience in this area much appreciated! > > Thanks, > > James > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Text Editor Undo/Redo Stack
Hello all, I'm looking at building a very simple text editor application in Flash, which needs an undo/redo stack of around 20. My question is related to capturing the events in the stack; whether the done thing is to capture the state of the text field contents at every step, or just to record commands that are operated on the text field. For example, when cutting a piece of text, does the system record the state of the textfield when the cut is made, or does it just record the action and values related to it, ie. "cut /piece of text/ from string position 344". Any advice from bods with experience in this area much appreciated! Thanks, James ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com