This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demo.view; | |
import flash.display.Sprite; | |
import flash.display.DisplayObject; | |
import robothaxe.core.IViewContainer; | |
class BaseView extends Sprite, implements IViewContainer { | |
public var viewAdded:Dynamic -> Void; | |
public var viewRemoved:Dynamic -> Void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package interfaces; | |
interface SampleInterface { | |
//Read only property | |
var ro(default,null):Int; | |
//Write only property | |
var wo(null,default):Int; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flash.events.Event; | |
import flash.display.Shape; | |
import flash.display.Sprite; | |
class Test { | |
static var W = 540; | |
static var H = 300; | |
static var colours = [0x419164, 0x21A4A6, 0x52BAAB, 0x85CCBE]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//grid layout snippet: | |
for(i in 0...cellCount) { | |
var cell = cells[i]; | |
var xPos = (i % cols) * (cellWidth + colSpacing); | |
var yPos = Math.floor(i / cols) * (cellHeight + rowSpacing); | |
cell.x = xPos; | |
cell.y = yPos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var slideCount:Int; | |
var currentSlide:Int; | |
function getNextIndex():Int | |
{ | |
return currentSlide < slideCount ? ++currentSlide : slideCount; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
see it working here: http://try.haxe.org/#Bb6eF | |
taken from here: http://seb.ly/2007/11/animated-plasma-in-flash/ | |
*/ | |
import flash.display.BitmapData; | |
import flash.events.Event; | |
import flash.display.Bitmap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
see it working here: http://try.haxe.org/#DEacf | |
A circle follows the cursor and gets copied to a bitmap | |
Uses an adaptation of hype.extended.behavior.FixedVibration | |
*/ | |
import flash.display.BitmapData; | |
import flash.display.Sprite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Shopper = Backbone.Model.extend({ | |
save: function (options){ | |
var model = this; | |
$.ajax({ | |
url:'/your/url/', | |
type:'POST', | |
dataType: 'json', | |
data: model.toJSON(), | |
success: function (object, status){ | |
//things to do if model saved successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var states = [ | |
{ | |
'name':'working', | |
'initial':true, | |
'events':{ | |
'bored':'coffee', | |
'call_for_meeting':'meeting', | |
} | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//select p tags to manipulate | |
d3.select("body").selectAll("p") | |
//initial dataset | |
.data([4, 8, 15, 16, 23, 42]) | |
//create any nodes that don't already exist (all of them) | |
.enter().append("p") | |
//set the node text based on the data |
OlderNewer