<HTML>
<HEAD>
<TITLE>Re: [Laszlo-dev] SWF9 and video / adding import statements for AS3 in LZX classes</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Thanks, Henry. Based on the draview code ( <a href="http://svn.openlaszlo.org/openlaszlo/trunk/lps/components/extensions/drawview.lzx)">http://svn.openlaszlo.org/openlaszlo/trunk/lps/components/extensions/drawview.lzx)</a> I came up with this. Doesn&#8217;t work though... <BR>
<BR>
&lt;library&gt;<BR>
&nbsp;&nbsp;&lt;switch&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;when runtime=&quot;swf9&quot;&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script when=&quot;immediate&quot;&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#passthrough (toplevel:true) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;import flash.net.NetConnection;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}#<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/when&gt;<BR>
&nbsp;&nbsp;&lt;/switch&gt;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Media stream. <BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@START_CODE<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;mediastream/&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@END_CODE<BR>
&nbsp;&nbsp;&nbsp;&nbsp;--&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;class name=&quot;mediastream&quot; extends=&quot;node&quot;&gt;<BR>
<BR>
Probably misunderstood something here..<BR>
<BR>
Best,<BR>
Raju<BR>
<BR>
<BR>
Am 01.06.2008 16:13 Uhr schrieb &quot;Henry Minsky&quot; unter &lt;henry.minsky@gmail.com&gt;:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>There is a &lt;switch&gt; statement, you can see it's use for example in <BR>
lps/components/debugger/library.lzx<BR>
<BR>
It switches on the &quot;runtime&quot; attribute<BR>
<BR>
&nbsp;&nbsp;&lt;switch&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;when runtime=&quot;dhtml&quot;&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- no debug window in DHTML, it is in its own iframe --&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/when&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;otherwise&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include href=&quot;debugger.lzx&quot;/&gt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/otherwise&gt;<BR>
&nbsp;&nbsp;&lt;/switch&gt;<BR>
<BR>
On Sun, Jun 1, 2008 at 8:38 AM, Raju Bitter &lt;openlaszlonaut@googlemail.com&gt; wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>I tried to run the video test in the test folder (FLV progressive):<BR>
<BR>
/trunk/test/video/test-video.lzx<BR>
<BR>
<BR>
The compiler showed errors since the imports were missing in the AS3 files<BR>
ERRORS:<BR>
[/Users/laszlo/flexprojekte/swf9runtime/src/$lzc$class_mediastream.as <a href="http://class_mediastream.as">&lt;http://class_mediastream.as&gt;</a> : 94]<BR>
line unknown: Error: Call to a possibly undefined method NetConnection.<BR>
[/Users/laszlo/flexprojekte/swf9runtime/src/$lzc$class_mediastream.as <a href="http://class_mediastream.as">&lt;http://class_mediastream.as&gt;</a> : 124]<BR>
line unknown: Error: Call to a possibly undefined method NetStream.<BR>
[/Users/laszlo/flexprojekte/swf9runtime/src/$lzc$class_videoview.as <a href="http://class_videoview.as">&lt;http://class_videoview.as&gt;</a> : 18]<BR>
line unknown: Error: Call to a possibly undefined method Sound.<BR>
<BR>
How do you manage addition of import statements in LZX files if the import<BR>
statements are SWF9 runtime specific?<BR>
<BR>
Thanks,<BR>
<FONT COLOR="#888888">Raju<BR>
<BR>
<BR>
</FONT></SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
</SPAN></FONT>
</BODY>
</HTML>