player.connect();
}
function charge_anim2() {
- var a = new Animation('anim2');
+ var a = new Animation('anim2','../ellipsographe/svg/ellipsographe-',1,91);
a.loopOnload();
var b = new Controle(a);
b.connect();
</div>
<p>Il est possible de différer le chargement de l'animation en créant une fonction Javascript.</p>
<div class="sourceCode"><pre class="sourceCode javascript"><code class="sourceCode javascript"><span class="kw">function</span> <span class="at">charge_anim2</span>() <span class="op">{</span>
- <span class="kw">var</span> a <span class="op">=</span> <span class="kw">new</span> <span class="at">Animation</span>(<span class="st">'anim2'</span>)<span class="op">;</span>
+ <span class="kw">var</span> a <span class="op">=</span> <span class="kw">new</span> <span class="at">Animation</span>(<span class="st">'anim2'</span><span class="op">,</span><span class="st">'svg/ellipsographe-'</span><span class="op">,</span><span class="dv">1</span><span class="op">,</span><span class="dv">91</span>)<span class="op">;</span>
<span class="va">a</span>.<span class="at">loopOnload</span>()<span class="op">;</span>
<span class="kw">var</span> b <span class="op">=</span> <span class="kw">new</span> <span class="at">Controle</span>(a)<span class="op">;</span>
<span class="va">b</span>.<span class="at">connect</span>()<span class="op">;</span>
player.connect();
}
function charge_anim2() {
- var a = new Animation('anim2');
+ var a = new Animation('anim2','../ellipsographe/svg/ellipsographe-',1,91);
a.loopOnload();
var b = new Controle(a);
b.connect();
~~~~~~~ { .javascript }
function charge_anim2() {
- var a = new Animation('anim2');
+ var a = new Animation('anim2','svg/ellipsographe-',1,91);
a.loopOnload();
var b = new Controle(a);
b.connect();