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 <<a href="mailto:gilad.parann.nissany@g.ho.st">gilad.parann.nissany@g.ho.st</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;"><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 Parann-Nissany<br><br>----- Original Message -----<br></div><div class="Ih2E3d">From: "P T Withington" <<a href="mailto:ptw@laszlosystems.com" target="_blank">ptw@laszlosystems.com</a>><br>
To: "Gilad Parann-Nissany" <<a href="mailto:gilad.parann.nissany@g.ho.st" target="_blank">gilad.parann.nissany@g.ho.st</a>><br></div><div class="Ih2E3d">Cc: "Henry Minsky" <<a href="mailto:henry.minsky@gmail.com" target="_blank">henry.minsky@gmail.com</a>>, "Max Carlson" <<a href="mailto:max@openlaszlo.org" target="_blank">max@openlaszlo.org</a>>, "Ammar Tamazi" <<a href="mailto:Ammar.Tazami@corp.g.ho.st" target="_blank">Ammar.Tazami@corp.g.ho.st</a>>, "laszlo-user" <<a href="mailto:laszlo-user@openlaszlo.org" target="_blank">laszlo-user@openlaszlo.org</a>>, "Max Carlson" <<a href="mailto:max@laszlosystems.com" target="_blank">max@laszlosystems.com</a>>, "Elias Khalil" <<a href="mailto:Elias.Khalil@corp.g.ho.st" target="_blank">Elias.Khalil@corp.g.ho.st</a>>, "Lou Iorio" <<a href="mailto:liorio@laszlosystems.com" target="_blank">liorio@laszlosystems.com</a>><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>
> 2. In general how would we write ActionScript code in an OL method ?<br>><br>> any ideas? sugegstions? code examples are requested especially.<br><br>Our script is a superset of ActionScript. Whatever you want to write <br>
in ActionScript, you can write in Javascript, which you can write in <br>an OL method. If you want to call a built-in ActionScript function, <br>you simply call it. The only thing you would want to take care about <br>
is that your application will then be non-portable. Here is an <br>example of some code that calls into either the DHTML or SWF runtime, <br>depending on which platform it is compiled for. This sample comes <br>from the LFC kernel, it is the platform-specific implementation of a <br>
portable LFC API:<br><br> if ($js1) {<br> var why;<br> if(window.XMLHttpRequest) {<br> try {<br> this.socket = new XMLHttpRequest();<br> } catch(e) {<br>
why = e;<br> }<br> } else if(window.ActiveXObject) {<br> try {<br> this.socket = new ActiveXObject("Msxml2.XMLHTTP");<br> } catch(e) {<br>
why = e;<br> try {<br> this.socket = new <br>ActiveXObject("Microsoft.XMLHTTP");<br> } catch(e) {<br> why = e;<br>
}<br> }<br> }<br> } else if ($as2) {<br> // We'll instantiate a LoadVars object when needed, for <br>Flash runtime<br> this.socket = new LoadVars();<br>
this.returnval = new LoadVars();<br> // callback from Flash LoadVars.sendAndLoad()<br> this.returnval.onData = this.flashOnLoadHandler;<br> } else {<br> Debug.error("Unsupported platform");<br>
}<br><br>$js1 and $as2 are commpile-time constants that are defined for the SWF <br>and DHTML runtimes. The compiler will optimize away the if branches <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>