I added support for dragging in other frames. Simply pass the dyndocument where
the layer is dragged as first parameter of the enableDragEvents method.
d = new dyndocument(parent.blah)
a = new DynLayer()
d.addChild(a)
DragEvent.enableDragEvents(d,a)
Cya
...
Which brings up again the need for proper API documentation.
Richard Bennett wrote:
> hi,
> I haven't used frames with DynAPI myself yet, so my solution might not be
> 100% orthodox.
> It seems you have to assign a drag event to the frame in question before you
> can target the layer,
> but then you get errors when you click on the target frame, if you disable
> drag events for the
> target frame again, the reference seems to remain, without errors:
>
> myLayer=new DynLayer(null,100,100,100,100,'#c0c0c0')
> tdoc = new DynDocument(parent.treeFrame);
> tdoc.addChild(myLayer);
> DragEvent.setDragBoundary(myLayer, 0, 300, 300, 0)
> DragEvent.enableDragEvents(myLayer)
> DragEvent.enableDragEvents(tdoc)
> DragEvent.disableDragEvents(tdoc)
>
> I put up the working example here:
> http://www.resass.f2s.com/dynapi/php/index.php
> look under Peter_Dvorsky_Examples in the tree.
>
> If someone would care to post the proper solution I'll update the files.
>
> I included DynAPIDiagnose in your file, it's my new diagnostic tool, to find
> which functions/properties etc
> are available for an object on the page. it's still very much alpha version
> with lot's of known bugs, and a temporary
> interface.
> You simply type the name of some object on the page, for instance tdoc, or
> myLayer, into the text box, and click "Get all".
> This will initially give you all(?) the DynAPI properties/functions etc
> available for this object, if you then click on, for instance,
> "+ css has 126 properties" (for myLayer) it will show you browser native
> properties available to myLayer.css.
>
> Cheers,
> Richard :o
> [EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "Peter Dvorsky" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 19, 2000 2:01 AM
> Subject: [Dynapi-Help] dragging in frames bug?
>
> >
> > I can drag a layer but not when it's in a frame. I don't know if I've
> > uncovered a DynAPI bug or if I'm doing something wrong.
> > I tried simple dragging of layers as in part 3 of the online tutorial. The
> > tutorial works as described.
> > However, dragging appears not to work if the draggable layer is in a
> frame.
> >
> > Here's my code. The layer shows up perfectly well but it cannot be
> dragged.
> > Nothing happens.
> >
> > My frameset doc:
> >
> > <HTML>
> > <HEAD>
> > <TITLE>My frameset</TITLE>
> >
> > <SCRIPT LANGUAGE="JavaScript">
> >
> > function blank()
> > {
> > return( "<HTML></HTML>" );
> > }
> >
> > </SCRIPT>
> > </HEAD>
> >
> > <FRAMESET ROWS="*,5" FRAMEBORDER=1>
> > <FRAME SRC=javascript:parent.blank() NAME="treeFrame">
> > <FRAME SRC="dragdoc.htm" NAME="bufferFrame">
> > </FRAMESET>
> >
> > </HTML>
> >
> > And here's dragdoc.htm, which only has a small change from the tutorial to
> > load the draggable layer into treeFrame:
> >
> > <html>
> > <head><title>DynAPI2 tutor - dragging</title>
> > <script language="JavaScript" src="../src/dynapi.js"></script>
> > <Script language="Javascript">
> >
> > DynAPI.setLibraryPath('../src/lib/');
> > DynAPI.include('dynapi.api.*')
> >
> > DynAPI.onLoad=function() {
> > myLayer=new DynLayer(null,100,100,100,100,'#c0c0c0')
> >
> > DragEvent.setDragBoundary(myLayer, 0, 300, 300, 0)
> > DragEvent.enableDragEvents(myLayer)
> >
> > tdoc = new DynDocument(parent.treeFrame);
> > tdoc.addChild(myLayer);
> > }
> >
> > </script>
> > </head>
> > <body>
> > </body>
> > </html>
> >
> >
> > Is this a low-level bug or am I missing something?
> >
> > Thanks very much for any assistance,
> >
> > Peter Dvorsky
> >
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/mailman/listinfo/dynapi-help
> > ____________________________________________________________
> > Get your free domain name and domain-based e-mail from
> > Namezero.com. New! Namezero Plus domains now available.
> > Find out more at: http://www.namezero.com
> >
> >
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/dynapi-help
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/dynapi-help