[Tweener] Tweener Digest, Vol 17, Issue 20
Jonathan Marston
jon at marstonstudio.com
Thu May 22 09:04:48 PDT 2008
Right, this is a text typer. I used it to make a little
"Loading . . . . ." message. I wanted the message to start with
"Loading" and then append the dots. The existing _text tween would
start by removing the old text "Loading" each character one at a time,
and then building it up one character at a time to be the final text
"Loading . . . . . ". The included shortcut appends new text to
anything that exists already.
a cool enhancement would be to automagically figure out the shortest
path between the old text and the new text, and just tween the
differences. Possibly by stepping through the characters one at a time
or using regexp to do something more clever/elegant.
Jonathan Marston
Marston Development Studio LLC
phone: (978) 758-7444
blog site: www.marstonstudio.com
email/gtalk/msn: jon at marstonstudio.com
aol/yahoo: marstonstudio
On May 21, 2008, at 10:51 PM, tweener-request at lists.caurinauebi.com
wrote:
>
> interesting, this is a text typer is that right? more useful than
> tweening
> the space between letters, from my opinion.
>
> On Wed, May 21, 2008 at 9:18 PM, Jonathan Marston <jon at marstonstudio.com
> >
> wrote:
>
>> apologies, the correct _textAppend_preProcess method should be:
>> public static function _textAppend_preProcess (p_obj:Object,
>> p_parameters:Array, p_originalValueComplete:Object,
>> p_extra:Object): Number
>> {
>> p_extra.oldText = p_obj.text;
>> p_extra.newText = p_originalValueComplete;
>> return p_extra.oldText.length + p_extra.newText.length;
>> }
>>
>>
>> Jon Marston
>>
>> Begin forwarded message:
>>
>> *From: *Jonathan Marston <jon at marstonstudio.com>
>> *Date: *May 21, 2008 2:13:13 PM EDT
>> *To: *tweener at lists.caurinauebi.com
>> *Subject: **text tween to append text*
>>
>> Hello, I've got a shortcut submission for the TextShortcuts special
>> properties. I'ts a shortcut to append text as opposed to replacing it
>> completely. Here is the extra code for TextShortcuts.as:
>>
>>
>>
>> add to init
>>
>> Tweener.registerSpecialProperty("_textAppend", _textAppend_get,
>> _textAppend_set, null, _textAppend_preProcess);
>>
>> extra methods:
>>
>> public static function _textAppend_get (p_obj:Object,
>> p_parameters:Array,
>> p_extra:Object = null):Number {
>> return p_obj.text.length - p_extra.oldText.length;
>> }
>>
>> public static function _textAppend_set (p_obj:Object, p_value:Number,
>> p_parameters:Array, p_extra:Object = null): void {
>> p_obj.text = p_extra.oldText + p_extra.newText.substr(0,
>> Math.round(p_value));
>> }
>>
>> public static function _textAppend_preProcess (p_obj:Object,
>> p_parameters:Array, p_originalValueComplete:Object,
>> p_extra:Object): Number
>> {
>> p_extra.oldText = p_obj.text;
>> p_extra.newText = p_originalValueComplete;
>> return p_extra.oldText.length;
>> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20080522/eb272a7c/attachment-0001.htm>
More information about the Tweener
mailing list