From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/20493 Path: news.gmane.org!not-for-mail From: Willi Egger Newsgroups: gmane.comp.tex.context Subject: Re: Re: Animations in ConTeXt Date: Wed, 25 May 2005 17:32:40 +0200 Message-ID: <42949A98.8000605@boede.nl> References: <1116757157.13109.9.camel@drr.elaphus> <429218EE.1040908@boede.nl> <6faad9f00505241107123dc407@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1117035221 17203 80.91.229.2 (25 May 2005 15:33:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 May 2005 15:33:41 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed May 25 17:33:36 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DaxqZ-00034G-L5 for gctc-ntg-context-518@m.gmane.org; Wed, 25 May 2005 17:31:05 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 90CE0127B3; Wed, 25 May 2005 17:32:52 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06968-03; Wed, 25 May 2005 17:32:47 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BCE711278A; Wed, 25 May 2005 17:32:46 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ADDF21278A for ; Wed, 25 May 2005 17:32:44 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06805-05 for ; Wed, 25 May 2005 17:32:43 +0200 (CEST) Original-Received: from smtp-vbr7.xs4all.nl (smtp-vbr7.xs4all.nl [194.109.24.27]) by ronja.ntg.nl (Postfix) with ESMTP id 5CB171277B for ; Wed, 25 May 2005 17:32:43 +0200 (CEST) Original-Received: from [192.168.0.193] (a80-126-172-1.adsl.xs4all.nl [80.126.172.1]) by smtp-vbr7.xs4all.nl (8.13.3/8.13.3) with ESMTP id j4PFWdex057907; Wed, 25 May 2005 17:32:40 +0200 (CEST) (envelope-from w.egger@boede.nl) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en Original-To: Mojca Miklavec , mailing list for ConTeXt users In-Reply-To: <6faad9f00505241107123dc407@mail.gmail.com> X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:20493 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:20493 Hi Mojca, this is strange, on my installation with Acrobat 7.0.1 under Windows XP=20 both the stepwise and continuous part work properly. Willi Mojca Miklavec wrote: > I don't get it. Examples (animations) on > http://www.fi.muni.cz/~xholecek/animations/ compile and work OK with > my TeX and Acrobat (Windows XP, Adobe Acrobat Professional 6.0.1). > However, the example below doesn't work on my computer. >=20 > I replaced some lines below with: >=20 > \starttext > \placefigure [here] [fig:animation] > {A simple \MetaFun\ animation, > click \goto {here} [JS(Rotate_Star)] to start (or stop) or > % this line was added as described in MetaFun manual > click \goto {here} [JS(Walk_Field{vortex})] for next step} > {\fieldstack [vortex]} > \stoptext=20 >=20 > which results in the PDF file attached. >=20 > Stepping in JS(Walk_Field{vortex}) works OK, while continuous > animation in JS(Rotate_Star) doesn't. Is this because of my (old?) > ConTeXt distribution (ver 2005.01.31, fmt 2005.5.16), because of my > (old/buggy?) Acrobat/OS or because of problems in JavaScript? >=20 > Thank you, > Mojca >=20 > Willi Egger wrote: >=20 >>Hi Richard, >> >>thanks for this example. I tried it and voil=E0! >> >>Willi >> >>Richard Hirsch wrote: >> >>>Richard Rascher-Friesenhausen asked >>> >>> >>>>So again. Is it possible to write something like the above animation >>> >>>packages >>> >>> >>>>in ConTeXt (as a module)? >>> >>> >>>If Acrobat can display them, ConTeXt can generate them. >>> >>>Here is a simple example. >>> >>>\setupoutput [pdf] >>>\setupcolors [state=3Dstart] >>>\setupinteraction [state=3Dstart] >>>\setuppapersize [S6][S6] >>> >>>%% this is just code to get something to animate >>>\startMPinclusions >>> picture thearrow, thestar; >>> >>> drawarrow (origin--up) scaled 10mm >>> withpen pencircle scaled 3pt >>> withcolor .9 red; >>> setbounds currentpicture to (fullcircle scaled 22mm); >>> >>> thearrow:=3D currentpicture scaled 5; >>> currentpicture:=3D nullpicture; >>> >>> for angle=3D0 step 72 until 359: >>> draw thearrow rotated angle; >>> endfor >>> >>> thestar:=3D currentpicture; >>> currentpicture:=3D nullpicture >>>\stopMPinclusions >>> >>>\setupMPvariables [drawstar] [rotation=3D0] >>>\startuniqueMPgraphic{drawstar}{rotation} >>> draw thestar rotated \MPvar{rotation}; >>>\stopuniqueMPgraphic >>> >>> >>>%% now we define some symbols (the frames of the animated sequence) >>>\def\definestarsymbol#1{% >>> \definesymbol [star #1] [\uniqueMPgraphic{drawstar}{rotation=3D#1}]} >>> >>>\definestarsymbol{0} >>>\definestarsymbol{6} >>>\definestarsymbol{12} >>>\definestarsymbol{18} >>>\definestarsymbol{24} >>>\definestarsymbol{30} >>>\definestarsymbol{36} >>>\definestarsymbol{42} >>>\definestarsymbol{48} >>>\definestarsymbol{54} >>>\definestarsymbol{60} >>>\definestarsymbol{66} >>> >>>%% the frames are put into a fieldstack >>>\definefieldstack [vortex] >>> [star 0, star 6, star 12, star 18, star 24, star 30, >>> star 36, star 42, star 48, star 54, star 60, star 66] >>> >>>%% and this is the JavaScrip code that displays the frames one by one >>>\startJSpreamble MyField used later >>>var current =3D 1; >>>var delay =3D 200; % 200 milliseconds >>>var timer; >>>var running =3D false; % animation currently not running >>> >>>function Advance_Angle ( ) { >>> this.getField("vortex:"+current).value =3D "Off"; >>> if (++current > 12) % number of frames >>> { current =3D 1; } % loop through frames >>> this.getField("vortex:"+current).value =3D "On"; >>>} >>>\stopJSpreamble >>> >>>%% we want to control the starting and stopping of the animation >>>\startJScode Rotate_Star uses MyField >>>if (running) { >>> try { app.clearInterval(timer); } catch(except) {}; >>> running =3D false; >>>} >>>else { >>> timer =3D app.setInterval("Advance_Angle()",delay); >>> running =3D true; >>>} >>>\stopJScode >>> >>> >>>\starttext >>> \placefigure [here] [fig:animation] >>> {A simple \MetaFun\ animation, >>> click \goto {here} [JS(Rotate_Star)] to start (or stop)} >>> {\fieldstack [vortex]} >>>\stoptext >>> >>>Best regards, >>> >>> Richard >>> >>> >>>----------------------------------------------------------------------= -- >>> >>>_______________________________________________ >>>ntg-context mailing list >>>ntg-context@ntg.nl >>>http://www.ntg.nl/mailman/listinfo/ntg-context