<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I started with a simple multi-prop tween, then created a separate parser class with 2 public static methods called BlockParserMG:</div><div><br class="webkit-block-placeholder"></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #7f0055">public</span> <span style="color: #7f0055">static</span> <span style="color: #7f0055">function</span> go(action:<span style="color: #373737">Object</span>): BlockTweenMG {</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><span class="Apple-tab-span" style="white-space:pre">        </span>// parse, start & return a tween<br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #7f0055">var</span> tween:BlockTweenMG = parseAction(action);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>tween.start();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #7f0055">return</span> tween;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #7f0055">public</span> <span style="color: #7f0055">static</span> <span style="color: #7f0055">function</span> sequence(...actions): SequenceCA {</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><span class="Apple-tab-span" style="white-space:pre">        </span>// parse, start, and return a sequence<br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #7f0055">private</span> <span style="color: #7f0055">static</span> <span style="color: #7f0055">function</span> parseAction(action : <span style="color: #373737">Object</span>) : BlockTweenMG {</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><span class="Apple-tab-span" style="white-space:pre">        </span>// used by both. parse one action object and return a tween.<br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">}</div><div><font class="Apple-style-span" face="Monaco" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br class="webkit-block-placeholder"></span></font></div>
</div><div><br></div><div>I built SequenceStepCA's during the sequence() loop because that way i could support custom-advance. I checked for "is Array" for each action passed in and would parse each sub-object within it to support parallel. That's just a few lines of code to do both of those things then sequence.addStep(step);.</div><div><br class="webkit-block-placeholder"></div><div>The parser is literally one if() statement for the custom-advance and one if() to see if the property being parsed is a tween property (tween.hasOwnProperty(prop)) or should else just be added as an animation property. </div><div><br class="webkit-block-placeholder"></div><div>That's it... simple! </div><div><br class="webkit-block-placeholder"></div><div>And ... works!</div><div><br class="webkit-block-placeholder"></div><div>-m</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><br><div><div>On Mar 5, 2008, at 7:42 PM, Brett Coffin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi everyone, <br><br>Moses, i love the concept of Go i thing it will "go" all the way !!!<br><br>I understand the concept of the parser in regards to xml but i don't have a clear idea of what would be a parser for go, could you extend on it... the way i am think of it is: <br> <br>you created a syntax like the fuse for example and the parser is receiving it and then would "dispatch" the task to tween particular parameters to the respective tweening class... is that correct ? Could you make your parser available ? <br> <br><br><br><br><br><div class="gmail_quote">On Thu, Mar 6, 2008 at 10:18 AM, Moses Gunesch <<a href="mailto:moses@goasap.org">moses@goasap.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> That's true and so far it hasn't really come in handy at all. I had<br> put it in there so it would be easy to pass target or prop info but<br> it's also easy to just add those params since it's all open code. You<br> are right that I should probably remove that since it simply<br> encourages bad practice, I just didn't want it to be terribly<br> restrictive either... will revisit.<br> <font color="#888888"><br> - m<br> </font><div class="Ih2E3d"><br> <br> On Mar 5, 2008, at 12:03 PM, Jon Williams wrote:<br> <br> > if the 'extra' prop is such a rotten approach, then i suggest<br> > removing it from GoEvent (unless you can tell me how that's<br> > different) ; ) Afterall, you should just subclass GoEvent...<br> > :j<br> <br></div></blockquote></div></blockquote></div><br></body></html>