Errata

Introducing Starling

Errata for Introducing Starling

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 9
line : addChild ( new Stats() );

Introducing Starling
by Thibault Imbert
2012-05-09 Third release
page 9 - Setting Up Your Scene
line : addChild ( new Stats() );

Erreur ? la compilation =
1067 : Contrainte implicite d'une valeur du tyoe fr.kouma.starling.utils:Stats vers un type sans rapport flash.Display:DisplayObject.
Ressource = Startup.as (version ="V0.3")
Chemin = /Startup/src

sous FlashBuilder 4.6 et SDK Flex 4.6.0
et starling.swc version 1.2
(Starling 1.2 / PrimaryFeather-Starling-Framework-2a42a8e)
avec projet Actionscript de nom "Startup"
et dans src dans (package par d?faut) :
- les 2 classes : Starup.as (page 9) et Game.as (page 10)
- et la classe fr.kouma.starling.utils.Stats.as (version "V0.3")
(dans les sous-dossiers ci-dessus avec les 2 fichiers annexes standard_07_55.png et standard_07_55.fnt)


Hugues FREI  Nov 18, 2012 
PDF Page 36
Code inside the onTouchedSprite( ) function

The code for calculating the distance between two touch points could be simplified by using the flash.geom.Point class's static method distance(p1:Point, p2:Point):Number. Here is the re-written function:

private var distance:Number;
private var finger1:Touch;
private var finger2:Touch;
private var touches:Vector.<Touch>;

private function onTouchedSprite(e:TouchEvent):void
{
touches = e.touches;

if (touches.length == 2)
{
finger1 = touches[0];
finger2 = touches[1];

if (finger1.phase == TouchPhase.MOVED && finger2.phase == TouchPhase.MOVED)
{
distance = Point.distance(new Point(finger1.globalX, finger1.globalY),
new Point(finger2.globalX, finger2.globalY));
trace( "distance:", distance );
}
}
}

T Graham  Feb 09, 2013