--- Doug Melvin <[EMAIL PROTECTED]> wrote:
> actually.. I wan to respond to the create event
> period.
> 
> My scrollbar allignes all of it's object (buttons)
> using a function.
> I want to be able to call that function once the
> scrollbar has been
> rendered.
> 
> But when I add a create listener, it does not get
> fired.
> When I add debugging code directly into the api, the
> oncreate is being
> fired..
> but only when I create a new DynLayer().
> Once I have created the layer, I would like to add
> the event listsner and
> then respond to the event.
> If the event has fired before I am allowed to add
> the event listsner, how
> can I respond to the event:
> 
> 
> var myLayer = new DynLayer(); //create event is
> fired
> 
> myLayer.addEventListener({oncreate : function(e){do
> stuff}}) // too late..
> the create event has fired.

Well, the "oncreate" event is no longer fired from the
addEventListener() function. You'll have to use the
onCreate() function:

layer1=new DynLayer(null,100,180,100,100,"gold")
layer2=new DynLayer(null,10,10,80,80,"red")
layer3=new DynLayer(null,10,10,60,60,"yellow")

layer1.onPreCreate(
        function() {alert("In onprecreate");}
);
layer1.onCreate(
        function() {alert("In oncreate");}
);

layer1.addChild(layer2);
layer2.addChild(layer3);
dynapi.document.addChild(layer1);

This change greatly improve the creation of layers
that used the oncreate event.

--
Raymond Irving

> ----- Original Message -----
> From: "Raymond Irving" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 21, 2003 1:25 PM
> Subject: Re: [Dynapi-Dev] oncreate
> 
> 
> >
> > --- Doug Melvin <[EMAIL PROTECTED]>
> wrote:
> > > hmm..
> > > something funny here: correct me if I am wrong
> > > the create event now get's fired before you have
> the
> > > chance to event add an event listener to the
> layer?
> > > This is not good.
> >
> > Maybe this can help:
> >
> > "The 'create' event that DynLayer invokes works
> > notably different now. Previously children
> DynLayers
> > called the create event before their parents did.
> At
> > the time we made this decision it made sense, but
> > since we're moving ahead now I've put this back to
> > what it should be. This does impact widget
> creation in
> > some manners. In cases where a child layer is
> resized
> > to it's content size during the create sequence
> this
> > information is no longer available to the parent
> > DynLayer (where previously it was). If your parent
> > DynLayer/widget needs to know the size of its
> children
> > a recommended workaround is to add a 'precreate'
> event
> > listener which attaches a 'create' event to the
> last
> > child for use in the widget. "
> >
> > If not, are you using the onCreate/onPreCreate()
> > function to create callback events?
> >
> > --
> > Raymond Irving
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> > http://platinum.yahoo.com
> >
> >
> >
>
-------------------------------------------------------
> > This SF.net email is sponsored by:Crypto Challenge
> is now open!
> > Get cracking and register here for some mind
> boggling fun and
> > the chance of winning an Apple iPod:
> >
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> >
>
http://www.mail-archive.com/[EMAIL PROTECTED]/
> >
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to