Hi There,
I would be very grateful if anyone out there could lend me a hand with the 
following problem.
In a page I am writing I have created 2 DynAPI objects called market and 
price. The market layer (when its created) creates and adds two child layers 
of type price.
Basically, the market layer consists of some HTML, as do the price layers. 
The problem is, that if I need to rewrite the HTML inside the the outer 
layer (market) then the two price layers vanish from view. I have tried 
endlessly messing about with the Z Indexes, but with no sucess. The layers 
are still there somewhere as I can reference properties within the price 
objects. I really don't know what is going on. All I want to be able to do 
is to rewrite the HTML content of an outer layer without the inner child 
layer vanishing ! Am I doing something incorrectly ? Any help appreciated.

I have included a set of very crude samples to show my point.
Best Regards
Paul Anderson.
PS. I can be reached on MSN Messenger between 9am and 6pm GMT

This should go in the examples directory
----------------------------------------

<html>
<head>
<title>DynAPI Distribution: Create Example</title>
<script language="Javascript" src="../src/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('../src/lib/');
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.gui.testlayer1.js');
DynAPI.include('dynapi.gui.testlayer2.js');
</script>
<script language="Javascript">

DynAPI.onLoad = function() {

        layer1 = new TestLayer1();
        layer1.moveTo(100,100);
        DynAPI.document.addChild(layer1)
}

</script>
</head>

<body bgcolor="#ffffff">
<a href="#" onClick="layer1.setHTML('<html><body><p align=center 
valign=top>new outer text</p></body></html>');">Change Outer Text</a>
<a href="#" onClick="layer1.ChildLayer.setHTML('<html><body><p align=center 
valign=top>new inner text</p></body></html>');">Change Inner Text</a>
</body>
</html>

These should go in the gui directory
------------------------------------

function TestLayer1() {

        this.DynLayer = DynLayer;
        this.DynLayer();

        this.ChildLayer = new TestLayer2();
        this.ChildLayer.moveTo(100,50);
        this.addChild(this.ChildLayer);

        this.setBgColor('#eeeeee');
        this.setSize(300,200);
        this.setContent();
};
TestLayer1.prototype = new DynLayer;
TestLayer1.prototype.setContent = function() {
        var HTML = '<html><body><p align=center valign=top>test layer 
1</p></body></html>';
        this.setHTML(HTML);
};


function TestLayer2() {

        this.DynLayer = DynLayer;
        this.DynLayer();

        this.setBgColor('#cccccc');
        this.setSize(100,100);
        this.setContent();
};
TestLayer2.prototype = new DynLayer;
TestLayer2.prototype.setContent = function() {
        var HTML = '<html><body><p align=center valign=top>test layer 
2</p></body></html>';
        this.setHTML(HTML);
};










_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to