snipt

Ctrl+h for KB shortcuts

ActionScript

Simple Image Loader

1
2
3
var loader:MovieClipLoader = new MovieClipLoader();
this.createEmptyMovieClip("MyImageContainer",1);
loader.loadClip("image1.jpg",MyImageContainer);
https://snipt.net/embed/50d2eafa315c731a1bf2d8f6952f6a5c/
/raw/50d2eafa315c731a1bf2d8f6952f6a5c/
50d2eafa315c731a1bf2d8f6952f6a5c
as
ActionScript
3
2019-08-23T15:39:41
True
False
False
/api/public/snipt/4336/
simple-image-loader
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">var</span> <span class="nx">loader</span><span class="o">:</span><span class="nb">MovieClipLoader</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">MovieClipLoader</span><span class="p">();</span> </span><span id="L-2"><a name="L-2"></a><span class="k">this</span><span class="p">.</span><span class="nx">createEmptyMovieClip</span><span class="p">(</span><span class="s2">&quot;MyImageContainer&quot;</span><span class="o">,</span><span class="mi">1</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">loader</span><span class="p">.</span><span class="nx">loadClip</span><span class="p">(</span><span class="s2">&quot;image1.jpg&quot;</span><span class="o">,</span><span class="nx">MyImageContainer</span><span class="p">);</span> </span></pre></div> </td></tr></table>
flash, image, loader