&nbsp;Is the bitmap resource compiled into the app, or loaded at runtime? <br><br><br><br><div class="gmail_quote">On Mon, Apr 21, 2008 at 4:28 AM, Gilad Parann-Nissany &lt;<a href="mailto:gilad.parann.nissany@g.ho.st">gilad.parann.nissany@g.ho.st</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><p>Hi</p>
<p>Thank you, very helpful. Could you also provide a code example or suggestion for the following situation: </p><div class="Ih2E3d">
<p>- we are creating several views that have 1 resource (an SWF image)</p>
<p>- we wish the cached bitmap of the SWF resource to be calculated only once, and then the result to be reused in these several views</p>
<p>- goal is to save CPU time and memory consumption of the bitmap calculation</p>
</div><p>Any ideas?</p>
<p>Thanks</p>
<p>Gilad</p><font color="#888888">
</font><p></p><div class="Ih2E3d"><br><br>Gilad&nbsp;Parann-Nissany<br><br>----- Original Message -----<br></div><div class="Ih2E3d">From: &quot;P T Withington&quot; &lt;<a href="mailto:ptw@laszlosystems.com" target="_blank">ptw@laszlosystems.com</a>&gt;<br>
To: &quot;Gilad Parann-Nissany&quot; &lt;<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>&gt;<br></div><div class="Ih2E3d">Cc: &quot;Henry Minsky&quot; &lt;<a href="mailto:henry.minsky@gmail.com" target="_blank">henry.minsky@gmail.com</a>&gt;, &quot;Max Carlson&quot; &lt;<a href="mailto:max@openlaszlo.org" target="_blank">max@openlaszlo.org</a>&gt;, &quot;Ammar Tamazi&quot; &lt;<a href="mailto:Ammar.Tazami@corp.g.ho.st" target="_blank">Ammar.Tazami@corp.g.ho.st</a>&gt;, &quot;laszlo-user&quot; &lt;<a href="mailto:laszlo-user@openlaszlo.org" target="_blank">laszlo-user@openlaszlo.org</a>&gt;, &quot;Max Carlson&quot; &lt;<a href="mailto:max@laszlosystems.com" target="_blank">max@laszlosystems.com</a>&gt;, &quot;Elias Khalil&quot; &lt;<a href="mailto:Elias.Khalil@corp.g.ho.st" target="_blank">Elias.Khalil@corp.g.ho.st</a>&gt;, &quot;Lou Iorio&quot; &lt;<a href="mailto:liorio@laszlosystems.com" target="_blank">liorio@laszlosystems.com</a>&gt;<br>
Sent: Sunday, April 20, 2008 5:15:33 AM (GMT-0800) America/Los_Angeles<br>Subject: Re: [Laszlo-user] Understanding Flash memory usage when using Laszlo<br><br></div><div><div></div><div class="Wj3C7c">On 2008-04-20, at 06:13 EDT, Gilad Parann-Nissany wrote:<br>
&gt; 2. In general how would we write ActionScript code in an OL method ?<br>&gt;<br>&gt; any ideas? sugegstions? code examples are requested especially.<br><br>Our script is a superset of ActionScript. &nbsp;Whatever you want to write &nbsp;<br>
in ActionScript, you can write in Javascript, which you can write in &nbsp;<br>an OL method. &nbsp;If you want to call a built-in ActionScript function, &nbsp;<br>you simply call it. &nbsp;The only thing you would want to take care about &nbsp;<br>
is that your application will then be non-portable. &nbsp;Here is an &nbsp;<br>example of some code that calls into either the DHTML or SWF runtime, &nbsp;<br>depending on which platform it is compiled for. &nbsp;This sample comes &nbsp;<br>from the LFC kernel, it is the platform-specific implementation of a &nbsp;<br>
portable LFC API:<br><br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if ($js1) {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var why;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(window.XMLHttpRequest) {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.socket = new XMLHttpRequest();<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch(e) {<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; why = e;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else if(window.ActiveXObject) {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.socket = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch(e) {<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; why = e;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.socket = new &nbsp;<br>ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch(e) {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; why = e;<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; } else if ($as2) {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // We&#39;ll instantiate a LoadVars object when needed, for &nbsp;<br>Flash runtime<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.socket = new LoadVars();<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.returnval = new LoadVars();<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // callback from Flash LoadVars.sendAndLoad()<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.returnval.onData = this.flashOnLoadHandler;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.error(&quot;Unsupported platform&quot;);<br>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>$js1 and $as2 are commpile-time constants that are defined for the SWF &nbsp;<br>and DHTML runtimes. &nbsp;The compiler will optimize away the if branches &nbsp;<br>that are not applicable.<br><br><br></div></div></div>
</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>