Why don't you just use EventListeners for the DynLayers (onmouseup).
If you are using DynLayer's, I don't know why you are going through
all of that trouble, when you already have references to them.

myListener = new EventListener(DynAPI.document)
myListener.onmouseup=function(e) {
  myLayer.setBgColor('#ffc000');
}
myLayer.addEventListener(myListener);


-- 
// Robert Rainwater

On 1/26/2001, 5:37:04 PM EST, Abel wrote about "[Dynapi-Help] Get Div elements":

> sorry!

> Obj.click = function(id){
>   lyr = DynAPI.document.all[id].owner.lyr; //this fails in NS4!
>   lyr.setBgColor("#000000");
> }

> Actually fails in every platform, of course   :D

> this is what i was trying to do:

> Obj.click = function(id){
>   lyr = document.all[id].owner.lyr; //this fails in NS4!  SURE jeje! :)
>   lyr.setBgColor("#000000");
> }

> And what i need is a way of getting either the DynLayer reference (in which
> case i do not need the owner property) or the "HTML elm" reference.

> sorry for the mess!

> -----Original Message-----
> From: Abel Eduardo Cantu Salas [mailto:[EMAIL PROTECTED]]
> Sent: Viernes, 26 de Enero de 2001 04:26 p.m.
> To: [EMAIL PROTECTED]
> Subject: RE: [Dynapi-Help] Get Div elements


> ups, but  DynAPI.document.all[id] returns undefined  in NS :(

> the whole hystory is this:

> JSDynLayer1 is being created this way:

> objX = new Obj();

> Obj = function(){
>   ...some stuff
>   this.lyr = new DynLayer(null,x,y,w,h,bgcolor,visible);
>   DynAPI.document.addChild(lyr);
>   this.lyr.elm.owner = this;
>    //so we can know what object have created the HTML layer!
>   ...some stuff
> }

> JSDynLayer1 is later referenced in (javascript generated) HTML, this way:

> <a href="javascript:void(null);"
>    onclick="Obj.click('JSDynLayer1');">
>   click here to do something!
> </a>

> then, when we click the anchor:

> Obj.click = function(id){
>   lyr = DynAPI.document.all[id].owner.lyr; //this fails in NS4!
>   lyr.setBgColor("#000000");
> }


> alert(DynAPI.document.all[id]) shows undefined

> well, i think thats all...
> thanks!

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Robert
> Rainwater
> Sent: Viernes, 26 de Enero de 2001 03:42 p.m.
> To: DynAPI Help List
> Subject: Re: [Dynapi-Help] Get Div elements



> If you are wanting the DynLayer reference use:
> DynAPI.document.all["JSDynLayer1"]

> or

> DynAPI.getDocument("DynDocument1").all["JSDynLayer1"] if you were
> using frames.


> --
> // Robert Rainwater

> On 1/26/2001, 3:16:21 PM EST, Abel wrote about "[Dynapi-Help] Get Div
> elements":

>> Hi there!
>> im having serious problems getting references to dynamically created
>> layers... Somebody knows how to get a reference to a DynLayer object
> knowing
>> only its id (for instance "JSDynLayer1")?.

>> in IE i used this code:
>> document.all["JSDynLayer1"];    //So easy!!

>> but i just cant find a way of doing this in NS 4 +...

>> document.layers, document.layers[idx].layers, etc; are reporting layers
> with
>> ids like this: _js_layer_238, _js_layer_121, etc...

>> And having in mind that the page only has the DynLayer objects i created
> in
>> the onload event, i supose that the problem is that in NS, the DynLayers
> are
>> lossing their ids or something like that.

>> somebody knows whats going on?




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


> ----------------------
> DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/
> DynAPI Homepage: http://dynapi.sourceforge.net/



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


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


----------------------
DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/
DynAPI Homepage: http://dynapi.sourceforge.net/



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

Reply via email to