Forgot to make clear, the &lt;when property=&quot;foo&quot;&gt; is implicitly testing a boolean value,<br>which many of the compile time constants are. It is just &#39;runtime&#39; that is a string value, and can be compared via the &lt;when property=&quot;foo&quot; value=&quot;bar&quot;&gt; form. <br>

<br><div class="gmail_quote">On Wed, Aug 19, 2009 at 6:22 PM, Henry Minsky <span dir="ltr">&lt;<a href="mailto:henry.minsky@gmail.com">henry.minsky@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

There was an older syntax which was specific to the &#39;runtime&#39; property, and the new syntax<br>can check any compile-time constant property.<br><br>So you can actually say<br><br>&lt;when property=&quot;runtime&quot; value=&quot;swf9&quot;&gt;<br>


<br>Which I think would be the best way <br><br>e.g.,<br><br>&lt;switch&gt;<br>  &lt;when property=&quot;runtime&quot; value=&quot;swf9&quot;&gt;<br>    &lt;text&gt;runtime is swf9&lt;/text&gt;<br>  &lt;/when&gt;<br>  &lt;when property=&quot;runtime&quot; value=&quot;swf10&quot;&gt;<br>


    &lt;text&gt;runtime is swf10&lt;/text&gt;<br>  &lt;/when&gt;<br>  &lt;otherwise&gt;<br>    &lt;text&gt;some other  runtime&lt;/text&gt;<br>  &lt;/otherwise&gt;<br>&lt;/switch&gt;<br><br>&quot;as3&quot; is more of a language selector than a specific runtime, just as &quot;as2&quot; and &quot;js1&quot; would be. <br>


<br>The compiler sets these constants, which can be checked at compile time<br><br>  boolean setRuntime(String runtime) {<br>    if (! (&quot;dhtml&quot;.equals(runtime) || &quot;j2me&quot;.equals(runtime) || &quot;svg&quot;.equals(runtime) ||<br>


           &quot;swf9&quot;.equals(runtime) || &quot;swf10&quot;.equals(runtime) ||<br>           &quot;swf7&quot;.equals(runtime) || &quot;swf8&quot;.equals(runtime))) {<br>      usage(&quot;runtime must be one of swf7, swf8, swf9, swf10, dhtml, j2me, svg&quot;);<br>


      return false;<br>    }<br>    compileTimeConstants.put(&quot;$runtime&quot;, runtime);<br><br>    // Kludges until compile-time constants can be expressions<br>    compileTimeConstants.put(&quot;$swf7&quot;, Boolean.valueOf(&quot;swf7&quot;.equals(runtime)));<br>


    compileTimeConstants.put(&quot;$swf8&quot;, Boolean.valueOf(&quot;swf8&quot;.equals(runtime)));<br>    compileTimeConstants.put(<br>      &quot;$as2&quot;,<br>      Boolean.valueOf(&quot;swf7&quot;.equals(runtime) || &quot;swf8&quot;.equals(runtime) ));<br>


    compileTimeConstants.put(&quot;$swf9&quot;, Boolean.valueOf(&quot;swf9&quot;.equals(runtime)));<br>    compileTimeConstants.put(&quot;$swf10&quot;, Boolean.valueOf(&quot;swf10&quot;.equals(runtime)));<br>    compileTimeConstants.put(&quot;$as3&quot;, Boolean.valueOf(&quot;swf9&quot;.equals(runtime) || &quot;swf10&quot;.equals(runtime)));<br>


    compileTimeConstants.put(&quot;$dhtml&quot;, Boolean.valueOf(&quot;dhtml&quot;.equals(runtime)));<br>    compileTimeConstants.put(&quot;$j2me&quot;, Boolean.valueOf(&quot;j2me&quot;.equals(runtime)));<br>    compileTimeConstants.put(&quot;$svg&quot;, Boolean.valueOf(&quot;svg&quot;.equals(runtime)));<br>


    compileTimeConstants.put(<br>      &quot;$js1&quot;,<br>      Boolean.valueOf(&quot;dhtml&quot;.equals(runtime) || &quot;j2me&quot;.equals(runtime) || &quot;svg&quot;.equals(runtime)));<br><br>    compilerOptions.put(Compiler.RUNTIME, runtime);<br>


    return true;<div><div></div><div class="h5"><br>  }<br><br><br><div class="gmail_quote">On Wed, Aug 19, 2009 at 4:57 PM, Raju Bitter <span dir="ltr">&lt;<a href="mailto:rajubitter@me.com" target="_blank">rajubitter@me.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Henry,<br>
<br>
why is it that you can say:<br>
<br>
&lt;switch&gt;<br>
  &lt;when runtime=&quot;dhtml&quot;&gt;<br>
<br>
for testing for DHTML runtime, but for SWF9 you have to say<br>
<br>
&lt;switch&gt;<br>
  &lt;when property=&quot;as3&quot;&gt;<br>
<br>
Is there a good reason for not supporting:<br>
<br>
&lt;when runtime=&quot;swf9&quot;&gt;<br>
<br>
What if we have swf9 and swf10 specific code?<br><font color="#888888">
<br>
- Raju<br>
</font></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com" target="_blank">hminsky@laszlosystems.com</a><br>

<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br><br>