From: <s4...@st...> - 2003-07-18 21:19:04
|
Hi guys, hi Leif, I apologize if this is the 2nd time you receive the same email. I used=20 my company's email address to sent the first one, and wasn't sure if=20 that was able to get through, since I am not registered with that email=20 address.=20 I am using DynAPI version 3.0, which I downloaded from this link: http://osdn.dl.sourceforge.net/sourceforge/dynapi/dynapi-3.0.0-beta1.zip I checked out the snapshots, but I'm not sure which one this file=20 corresponds to. I found this link on the DynAPI website, here: http://dynapi.sourceforge.net/dynapi/article.php? sid=3D55&mode=3Dthreaded&order=3D0 Anyway, the scripts I was writing was nothing special, but I will just=20 give you a simple example: ----------------------------------------------------------------------- <html> <head> <title>DynAPI Examples - Glide Animation (Path Animation)</title> <script language=3D"JavaScript" src=3D"dynapi3x/src/dynapi.js"></script> <script language=3D"Javascript"> dynapi.library.setPath('dynapi3x/src/'); dynapi.library.include('dynapi.api'); dynapi.library.include('PathAnimation'); dynapi.library.include('GlideAnimation'); </script> <script language=3D"Javascript"> DynAPI.onLoad(init); function init() { a =3D new DynLayer(); a.setSize(20,20); a.setLocation(500,100); a.setBgColor("green"); b =3D new DynLayer(); b.setSize(20,20); b.setLocation(200,100); b.setBgColor("red"); =09 b_anim =3D new PathAnimation(b); b_anim.sleep(20); var p =3D GlideAnimation(200,100,400,100,7,'slow','slow');=09 b_anim.add(p,false); =09 a_anim =3D new PathAnimation(a); a_anim.sleep(20); var t =3D GlideAnimation(500,100,400,100,7,'slow','slow'); t =3D t.concat( GlideAnimation(400,100,400,200,7,'slow','slow') ); t =3D t.concat( GlideAnimation(400,200,200,200,7,'slow','slow') ); t =3D t.concat( GlideAnimation(200,200,200,100,7,'slow','slow') ); a_anim.add(t,false); =09 a_anim.playAnimation(); b_anim.playAnimation(); =09 dynapi.document.addChild(a); dynapi.document.addChild(b); } //--> </script> </head> <body bgcolor=3D"#ffffff"> <script>dynapi.document.insertAllChildren();</script> </body> </html> ----------------------------------------------------------------------- So, the =93a_anim=94 and =93b_anim=94 execute simultaneously, which is wh= at I=20 DON=92T want. I want to be able to wait until =93a_anim=94 is finished, a= nd=20 then execute =93b_anim=94.=20 Now, as I mentioned before, I found a =93.playing=94 property in the sour= ce=20 files, so I thought I might want to give that a go. But that property=20 is always true. Maybe I can=92t access it or something... I don=92t know.= =20 Are there =93private=94 and =93public=94 properties in JS? Again, I=92m n= ew at=20 this, so these questions may sound pretty stupid.=20 Anyway, if anyone would be kind enough to point out how I can execute=20 the animations sequentially rather than simultaneously, he has my=20 gratitude and thanks =3D) Steven |
From: Raymond I. <xw...@ya...> - 2003-07-18 22:01:11
|
Try using the onpathstart and onpathfinish used by PathAnimation onthreadstart & onthreadfinish used by Thread, GlideAnimation and SlideAnimation -- Raymond Irving --- s4...@st... wrote: > Hi guys, hi Leif, > > I apologize if this is the 2nd time you receive the > same email. I used > my company's email address to sent the first one, > and wasn't sure if > that was able to get through, since I am not > registered with that email > address. > > I am using DynAPI version 3.0, which I downloaded > from this link: > > http://osdn.dl.sourceforge.net/sourceforge/dynapi/dynapi-3.0.0-beta1.zip > > I checked out the snapshots, but I'm not sure which > one this file > corresponds to. I found this link on the DynAPI > website, here: > > http://dynapi.sourceforge.net/dynapi/article.php? > sid=55&mode=threaded&order=0 > > Anyway, the scripts I was writing was nothing > special, but I will just > give you a simple example: > > ----------------------------------------------------------------------- > > <html> > <head> > <title>DynAPI Examples - Glide Animation (Path > Animation)</title> > <script language="JavaScript" > src="dynapi3x/src/dynapi.js"></script> > <script language="Javascript"> > dynapi.library.setPath('dynapi3x/src/'); > dynapi.library.include('dynapi.api'); > > dynapi.library.include('PathAnimation'); > dynapi.library.include('GlideAnimation'); > </script> > > <script language="Javascript"> > > DynAPI.onLoad(init); > > function init() { > > a = new DynLayer(); > a.setSize(20,20); > a.setLocation(500,100); > a.setBgColor("green"); > > b = new DynLayer(); > b.setSize(20,20); > b.setLocation(200,100); > b.setBgColor("red"); > > b_anim = new PathAnimation(b); > b_anim.sleep(20); > var p = > GlideAnimation(200,100,400,100,7,'slow','slow'); > b_anim.add(p,false); > > a_anim = new PathAnimation(a); > a_anim.sleep(20); > var t = > GlideAnimation(500,100,400,100,7,'slow','slow'); > t = t.concat( > GlideAnimation(400,100,400,200,7,'slow','slow') ); > t = t.concat( > GlideAnimation(400,200,200,200,7,'slow','slow') ); > t = t.concat( > GlideAnimation(200,200,200,100,7,'slow','slow') ); > a_anim.add(t,false); > > a_anim.playAnimation(); > b_anim.playAnimation(); > > dynapi.document.addChild(a); > dynapi.document.addChild(b); > } > > //--> > </script> > </head> > > <body bgcolor="#ffffff"> > > <script>dynapi.document.insertAllChildren();</script> > > </body> > </html> > > ----------------------------------------------------------------------- > > So, the a_anim and b_anim execute > simultaneously, which is what I > DONT want. I want to be able to wait until a_anim > is finished, and > then execute b_anim. > > Now, as I mentioned before, I found a .playing > property in the source > files, so I thought I might want to give that a go. > But that property > is always true. Maybe I cant access it or > something... I dont know. > Are there private and public properties in JS? > Again, Im new at > this, so these questions may sound pretty stupid. > > Anyway, if anyone would be kind enough to point out > how I can execute > the animations sequentially rather than > simultaneously, he has my > gratitude and thanks =) > > Steven > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems > on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell > virtual machines at the > same time. Free trial click here: > http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
From: Leif W <war...@us...> - 2003-07-18 22:12:28
|
Ah! I was trying to figure out how to do this, and found the onthreadfinish, and was trying to use that, and it didn't work. That's because I needed to listen to the onpathfinish event. Here's the example page, and I think it would be a good idea to add an example with "chaining" of events. Leif P.S. I couldn't find much info in the docs about the threads. Do threads allow you to combine multiple layers to move on separate paths, but start and stop all at once while leaving separate threads running? I.e. layers A, B, and C move in three concentric circular orbits, while D, E, F, and G move in a square path? <html> <head> <title>DynAPI Examples - Glide Animation (Path Animation)</title> <script language="JavaScript" src="../src/dynapi.js"></script> <script language="JavaScript"> dynapi.library.setPath('../src/'); dynapi.library.include('dynapi.api'); dynapi.library.include('PathAnimation'); dynapi.library.include('GlideAnimation'); //dynapi.library.include('Thread'); DynAPI.onLoad(init); function init() { a = new DynLayer(); a.setSize(20,20); a.setLocation(500,100); a.setBgColor("green"); b = new DynLayer(); b.setSize(20,20); b.setLocation(200,100); b.setBgColor("red"); a_anim = new PathAnimation(a); a_anim.sleep(20); var t = GlideAnimation(500,100,400,100,7,'slow','slow'); t = t.concat( GlideAnimation(400,100,400,200,7,'slow','slow') ); t = t.concat( GlideAnimation(400,200,200,200,7,'slow','slow') ); t = t.concat( GlideAnimation(200,200,200,100,7,'slow','slow') ); a_anim.add(t,false); b_anim = new PathAnimation(b); b_anim.sleep(20); var p = GlideAnimation(200,100,400,100,7,'slow','slow'); b_anim.add(p,false); // listen for a_anim's pathfinish event a.addEventListener({ onpathfinish : function(e) { b_anim.playAnimation(); } }); dynapi.document.addChild(a); dynapi.document.addChild(b); a_anim.playAnimation(); } //dynapi.document.insertAllChildren(); //--> </script> </head> <body bgcolor="#ffffff"> </body> </html> ----- Original Message ----- From: "Raymond Irving" <xw...@ya...> To: <dyn...@li...> Sent: Friday, July 18, 2003 6:01 PM Subject: RE: [Dynapi-Help] playing multiple animations one after the other > > Try using the onpathstart and onpathfinish used by > PathAnimation > > onthreadstart & onthreadfinish used by Thread, > GlideAnimation and SlideAnimation > > -- > Raymond Irving > > --- s4...@st... wrote: > > Hi guys, hi Leif, > > > > I apologize if this is the 2nd time you receive the > > same email. I used > > my company's email address to sent the first one, > > and wasn't sure if > > that was able to get through, since I am not > > registered with that email > > address. > > > > I am using DynAPI version 3.0, which I downloaded > > from this link: > > > > > http://osdn.dl.sourceforge.net/sourceforge/dynapi/dynapi-3.0.0-beta1.zip > > > > I checked out the snapshots, but I'm not sure which > > one this file > > corresponds to. I found this link on the DynAPI > > website, here: > > > > http://dynapi.sourceforge.net/dynapi/article.php? > > sid=55&mode=threaded&order=0 > > > > Anyway, the scripts I was writing was nothing > > special, but I will just > > give you a simple example: > > > > > ----------------------------------------------------------------------- > > > > <html> > > <head> > > <title>DynAPI Examples - Glide Animation (Path > > Animation)</title> > > <script language="JavaScript" > > src="dynapi3x/src/dynapi.js"></script> > > <script language="Javascript"> > > dynapi.library.setPath('dynapi3x/src/'); > > dynapi.library.include('dynapi.api'); > > > > dynapi.library.include('PathAnimation'); > > dynapi.library.include('GlideAnimation'); > > </script> > > > > <script language="Javascript"> > > > > DynAPI.onLoad(init); > > > > function init() { > > > > a = new DynLayer(); > > a.setSize(20,20); > > a.setLocation(500,100); > > a.setBgColor("green"); > > > > b = new DynLayer(); > > b.setSize(20,20); > > b.setLocation(200,100); > > b.setBgColor("red"); > > > > b_anim = new PathAnimation(b); > > b_anim.sleep(20); > > var p = > > GlideAnimation(200,100,400,100,7,'slow','slow'); > > b_anim.add(p,false); > > > > a_anim = new PathAnimation(a); > > a_anim.sleep(20); > > var t = > > GlideAnimation(500,100,400,100,7,'slow','slow'); > > t = t.concat( > > GlideAnimation(400,100,400,200,7,'slow','slow') ); > > t = t.concat( > > GlideAnimation(400,200,200,200,7,'slow','slow') ); > > t = t.concat( > > GlideAnimation(200,200,200,100,7,'slow','slow') ); > > a_anim.add(t,false); > > > > a_anim.playAnimation(); > > b_anim.playAnimation(); > > > > dynapi.document.addChild(a); > > dynapi.document.addChild(b); > > } > > > > //--> > > </script> > > </head> > > > > <body bgcolor="#ffffff"> > > > > > <script>dynapi.document.insertAllChildren();</script> > > > > </body> > > </html> > > > > > ----------------------------------------------------------------------- > > > > So, the "a_anim" and "b_anim" execute > > simultaneously, which is what I > > DON'T want. I want to be able to wait until "a_anim" > > is finished, and > > then execute "b_anim". > > > > Now, as I mentioned before, I found a ".playing" > > property in the source > > files, so I thought I might want to give that a go. > > But that property > > is always true. Maybe I can't access it or > > something... I don't know. > > Are there "private" and "public" properties in JS? > > Again, I'm new at > > this, so these questions may sound pretty stupid. > > > > Anyway, if anyone would be kind enough to point out > > how I can execute > > the animations sequentially rather than > > simultaneously, he has my > > gratitude and thanks =) > > > > Steven > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: VM Ware > > With VMware you can run multiple operating systems > > on a single machine. > > WITHOUT REBOOTING! Mix Linux / Windows / Novell > > virtual machines at the > > same time. Free trial click here: > > http://www.vmware.com/wl/offer/345/0 > > _______________________________________________ > > Dynapi-Help mailing list > > Dyn...@li... > > > https://lists.sourceforge.net/lists/listinfo/dynapi-help > > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help > > |