From: Eytan H. <ey...@tr...> - 2000-12-10 10:38:08
|
Hi guys, I'm trying to include the dyn api with the following code <script src=3D"../../dynapi.js"></script> <script> DynAPI.setLibraryPath('../../lib2.0/') DynAPI.include('core.api.*'); DynAPI.include('core.ext.*'); </script> But before the page finishes loading a get an error "group undefined" Does anyone know whats going on? Eytan Heidingsfeld |
From: Raymond S. <dst...@or...> - 2000-12-10 16:45:05
|
I've been actively coding JavaScript about 3 months now. And realizing = that: 1) That I know little.=20 2) Sweat is the greatest teacher of all. I have generally kept my questions to myself, allowing them to fuel = macabre nights of sleepless frustration till I figured it out myself. = The value has been immeasurable. But... I appear to struggle the most with object method inheritance and = recently find myself staring at (Doesn't allow this method) alerts. = I've been attempting to assign "dragablity" within a eventhandler of a = widget and also disabling/enabling other event handlers (that have = nothing to do with dragging, I just want to dynamically turn them off = and on.. I worked with Rainwater's post a bit and got to see more = (Doesn't allow this method) alerts. A short tutorial form an old-timer would be appreciated.. DS |
From: Pascal B. <pa...@dy...> - 2000-12-10 17:20:36
|
You don't really turn eventlisteners on and off, you add or remove them. Adding listeners is obviously known to you.. and to turn them off you simply use the myLayer.removeEventListener(listener). That would turn it off. This ofcourse means you have to have a handle (or variable) to the eventListener. So you can reattach it later. I'm not sure what you mean with "assigning dragability". Maybe if you show us some code we can help you further (and it becomes clearer to us ;-) Pascal Bestebroer pa...@dy... http://www.dynamic-core.net -----Oorspronkelijk bericht----- Van: dyn...@li... [mailto:dyn...@li...]Namens Raymond Smith Verzonden: zondag 10 december 2000 17:45 Aan: dyn...@li... Onderwerp: [Dynapi-Dev] general inheritence question I've been actively coding JavaScript about 3 months now. And realizing that: 1) That I know little. 2) Sweat is the greatest teacher of all. I have generally kept my questions to myself, allowing them to fuel macabre nights of sleepless frustration till I figured it out myself. The value has been immeasurable. But... I appear to struggle the most with object method inheritance and recently find myself staring at (Doesn't allow this method) alerts. I've been attempting to assign "dragablity" within a eventhandler of a widget and also disabling/enabling other event handlers (that have nothing to do with dragging, I just want to dynamically turn them off and on.. I worked with Rainwater's post a bit and got to see more (Doesn't allow this method) alerts. A short tutorial form an old-timer would be appreciated.. DS |
From: Raymond S. <dst...@or...> - 2000-12-10 17:35:18
|
Ok, here are the 'troublesome' code artifacts. CASE 1 this.popevent=3Dnew EventListener(this) this.popevent.ondblclick=3Dfunction(e) { var lyr=3De.getSource() o=3De.getTarget() if (o.isVert&&o.y!=3D130) {o.moveTo(o.x+50,o.y-20)} if (!o.isVert&&o.y!=3D130) {o.moveTo(o.x+60,o.y+40)} if (o.y!=3D130) { o.setZIndex(o.z+12) o.winRoEnabled=3Dfalse DragEvent.enabledDragEvents(o) } if (o.y=3D=3D130) { alert('This position can not be popped.') } } I've seen 'DragEvent.enabledDragEvents(o)' used in an onCreate. This = one causes a method alert. Works fine with that line // out. CASE 2 SkinWinRotator.prototype.enableRotate=3Dfunction() { var thing =3D arguments[0]; if(thing.constructor!=3DDynDocument) = thing.getComponent().addEventListener(SkinWinRotator.rotevents.rotatevent= ) for (var i=3D1;i<arguments.length;i++) { var lyr=3Darguments[i].getComponent() = lyr.rotevents.addEventListener(SkinWinRotator.rotevents.rotatevent) } } SkinWinRotator.prototype.disableRotate=3Dfunction() { for (var i=3D0;i<arguments.length;i++) { var lyr=3Darguments[i].getComponent() = lyr.rotevents.removeEventListener(SkinWinRotator.rotevents.rotatevent) } } I've created extensions (simular to DragEvent) that do various things = for window/widget management. This was an attempt at building simular = on/off behavior inside of the widget itself, related to eventlisteners = used within the same widget. Hope this clears the mud some. DS |