Since I didn't see my mail appearing in the list I'll post it again.
Sorry for multiple copies...
M.
--- Begin Message ---
Hello all,
I'm trying to dynamically load two different pieces of application that
reside in very different directories but whose filename is the same
(something like ../../dir1/dir2/standalone.lzx and
../../dir3/dir4/standalone.lzx).
I do it in OL 4.2 (but 4.1 seems to behave the same way) by using the
import tag (with stage="defer").
The two "import.load()" occur very close (in time) to each other and in
particular might also overlap.
So, it seems that OL gets confused actually it doesn't find one of the
classes contained in the files to be instantiated. But if I change the
name of one of the two files then everything seems to work.
Am I right in the statement contained in the subject?
Thank you all,
M.
The two imports for your documentation:
<import name="mainmenuimport"
href="../../../mainmenu/views/mainmenu/standalone.lzx" stage="defer">
<attribute name="area" type="string"/>
<attribute name="classname" type="string"/>
<handler name="onload">
//canvas.instantiate(this.classname, this.area)
var constructor = eval(this.classname)
if(constructor == null){
Debug.warn("Cannot instantiate undefined class "+classname);
Debug.warn("Trying with 'lz.' ...");
constructor = eval('lz.'+this.classname)
if(constructor == null){
Debug.warn("Cannot instantiate undefined class lz."
+ this.classname);
return;
}
}
new constructor(eval(this.area),{})
</handler>
</import>
<import name="testimport"
href="../../../guicontroller/views/test/standalone.lzx" stage="defer">
<attribute name="area"/>
<attribute name="classname" type="string"/>
<handler name="onload">
//canvas.instantiate(this.classname, this.area)
var constructor = eval(this.classname)
if(constructor == null){
Debug.warn("Cannot instantiate undefined class "+classname);
Debug.warn("Trying with 'lz.' ...");
constructor = eval('lz.'+this.classname)
if(constructor == null){
Debug.warn("Cannot instantiate undefined class lz."
+ this.classname);
return;
}
}
new constructor(eval(this.area),{})
</handler>
</import>
--- End Message ---