I just realized that my responses weren't sent to the list, just the individual 
responders...

Sorry...

Jonathan

________________________________
From: Jonathan Shinn
Sent: Tuesday, December 22, 2009 4:17 PM
To: 'Henry Minsky'
Subject: RE: [Laszlo-user] Repeated loading and unloading of a library

I guess I must have misunderstood the intent of the section of the Dev guide 
that talks about this then...

Henry, could you possibly shed some light on the discussion in this 
(http://www.openlaszlo.org/lps4.5/docs/developers/program-structure.html#d0e31849)
 section of the Dev guide? The process described here is what I was trying to 
follow...

Thank you,
Jonathan


________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Henry 
Minsky
Sent: Tuesday, December 22, 2009 4:10 PM
To: Jonathan Shinn
Cc: [email protected]
Subject: Re: [Laszlo-user] Repeated loading and unloading of a library

Unfortunately, we never designed any mechanism for un-loading a library.


If it's a question of destroying all the classes that were created
when the library loaded,
you'd have to make sure all instances that use those classes are also
deleted. It might be that we could make the compiler or runtime help out keeping
track of these instances somehow.





On Tue, Dec 22, 2009 at 6:47 PM, Jonathan Shinn 
<[email protected]<mailto:[email protected]>> wrote:
Hello everyone,

I'm struggling with the code below. When compiled to swf8, the library will 
load and unload repeatedly, but will provide the following error message:
"ERROR: Redefining $lzc$class_helloworld from <helloworld> to <helloworld> ".

When compiled to swf9 or swf10, the library will load and unload the first 
time, but fails to load on later attempts. No error message is provided in 
these runtimes.

I'm finding the information on deleting imported libraries in Chapter 15 of the 
developer's guide to be a bit hard to follow and no actual coded example is 
given, so I imagine that I'm simply missing some step. Can someone tell me what 
I'm doing wrong here?

Thanks,
Jonathan

***********************************************************
<canvas width="100%" height="600" proxied="false">
    <attribute name="lib"/>
    <button text="Load helloworld library" onclick="helloworldimport.load()" />
    <button x="150" text="Unload helloworld library" 
onclick="canvas.lib.destroy();helloworldimport.unload()"/>

     <import name="helloworldimport" href="helloworldimport.lzx" 
stage="deferred" />

     <handler name="onload" reference="helloworldimport">
          Debug.write("helloworld imported!");
          canvas.lib = new lz.helloworld(canvas, {'x': 40, 'y': 50});
     </handler>

</canvas>
*******************************************
<library>

 <class name="helloworld" extends="view" width="150" height="150" 
bgcolor="#ccaaee">

      <text fontsize="40" align="center" valign="middle" text="Hello" />

 </class>

</library>
*******************************************************




--
Henry Minsky
Software Architect
[email protected]<mailto:[email protected]>


Reply via email to