HELLO
I created a demo to do "addChild" and "deleteChild" which is the way
I've solved this problem.
It's appended at the END of this Message.
Todd.


-----Original Message-----
From: Mendjeli mahidine [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 10:01 AM
To: [EMAIL PROTECTED]
Subject: [Dynapi-Help] addChild, removeChild bug?


Problem when adding,removing and readding a layer!!!
I am using the DynAPI.document.addChild(mylayer) instruction to add my
layer: ok
the i use DynAPI.document.removeChild()mylayer) to remove it from the
doc:
ok
But when trying to add it a new time nothing happen
DynAPI.document.addChild(mylayer) : BAD
can't see my layer and my layer objetc exist??? (i also use
removeFromParent
but it 's the sam pbme)

Does anyone can give me the solution??


MM

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 04, 2001 9:02 PM
Subject: Dynapi-Help digest, Vol 1 #768 - 7 msgs


> Send Dynapi-Help mailing list submissions to
> [EMAIL PROTECTED]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/dynapi-help
> or, via email, send a message with subject or body 'help' to
> [EMAIL PROTECTED]
>
> You can reach the person managing the list at
> [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Dynapi-Help digest..."
>
>


------------------------------------------------------------------------
----
----


> Today's Topics:
>
>    1. Bug with IE5.5 winNT: "is is not defined" (Quang Nguyen)
>    2. Re: Bug with IE5.5 winNT: "is is not defined" (Doug Melvin)
>    3. FW: [Dynapi-Help] Bug with IE5.5 winNT: "is is not defined"
(Todd
Marshall)
>    4. Re: Bug with IE5.5 winNT: "is is not defined" (Michael
Pemberton)
>    5. Re: Changing a layers parent. (R & S Buckland)
>    6. addChild and removeChild (Mendjeli mahidine)
>    7. character limit? (Ochen K.)
>


------------------------------------------------------------------------
----
----


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


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



===========================================================


<html>
<head>
<title>Add/Delete DynLayer Demo</title>
<script language="Javascript" src="../src/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('../src/lib/');
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.event.*');
DynAPI.include('dynapi.gui.dynimage.js');
DynAPI.include("dynapi.gui.label.js")
DynAPI.include("dynapi.gui.list.js")
DynAPI.include("dynapi.gui.button.js")
</script>
<script language="Javascript">
DynAPI.onLoad = function() {


        AListener = new EventListener(DynAPI.document);
        AListener.onmousedown = function(e) {
                e.cancelBrowserEvent();
        };
        AListener.onmousemove = function(e) {
                e.cancelBrowserEvent();
        };
        AListener.onmouseup = function(e) {
                e.cancelBrowserEvent();
                setTimeout("delA()",200);

        };

   layerA = new DynLayer(null,50,50,100,100,'#4080C0');
   layerA.addEventListener(AListener);
   DynAPI.document.addChild(layerA)

        BListener = new EventListener(DynAPI.document);
        BListener.onmousedown = function(e) {
                e.cancelBrowserEvent();
        };
        BListener.onmousemove = function(e) {
                e.cancelBrowserEvent();
        };
        BListener.onmouseup = function(e) {
                e.cancelBrowserEvent();
                setTimeout("delB()",200);
        };

   }

delA = function() {

   // RECREATING LAYER
   layerB = new DynLayer(null,150,50,100,100,'#C08040');
   layerB.addEventListener(BListener);
   // END OF RECREATING LAYER CODE

      DynAPI.document.addChild(layerB)
      DynAPI.document.deleteChild(layerA);

}

delB = function() {

   // RECREATING LAYER
   layerA = new DynLayer(null,50,50,100,100,'#4080C0');
   layerA.addEventListener(AListener);
   // END OF RECREATING LAYER CODE

   DynAPI.document.addChild(layerA)
   DynAPI.document.deleteChild(layerB);

}

</script>

</head>

<body bgcolor="#004000" TEXT="#FFFF00" LINK="#40FF00" VLINK="#80FFFF"
ALINK="#FF00FF">
Add/Delete DynLayer Demo
</body>
</html>

==============================================

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

Reply via email to