Hi Fridiric,
I am using a very similar setup. I create a DynDocument
for each frame. 'frameleft' keeps the menu, 'main' the content.
In 'frameleft' I have:
DynAPI.onLoad=function() {
menuPage = new DynDocument(parent.frameleft);
goHome = new homeButton(); // homeButton is a simple button
goHome.moveTo(10,30),
menuPage.addChild(goHome);
// ....
}
In frame 'main' I have:
DynAPI.onLoad=function() {
mainpage = new DynDocument(parent.main);
mainpage.setBgColor('white');
splash = new DynLayer(null,10,10,200,30,'#ffffff');
splash.setHTML('<p><font color="#000000" face="sans-serif"><Lade Dateien
...</font></p>');
mainpage.addChild(splash);
preLoad; // preLoad loads images, adds widgets etc.
}
I change contents in main from frameleft like this:
parent.main.textbox.setHTML(was);
// textbox is a widget of the mainpage
parent.main.menu3.invokeEvent('schliddern')
// menu3 is a sliding menu of the textbox in main
// which has a eventListener for 'schliddern'
you can look at this at 'http://www.planiglobe.com/prototyp/'
Martin
On Fre, 26 Jan 2001 you wrote:
>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
>
>
>_______________________________________________
>Dynapi-Dev mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/dynapi-dev
--
--- Martin Weinelt ------------- kk+w digital cartography ---
--- [EMAIL PROTECTED] --------------- Kiel, Germany ---
--- http://www.planiglobe.com ------ Tel: +49.431.5791165 ---
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help