From: <f....@wa...> - 2001-01-26 12:09:06
|
Hello, According to the DynAPI2 tutorial part 6, I created 2 frames. From the file loaded in the first frame I created a layer in it and a layer in the other frame. Now I want to access from the second frame the layer of the first frame. I don't know how to get it. here is the code. 1) in the first document: ------------------------ <Script language="Javascript" src="../dynapi/src/dynapi.js"></script> <Script language="Javascript"> DynAPI.setLibraryPath('../dynapi/src/lib/') DynAPI.include('dynapi.api.*') DynAPI.include('dynapi.gui.label') </script> <script> DynAPI.onLoad=function() { sectiontitle=new Label('sectiontitle') sectiontitle.moveTo(200,5) sectiontitle.setWidth(300) sectiontitle.setFontSize('25px; font-weight: bold;'); sectiontitle.setText('Titre de section') DynAPI.document.addChild(sectiontitle) // This is the layer I want to access afterwards from the other frame menu=new DynDocument(parent.menu) testlayer=new DynLayer('menu1',5,10,100,100,'yellow') menu.addChild(testlayer) } </script> 2) in the document of the other frame -------------------------------------- <Script language="Javascript" src="../dynapi/src/dynapi.js"></script> <Script language="Javascript"> DynAPI.setLibraryPath('../dynapi/src/lib/') DynAPI.include('dynapi.api.*') DynAPI.include('dynapi.gui.label') </script> </HEAD> <BODY> <A HREF="#" onclick="top = DynAPI.getDocument(parent.top); titlesection = top.children[titlesection]; titlesection.setText('new title');">new title</A> Could someone ligth me on the issue and tell me how to access from a frame a layer created in another frame? Actually, is there a simple way implemented in DynAPI2 to do so? Many thanks. Fred Leuba |