<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>To Wonder Multimedia &#187; flash</title>
	<atom:link href="http://www.to-wonder.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.to-wonder.com</link>
	<description>Development &#38; Design</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Moet er nog flashles gegeven worden?</title>
		<link>http://www.to-wonder.com/2011/12/moet-er-nog-flashles-gegeven-worden/</link>
		<comments>http://www.to-wonder.com/2011/12/moet-er-nog-flashles-gegeven-worden/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 09:00:14 +0000</pubDate>
		<dc:creator>Luc Princen</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[discussie]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.to-wonder.com/?p=1186</guid>
		<description><![CDATA[Onlangs had ik (op twee verschillende dagen) een discussie met Rowan, Timo, Olivier, Patrick en Jan Kees over Flash. En meer specifiek over hoe onze oude opleiding nu met Flash omgaat. Wij hebben allen op Communication &#038; Multimedia Design (CMD) in Breda gezeten. Een aantal van de bovengenoemde heren heeft op deze opleiding ook weer... <a href="http://www.to-wonder.com/2011/12/moet-er-nog-flashles-gegeven-worden/" style="text-decoration:none;font-size:11px;font-weight:bold">&#160;MEER &#8250;&#160;&#160;</a>]]></description>
			<content:encoded><![CDATA[<p>Onlangs had ik (op twee verschillende dagen) een discussie met <a href="http://madebypit.nl/" target="_blank">Rowan</a>, <a href="http://www.behance.net/ZwarteKoffie" target="_blank">Timo</a>, <a href="http://olivierbruininck.com/blog/" target="_blank">Olivier</a>, <a href="http://blog.inlet.nl/" target="_blank">Patrick</a> en <a href="http://blog.base42.nl/" target="_blank">Jan Kees</a> over Flash. En meer specifiek over hoe onze oude opleiding nu met Flash omgaat. Wij hebben allen op <a href="http://www.avanscmd.nl/" target="_blank">Communication &#038; Multimedia Design</a> (CMD) in Breda gezeten. Een aantal van de bovengenoemde heren heeft op deze opleiding ook weer les gegeven en de vraag kwam vanuit de school of er dit schooljaar weer Flashles gegeven kon worden. </p>
<p>&nbsp;</p>
<p>In hoeverre moet je een taal en omgeving die volgens 70% van het internet &#8216;ten dode is opgeschreven&#8217; nog willen geven? Wij hebben op deze opleiding nog Macromedia Director gehad, terwijl de taal en de omgeving na 1,5 jaar na deze lessen volledig waren verdwenen. Hoe voorspel je op die manier de toekomst en hoe weeg je af over wat nog interessant is en wat niet.</p>
<p>&nbsp;</p>
<p>Ik voelde me vrij eenzaam deze discussies omdat ik de enige was die nog wel heil zag in het geven van Actionscript. Mijn standpunt is dan ook dat die taal nog wel even relevant is, maar waar het mij vooral ook om gaat is wat er daarna met de taal gaat gebeuren. Het ontwikkelplatform voor Actionscript van Adobe is Flex. En aangezien Flex nu helemaal open source gaat worden wordt het interessant om te zien wat er mee gaat gebeuren. Volgens mij wordt het een platform waar indie-gamemakers, knutselaars en hackers mee aan de slag gaan om leuke dingen mee te maken. Volgens mij wordt het commercieel gezien geen interessant platform meer, maar ik kan me wel een wereld bedenken waarin nieuwe games via AIR op een hoop computers / tablets gaan draaien. Anyway, ik startte dit blogbericht omdat ik het idee heb dat we hier nog niet over uit gediscussieerd zijn en omdat ik heb gemerkt dat het mensen hoog zit, dus ga vooral los in de comments!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.to-wonder.com/2011/12/moet-er-nog-flashles-gegeven-worden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heftig afscheid</title>
		<link>http://www.to-wonder.com/2011/11/heftig-afscheid/</link>
		<comments>http://www.to-wonder.com/2011/11/heftig-afscheid/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 19:30:41 +0000</pubDate>
		<dc:creator>Luc Princen</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[musings]]></category>

		<guid isPermaLink="false">http://www.to-wonder.com/?p=906</guid>
		<description><![CDATA[Flash en ik hebben inmiddels al heel wat meegemaakt. Ik begon met Flash toen versie 4 net was uitgekomen. Het was toen nog van macromedia en actionscript was nog niet meer dan een paar gotoAndPlay() commando&#8217;s. Ik begon met het maken van animaties en groeide langzaamaan uit van een &#8216;creatieveling&#8217; tot een developer. Iets waar... <a href="http://www.to-wonder.com/2011/11/heftig-afscheid/" style="text-decoration:none;font-size:11px;font-weight:bold">&#160;MEER &#8250;&#160;&#160;</a>]]></description>
			<content:encoded><![CDATA[<p>Flash en ik hebben inmiddels al heel wat meegemaakt. Ik begon met Flash toen versie 4 net was uitgekomen. Het was toen nog van macromedia en actionscript was nog niet meer dan een paar gotoAndPlay() commando&#8217;s. Ik begon met het maken van animaties en groeide langzaamaan uit van een &#8216;creatieveling&#8217; tot een developer. Iets waar <a href="http://sebleedelisle.com/" target="_blank">Seb Lee-Delisle</a> vorig jaar op Adobe User Group XL ook nog over sprak; Flash is voor creatievelingen vaak het platform waarmee ze hebben leren ontwikkelen. En het is lastig om je er bij neer te leggen dat je voor een hoop andere projecten tegenwoordig meer dan &#8216;flash kennis&#8217; nodig hebt. Het is lastig je er bij neer te leggen dat Flash verleden tijd aan het raken is.</p>
<p>&nbsp;</p>
<p>Het zal nog wel even duren voor het flash-platform volledig is uitgestorven. HTML5 kan dingen als gaming op dit moment nog niet goed genoeg oppakken, en met geniale initiatieven als <a href="http://www.smartfoxserver.com/" target="_blank">SmartFox</a> blijf Flash voorlopig een grote voorsprong op multiplayer games houden. Maar het einde van het eens zo mooie Flash platform komt in zicht. Video en audio zijn al succesvol naar HTML5 overgestapt. Drag, drop, animaties en andere leuke ongein zijn eenmiddels eenvoudiger te maken met jQuery.</p>
<p>&nbsp;</p>
<p>En ik weet dat Adobe een hoop dingen verkeerd heeft gedaan, ik weet dat Flash een te gefragmenteerd platform is en dat de mobiele versie onbruikbaar is en was. Maar het doet toch een beetje pijn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.to-wonder.com/2011/11/heftig-afscheid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WiiFlash &amp; OSX 10.6+</title>
		<link>http://www.to-wonder.com/2011/11/wiiflash-and-osx/</link>
		<comments>http://www.to-wonder.com/2011/11/wiiflash-and-osx/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 09:00:09 +0000</pubDate>
		<dc:creator>Luc Princen</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[wiiflash]]></category>
		<category><![CDATA[wiimote]]></category>

		<guid isPermaLink="false">http://www.to-wonder.com/?p=796</guid>
		<description><![CDATA[This post is in english, since I&#8217;ve found that getting information on this subject was pretty hard to come by. I&#8217;ve been searching for a good open source AS3 library to &#8216;talk&#8217; to the WiiMote today and I found one in WiiFlash, it can turn WiiMote data into a bytearray which you can easily access... <a href="http://www.to-wonder.com/2011/11/wiiflash-and-osx/" style="text-decoration:none;font-size:11px;font-weight:bold">&#160;MEER &#8250;&#160;&#160;</a>]]></description>
			<content:encoded><![CDATA[<p>This post is in english, since I&#8217;ve found that getting information on this subject was pretty hard to come by. I&#8217;ve been searching for a good open source AS3 library to &#8216;talk&#8217; to the WiiMote today and I found one in <a title="WiiFlash" href="http://wiiflash.bytearray.org/" target="_blank">WiiFlash</a>, it can turn WiiMote data into a bytearray which you can easily access in Flash with the AS3 classes WiiFlash comes with. Now, this library hasn&#8217;t been updated in a while so it didn&#8217;t come as a surprise to me that it presented me with some problems on Mac OSX Lion (10.7.2). I&#8217;ve also read that it gives loads of problems on Mac OSX Snow Leopard and basically any 64-bit system with dual-core chips.</p>
<p>&nbsp;</p>
<p>A simple problem (pretty well explained by the WiiFlash website) was that the app wouldn&#8217;t launch in a 64-bit architectures, so you need to right-click on the app and check off &#8216;run in 32-bit-mode&#8217;.</p>
<p>&nbsp;</p>
<p>A bigger problem was that OSX Lion was just too damn good in recognizing the WiiMote. It hogged a connection before the open source servers could connect to it. And as you (probably) know, a bluetooth connection can only occur between two devices (or entities), in this case the OSX kernel connected to it before WiiFlash could. It turns out that Apple did a very good job of adding bluetooth devices to the HID manager (that&#8217;s the part of the OS that immediately needs to recognize connected mouses and keyboards), so my WiiMote never had a chance.</p>
<p>&nbsp;</p>
<p>I&#8217;m not the type to throw in the towel at that point, I&#8217;m the type that likes to stack tab onto tab in Chrome to find the fricking answer. <strong>And i found it! </strong>With a little (free) library called <a title="Wiiji Library" href="http://wiiji.veltrop.com/" target="_blank">Wiiji</a>, you can overwrite certain HID-manager preferences (please watch out with this if you&#8217;re an avid wireless keyboard or mouse user) to give WiiFlash a fighting chance.</p>
<p>&nbsp;</p>
<p>I&#8217;m currently trying to make the WiiFlash library a bit more stable on OSX Lion as it still has crash problems. I&#8217;ll keep you updated on that.</p>
<p>&nbsp;</p>
<p>You can <a title="WiiFlash" href="http://wiiflash.bytearray.org/" target="_blank">download WiiFlash over here</a></p>
<p>And <a href="http://wiiji.veltrop.com/" target="_blank">get Wiiji over here</a></p>
<p>&nbsp;</p>
<p>I&#8217;ll probably be adding some more blogposts about WiiFlash, Actionscript 3 and the WiiMote and AS3 and some other tactile input devices in the future, so definitely stay tuned!</p>
<p>Happy experimenting!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.to-wonder.com/2011/11/wiiflash-and-osx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Another blow</title>
		<link>http://www.to-wonder.com/2011/07/another-blow/</link>
		<comments>http://www.to-wonder.com/2011/07/another-blow/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 16:08:17 +0000</pubDate>
		<dc:creator>Luc Princen</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[paper.js]]></category>

		<guid isPermaLink="false">http://www.to-wonder.com/?p=320</guid>
		<description><![CDATA[Begrijp me niet verkeerd, ik hou van Flash. Daar ben ik in begonnen. Toen ik dertien was ben ik (sorry Adobe) begonnen met een illegale versie van Flash 4. Ik begon met designen en animeren. Toen Flash 5 kwam, werd Actionscript 1 geïntroduceerd. Flash 5 wakkerde de ontwikkelaar in mij aan; de eerste dingetjes die ik... <a href="http://www.to-wonder.com/2011/07/another-blow/" style="text-decoration:none;font-size:11px;font-weight:bold">&#160;MEER &#8250;&#160;&#160;</a>]]></description>
			<content:encoded><![CDATA[<p>Begrijp me niet verkeerd, ik hou van Flash. Daar ben ik in begonnen. Toen ik dertien was ben ik (sorry Adobe) begonnen met een illegale versie van Flash 4. Ik begon met designen en animeren. Toen Flash 5 kwam, werd Actionscript 1 geïntroduceerd. Flash 5 wakkerde de ontwikkelaar in mij aan; de eerste dingetjes die ik maakte waren in Actionscript. Toen Actionscript 3 verscheen koste me het veel pijn en moeite om over te stappen (ik was zo gewend aan AS2). Maar nu zou ik niet meer terug kunnen switchen.<br />
&nbsp;<br />
Helaas heeft Flash de afgelopen vier jaar een beetje een &#8216;bad rep&#8217; gekregen. Het heeft nu eenmaal nogal wat processorkracht nodig om te draaien en daarom draait het niet lekker om mobiele apparaten. De laptop waarop ik dit nu schrijf houd gemiddeld twee uur meer batterijleven over, als ik <a href="http://www.pcworld.com/article/209856/dump_flash_get_2_extra_hours_of_macbook_air_battery_life.html" target="_blank">Flash uit laat staan</a>. Het punt wat adobe heeft gemaakt (als je javascript uitzet, hou je ook batterijleven over) is weliswaar ook waar, maar Flash is en blijft een grotere processor-hog dan javascript.<br />
&nbsp;<br />
En dan kom ik van de week <a title="Paper.js" href="http://paperjs.org/" target="_blank">Paper.js</a> tegen. Een hele toffe javascript library die in combinatie met HTML5&#8242;s canvas property hele toffe animaties kan maken. Ik bedoel, check dit:
<div style="display:none">(hier kun je <a href="#canvas-1" id="ref">refreshen</a>) <small></div>
<p>(tip: probeer eens te klikken met de muis)</small></p>
<p>&nbsp;</p>
<p>[raw]<br />
<script src="http://paperjs.org/static/js/paper.js" type="text/javascript"></script> </p>
<p><script type="text/paperscript" canvas="canvas-1"> </p>
<p>var canvas = document.getElementById('canvas-1');
var context = canvas.getContext('2d');</p>
<p>$(document).ready(function(){
  $('#ref').click(function(){
    clearCanvas(context, canvas);
  });
  $('#ref').trigger('click')
});</p>
<p>function clearCanvas(context, canvas) {
  context.clearRect(0, 0, 500, 200);
  canvas.width = 1;
  canvas.width = 500;
  canvas.height = 1;
  canvas.height = 200
}</p>
<p>// Adapted from Flocking Processing example by Daniel Schiffman:
// http://processing.org/learning/topics/flocking.html</p>
<p>project.currentStyle = {
    strokeColor: 'white',
    strokeWidth: 2,
    strokeCap: 'round'
};</p>
<p>var head = new Path.Oval([0, 0], [13, 8]);
head.fillColor = 'white';
head.strokeColor = null;
var headSymbol = new Symbol(head);</p>
<p>var size = view.size;
var Boid = Base.extend({
    initialize: function(position, maxSpeed, maxForce) {
        var strength = Math.random() * 0.5;
        this.acc = new Point(0, 0);
        this.vel = new Point(Math.random() * 2 - 1, Math.random() * 2 - 1);
        this.loc = position.clone();
        this.r = 30;
        this.maxSpeed = maxSpeed + strength;
        this.maxForce = maxForce + strength;
        this.head = new PlacedSymbol(head);
        this.path = new Path();
        this.shortPath = new Path();
        this.shortPath.strokeWidth = 4;
        for (var i = 0, l = strength * 10 + 10; i < l; i++) {
            this.path.add(this.loc);
            if (i < 3)
                this.shortPath.add(this.loc);
        }</p>
<p>        this.firstSegment = this.path.segments[0];
        this.count = 0;
        this.lastRot = 0;
    },</p>
<p>    run: function(boids) {
        this.lastLoc = this.loc.clone();
        if (!groupTogether) {
            this.flock(boids);
        } else {
            this.align(boids);
        }
        this.borders();</p>
<p>        this.update();
        this.firstSegment.point = this.loc;
        var lastPoint = this.firstSegment.point;
        var lastVector = this.loc - this.lastLoc;
        var segments = this.path.segments;
        for (var i = 1, l = segments.length; i < l; i++) {
            var segment = segments[i];
            var vector = lastPoint - segment.point;
            this.count += this.vel.length * 10;
            var rotated = lastVector.rotate(90).normalize(Math.sin((this.count + i * 3) / 300));
            lastPoint = segment.point = lastPoint + lastVector.normalize(-5 - this.vel.length / 3);
            segment.point += rotated;
            lastVector = vector;
        }
        this.path.smooth();
        this.head.position = this.loc;
        var vector = this.loc - this.lastLoc;
        var rot = vector.angle;
        this.head.rotate(rot - this.lastRot);
        this.lastRot = rot;</p>
<p>        var shortSegments = this.shortPath.segments;
        for (var i = 0; i < 3; i++)
            shortSegments[i] = segments[i].clone();
    },</p>
<p>    // We accumulate a new acceleration each time based on three rules
    flock: function(boids) {
        var sep = this.separate(boids) * 3;
        var ali = this.align(boids);
        var coh = this.cohesion(boids);
        this.acc += sep + ali + coh;
    },</p>
<p>    update: function() {
        // Update velocity
        this.vel += this.acc;
        // Limit speed (vector#limit?)
        this.vel.length = Math.min(this.maxSpeed, this.vel.length);
        this.loc += this.vel;
        // Reset acceleration to 0 each cycle
        this.acc.length = 0;
    },</p>
<p>    seek: function(target) {
        this.acc += this.steer(target, false);
    },</p>
<p>    arrive: function(target) {
        this.acc += this.steer(target, true);
    },</p>
<p>    // A method that calculates a steering vector towards a target
    // Takes a second argument, if true, it slows down as it approaches the target
    steer: function(target, slowdown) {
        var steer,
            desired = target - this.loc,
            d = desired.length;
        if (d > 0) {
            // Two options for desired vector magnitude (1 -- based on distance, 2 -- maxSpeed)
            if (slowdown &#038;&#038; d < 100) {
                desired.length = this.maxSpeed * (d / 100); // This damping is somewhat arbitrary
            } else {
                desired.length = this.maxSpeed;
            }
            steer = desired - this.vel;
            steer.length = Math.min(this.maxForce, steer.length);
        } else {
            steer = new Point(0, 0);
        }
        return steer;
    },</p>
<p>    borders: function() {
        var loc = this.loc;
        var r = this.r;
        var oldLoc = this.loc.clone();
        var width = 500;
        var height = 200;
        if (loc.x < -r) loc.x = width + r;
        if (loc.y < -r) loc.y = height + r;
        if (loc.x > width + r) loc.x = -r;
        if (loc.y > height + r) loc.y = -r;
        var vector = this.loc - oldLoc;
        if (!vector.isZero())
            this.path.position += vector;
    },</p>
<p>    separate: function(boids) {
        var desiredSeperation = 60;
        var steer = new Point(0, 0);
        var count = 0;
        // For every boid in the system, check if it's too close
        for (var i = 0, l = boids.length; i < l; i++) {
            var other = boids[i];
            var d = other.loc.getDistance(this.loc);
            if (d > 0 &#038;&#038; d < desiredSeperation) {
                // Calculate vector pointing away from neighbor
                var diff = this.loc - other.loc;
                steer += diff.normalize(1 / d);
                count++;
            }
        }
        // Average -- divide by how many
        if (count > 0)
            steer /= count;
        if (steer.length > 0) {
            // Implement Reynolds: Steering = Desired - Velocity
            steer.length = this.maxSpeed;
            steer -= this.vel;
            steer.length = Math.min(steer.length, this.maxForce);
        }
        return steer;
    },</p>
<p>    // Alignment
    // For every nearby boid in the system, calculate the average velocity
    align: function(boids) {
        var neighborDist = 25;
        var steer = new Point(0, 0);
        var count = 0;
        var nearest = 999;
        var closestPoint;
        for (var i = 0, l = boids.length; i < l; i++) {
            var other = boids[i];
            var d = this.loc.getDistance(other.loc);
            if (d > 0 &#038;&#038; d < nearest) {
                closestPoint = other.loc;
                nearest = d;
            }
            if (d > 0 &#038;&#038; d < neighborDist) {
                steer += other.vel;
                count++;
            }
        }</p>
<p>        if (count > 0)
            steer /= count;
        if (steer.length > 0) {
            // Implement Reynolds: Steering = Desired - Velocity
            steer.length = this.maxSpeed;
            steer -= this.vel;
            steer.length = Math.min(steer.length, this.maxForce);
        }
        return steer;
    },</p>
<p>    // Cohesion
    // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
    cohesion: function(boids) {
        var neighborDist = 100;
        var sum = new Point(0, 0);
        var count = 0;
        for (var i = 0, l = boids.length; i < l; i++) {
            var other = boids[i];
            var d = this.loc.getDistance(other.loc);
            if (d > 0 &#038;&#038; d < neighborDist) {
                sum += other.loc; // Add location
                count++;
            }
        }
        if (count > 0) {
            sum /= count;
            // Steer towards the location
            return this.steer(sum, false);
        }
        return sum;
    }
});</p>
<p>var heartPath = new Path([
    [[514.6962890625, 624.703125], [7.0966796875, -26.3369140625], [-7.10205078125, -27.0244140625]],
    [[484.29052734375, 548.6025390625], [13.16845703125, 23.7060546875], [-13.173828125, -23.70703125]],
    [[407.84619140625, 438.14453125], [37.79296875, 49.935546875], [-27.71630859375, -36.6435546875]],
    [[356.654296875, 368.400390625], [6.41015625, 9.8505859375], [-10.53759765625, -16.02978515625]],
    [[333.80712890625, 324.25146484375], [4.69189453125, 13.3994140625], [-4.697265625, -13.39892578125]],
    [[326.76416015625, 283.53857421875], [0, 13.74267578125], [0, -25.42431640625]],
    [[352.18798828125, 219.634765625], [-16.95263671875, 17.17822265625], [16.94775390625, -17.1787109375]],
    [[415.0615234375, 193.8671875], [-24.96826171875, 0], [25.19287109375, 0]],
    [[480.68310546875, 220.66552734375], [-18.552734375, -17.86572265625], [13.96826171875, 13.28662109375]],
    [[514.6962890625, 280.10302734375], [-8.70703125, -26.3369140625], [7.55859375, -25.88037109375]],
    [[546.6484375, 221.0087890625], [-13.7431640625, 13.517578125], [19.0087890625, -18.32177734375]],
    [[612.61328125, 193.5234375], [-24.9677734375, 0], [24.7373046875, 0]],
    [[675.486328125, 219.119140625], [-17.177734375, -17.06005859375], [17.1787109375, 17.06591796875]],
    [[701.2548828125, 280.10302734375], [0, -23.58837890625], [0, 20.61376953125]],
    [[686.1376953125, 344.52197265625], [10.076171875, -22.33203125], [-10.08203125, 22.33203125]],
    [[627.73046875, 432.3046875], [28.8603515625, -36.1875], [-37.5673828125, 47.412109375]],
    [[545.6171875, 549.1171875], [17.1787109375, -30.458984375], [-13.517578125, 24.0498046875]]
]);
heartPath.closed = true;
heartPath.position = view.center;
heartPath.strokeColor = null;
heartPath.scale(1.5);</p>
<p>var groupTogether = false;
var pathLength = heartPath.length;
var mouseDown = false;
var boids = [];</p>
<p>// Add the boids:
for (var i = 0; i < 30; i++) {
    var position = Point.random() * size;
    boids.push(new Boid(position, 10, 0.05));
}</p>
<p>function onFrame(event) {
context.clearRect (0 , 0, 500 , 200);
    for (var i = 0, l = boids.length; i < l; i++) {
        if (groupTogether) {
            var point = heartPath.getPointAt(((i + event.count / 30) % l) / l * pathLength);
            boids[i].arrive(point);
        }
        boids[i].run(boids);
    }
}</p>
<p>// Reposition the heart path whenever the window is resized:
function onResize(event) {
    size = view.size;
    heartPath.position = view.center;
}</p>
<p>function init(){
    size = view.size;
    heartPath.position = view.center;
}</p>
<p>init();</p>
<p>function onMouseDown(event) {
    groupTogether = !groupTogether;
}</p>
<p>var layer = project.activeLayer;
function onKeyDown(event) {
    if (event.key == 'space') {
        layer.selected = !layer.selected;
        return false;
    }
}
</script></p>
<div class="canvas"style="width:500px;height:200px;display:block;background-color:#000;box-shadow:#000 2px 2px 2px;margin-left:20px;"><canvas resize="true" id="canvas-1" width="500px" height="200px" style="width:500px; height:200px;"></canvas></div>
<p>[/raw]</p>
<p>&nbsp;</p>
<p>Granted: er moet nog een hoop gebeuren voor dat Javascript op hetzelfde niveau zit als Flash (zoals je -wellicht- merkt, heb je hier ook een hardware accelerated browser voor nodig). Op dit moment heeft Flash nog z'n markt en heeft HTML5 z'n markt, maar de twee kruipen steeds dichter naar elkaar toe...<br />
&nbsp;<br />
Als Adobe niet snel reageert en het Flash platform sneller, lichter en eleganter maakt, ben ik bang dat de oorlog door HTML5 &#038; javascript gewonnen gaat worden... </p>
<p>Ik weet dat er veel Actionscript 3 developers dit blog lezen, ik ben benieuwd wat ze er van vinden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.to-wonder.com/2011/07/another-blow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

