Let’s continue from where we finished last post. We have Triangle AS3.0 class up and running and we want to use it and draw some pyramids.If you look carefully you will notice that every pyramid consist of two triangles. This is actually simplified version where only two sides are visible and front side triangle has 3 x 60 degrees angles. This is the reason why we need only top pyramid point coordinates and its height, because with some simple math we can easily find other points.Here is Pyramide.as classpackage com.blogspot.flanture.triangles{ import com.blogspot.flanture.triangles.Triangle; import flash.display.Sprite; import flash.geom.Point; public class Pyramide extends
261 readersActionScript3.0 Rectangle class is part of the flash.geom package besides Point, Matrix, Transform and ColorTransform. Any visual representation of rectangles has to be implemented by programmer. One way of doing it is to create new class and here I wanted to include rectangle color as initial parameter, so this new class vRectangle (from visual rectangle,
67 readersIn this 3rd part we’ll manage stage edges and balls collisions. You’re invited to read steps 1 and 2 if you didn’t already. The main function does not change. 1 2 3 4 5 6 7 8 9 10 11 package { import flash.display.Sprite; public class onon extends Sprite { // field_mc has a parameter
346 readersMethod closures allow you to bind variables into the scope of an anonymous function. Watch the value of local variable 'i' in the example below in the returned anonymous function. It is a bit twisted but results show the scope of local variable 'i' is bound in the returned function from newCounter.CODE AT PASTIEpackage{ import
553 readers
731 readers
316 readers
614 readers
282 readers
860 readers
212 readersUsing the enum strategy can save you some heartache if you want to create type safe applications. Say you have a type characteristic of an object. For example, every time you create a new Person(), you can specify a height like new Person("tall"), new Person("average") or new Person("short"). But how do you ensure that you
3,615
Subscribe to RSS headline updates from:
GurusUnleashed
Powered by FeedBurner
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

