Hi Jack,
from what I catch on a first glance that is _pretty_much_ what I was
asking. I will try this out with my pages.
Generally, I would rather 'break out' of frames, if I had the
choice ...
Thanks a lot, Martin
On Die, 12 Dez 2000 :Jack_Speranza wrote:
>Hey... a question I think I can actually answer (having been the recipient
>of good advice from others, I'm happy to be on the flip side for a change
>:-)
>
>Anyway, what you're looking to do can easily (?) be accomplished, so long as
>you are careful about managing your code (I've made stupid mistakes like
>trying to call DynAPI methods before the class finished loading in my static
>frame, and I've run into more complex issues, too.) Anyway, having played
>around with this scheme for a while now, I've finally gotten to the point
>where things are working well in both NS and IE (for basic stuff... still
>working on more complex code, but that's more a function of my newbie
>status). Here's the basic framework of my code that has been working... my
>apologies in advance if it's not what you're looking for:
>
>IN MY STATIC FRAME --
>
>function createDyndocument(frame) {
> if ( top.userInfo.DynAPITarget) { //array I keep in my
>frameset to track various states
> targetPage = new DynDocument(frame);
> } else {
> targetPage = new DynDocument(frame);
>
> // CREATE "DYNAMIC" LAYERS THAT WILL BE COMMON ACROSS TARGET
>FRAMES
> lyrCanvas = new DynLayer('canvas',bla,bla);
> lyrMargin = new DynLayer('margin',bla,bla);
> lyrImage = new DynLayer ('image',bla,bla);
>
> lyrMargin.addChild(lyrImage);
> lyrCanvas.addChild(lyrMargin);
>
> top.userInfo.DynAPITarget = true;
> }
>}
>
>function addLayers() { // target frames call this to add multiple Dynlayers
> for (var a=0; a<arguments.length; a++){
> targetPage.addChild(arguments[a]);
> }
>}
>
>function removeLayers() {
> // REMOVE COMMON LAYERS SO THEY ARE NOT DELETED ON RECREATION OF NEW
>DYNDOCUMENT
> targetPage.removeChild(lyrCanvas);
> targetPage.deleteAllChildren(); //helps to keep browser running
>longer without crashing
>}
>
>function addDyndoc() { // called by target frames
> createDyndocument(parent.main);
> lyrImage.setBgImage(null);
> lyrImage.setHTML("");
> addLayers(lyrCanvas);
>}
>
>IN MY TARGET FRAMES --
>
>function init() {
> if ( top.userInfo.DynAPILoaded ) {
> // MAKE THIS FRAME A DYNDOC AND ADD COMMON LAYERS
> parent.menu.addDyndoc();
>
> // CREATE DYNAMIC CONTENT LAYERS
> lyrMain1 = new parent.menu.DynLayer('main1',bla,bla);
> lyrMain2 = new parent.menu.DynLayer('main2',bla,bla);
>
> // AND SO ON
> } else {
> setTimeout("init()",500);
> }
>}
>
><body onLoad="init();" onUnload="JavaScript:parent.menu.removeLayers();">
>
>Happy coding!
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help