Skip to content

Instantly share code, notes, and snippets.

/**
* Yet another DANMAKU #1 rev2
* ===========================
* Bullets now reflect @ walls!
*
* This sample assigns bullet objects every time when new bullets are
* needed. Creating a new bullet costs much, we'd better find an another
* way to manage bullets.
*/
package {
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.events.FocusEvent;
public class PlaceholderTextField extends TextField {
public var placeholder:String;
public var placeholderColor:uint;
private var defaultTextColor:uint;
package {
import flash.text.TextField;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.StyleSheet;
import flash.system.System;
import flash.events.Event;
import flash.events.IOErrorEvent;
public class MyHTMLTextLoader {
package {
import flash.display.*;
import flash.filters.*;
import flash.events.*;
import flash.media.*;
public class MyPlayBass extends Sprite {
private var pointSpriteTop:Sprite;
private var pointSpriteBottom:Sprite;
#coding: utf-8
space = u' '
message = u"""あけまして
おめでとう
ございます
今年もよろしくお願いします
"""
messageArray = message.split('\n')
maxTokenLength = len(max(messageArray, key=lambda x:len(x)))
PFont font;
String message;
void setup() {
size(300, 700);
noLoop();
font = createFont("HiraMinProN-W6", 36, true);
message = "あけまして\nおめでとう\nございます\n今年もよろしくお願いします";
}
// TEST CODE
var abesi = {
"hidebu": {
"loginPage": this.loginPage,
"tawaba": 1
},
"itterebo": 2
};
trace(abesi);
trace(abesi.hidebu.loginPage, abesi["hidebu"].loginPage, abesi["hidebu"]["loginPage"], abesi["hidebu.loginPage"]);
// When loader has finished its loading...
var loaderInfo:LoaderInfo = event.target as LoaderInfo;
var mc:MovieClip = loaderInfo.content as MovieClip;
var xml:XML = describeType(mc);
var variable:XMLList = xml.child("variable");
// Correct way, uses temporary variable
for each (var v:XML in variable) {
var dict:Dictionary = new Dictionary();
var abesi:Sprite = new Sprite();
var hidebu:Sprite = new Sprite();
dict[abesi] = "abesi";
dict[hidebu] = "hidebu";
trace(dict[abesi]);
// "abesi"
""" My tag library. """
from django.template import Node, NodeList, Template, Context, Variable
from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_STAR
T, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END
from django.template import get_library, Library, InvalidTemplateLibrary
from django.conf import settings
from django.utils.encoding import smart_str, smart_unicode
from django.utils.itercompat import groupby
from django.utils.safestring import mark_safe