Sat, 2008-08-02 05:25

Random Sort, No repetition

Submitted by admin on Sat, 2008-08-02 05:25.

Posted in Web | Actionscript | arrays | sorting text | login or register to post comments | read more | 30 reads »

A question on Flashkit on how to randomly sort a bank of items // build an array with 12 times the values 1-8 var arrVal:Array = new Array() for (i = 1; i <= 8; i++) { for (j = 0; j < 12; j++) { arrVal.push( i) } } // sort the array in random order, no repetition arrRnd = randomSort(arrVal) // use the function given in the previous post /** randomSort, no repetition */ function randomSort(itms) { var oItem:Object = new Object() var lastPos:Number = itms.length
Sat, 2008-08-02 04:37

Decimal Rounding

Submitted by admin on Sat, 2008-08-02 04:37.

Posted in Web | Actionscript | maths, equations | units conversion | login or register to post comments | 29 reads »

To round a number at a given decimal:
trace(roundDecimal(1.657777, 4))

function roundDecimal(val, qty) {
f = Math.pow(10, qty)
return Math.round(val*f)/f
}
Tue, 2008-04-08 09:56

AIR coming to Linux

Submitted by admin on Tue, 2008-04-08 09:56.

Posted in Actionscript 3.0 | Linux | login or register to post comments | 219 reads »

"Adobe announced today that the pre-release alpha version of AIR for Linux is available immediately on the Adobe Labs site. Adobe shipped the 1.0 version of AIR for Windows and Mac last month but was forced to delay the Linux release."

Read the article at readwriteweb.com

Sun, 2008-04-06 06:57

HyperNext Creator now Freeware

Submitted by admin on Sun, 2008-04-06 06:57.

Posted in Media Manipulation | Education | IDE | Multiple | OSX | Windows | xTalk | login or register to post comments | 184 reads »

HyperNext Creator is available as a freeware from
Tigabyte.com

OS Classic, OSX and Windows version are available.

HyperNext is a development environment for persons new to programming. It uses a language from the HyperCard/xTalk family.

Sun, 2008-04-06 00:22

Matching Learning Activity, new version uploaded in the gallery

Submitted by admin on Sun, 2008-04-06 00:22.

Posted in Actionscript 3.0 | Component-based | Flex | Teaching & Training Tools | login or register to post comments | read more | 104 reads »

A new version of the matching learning activity has been uploaded in the Flex Gallery, under courseware

Demo and source code available.

Changes:

  • Drop accepted when the mouse is anywhere on the target picture.
  • Drop not accepted for an item that has already been attempted.
  • Score updated after each attempt (number correct and number attempted).
  • Code slightly reorganized to avoid the split into TargetList and TargetItem.

Wed, 2008-03-12 19:35

Adobe Flex Intro PPT

Submitted by admin on Wed, 2008-03-12 19:35.

Posted in 1 novice coder | Actionscript 3.0 | Flex | login or register to post comments | read more | 170 reads »

Adobe Flex Intro PPT posted @ flexed.wordpress.com

Copied from blog entry "[...] presentation for The Chennai Cold Fusion User Group (CCFUG Homepage). Am posting the ppt here. The presentation covered the basics - intro to RIAs, intro to Adobe Flex, a couple of examples and a little bit about Adobe AIR. Check it out… if you have nothing else to do … The audience were cold fusion developers who were new to Adobe Flex and Adobe AIR. I touched the basics and then walked them through some code examples of Flex and Air."

Mon, 2008-03-10 10:02

Multiuser applications in ActionScript with Unity

Submitted by admin on Mon, 2008-03-10 10:02.

Posted in Actionscript | Actionscript 3.0 | login or register to post comments | 163 reads »

lecture notes Introduction to Unity @ moock.org

Unity is a multiuser application development kit.

Mon, 2008-03-10 09:57

MVC in actionscript

Submitted by admin on Mon, 2008-03-10 09:57.

Posted in Actionscript | Actionscript 3.0 | MVC | login or register to post comments | 184 reads »

Lecture notes on MVC (in AS) @ moock.org

mvc separates the code required to manage a user interface into three distinct classes:

  • model: stores the data and application logic for the interface
  • view: renders the interface (usually to the screen)
  • controller: responds to user input by modifying the model
Mon, 2008-03-10 09:48

Event Model

Submitted by admin on Mon, 2008-03-10 09:48.

Posted in Actionscript | Actionscript 3.0 | events/messages | login or register to post comments | read more | 111 reads »

Source: Intro To AS3 @ moock.org

Registration

general code:
someObj.addEventListener(EventName, listenerFunction)
public function listenerFunction (e:EventType):void {
  trace("event fired");
}
example code: var s:Sprite = new Sprite(); s.addChild(new Rectangle(25, 25)); s.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownListener); public function mouseDownListener (e:MouseEvent):void { trace("mouse down listener triggered); // Method bound to current object (delegation built in) trace("current object is: " + this);
Mon, 2008-03-10 09:45

Vector drawing

Submitted by admin on Mon, 2008-03-10 09:45.

Posted in 2D | Actionscript | Actionscript 3.0 | login or register to post comments | 122 reads »


var rect:Shape = new Shape();
rect.graphics.lineStyle(1);
rect.graphics.beginFill(0x0000FF, 1);
rect.graphics.drawRect(0, 0, 75, 50);

For the graphic to appear on stage, don't forget to add:

addChild(rect);

At the top of the script, make sure you import the required libraries

import flash.display.Shape;