Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/bash
readonly FLA_NAME='Adobe Flash'
readonly APP_DIR='/Applications/'
readonly CREATE_FILENAME='CreateProject_'
readonly UPDATE_FILENAME='UpdateProject_'
CMDNAME='progression $0'
FLA_VER='CS4'
@cellfusion
cellfusion / gist:209922
Created October 14, 2009 09:33
AS3 は asfunction がないので、TextEvent.LINK で受け取った文字列で判別する
var tf:TextField = new TextField();
tf.multiline = true;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.text = "<a href='event:hoge|args1,args2'>hoge</a> fuga";
tf.addEventListenener(TextEvent.LINK, linkHandler);
addChild(tf);
function linkHandler(event:TextEvent):void
{
trace(event.text); // trace -> hoge|args1,args2
@cellfusion
cellfusion / gist:1350941
Created November 9, 2011 09:20
duplicate MovieClip JSFL
num = 48
path = fl.getDocumentDOM().library.getItemProperty("name");
path_array = path.split("/");
name = path_array[path_array.length - 1];
linkageBaseClass = fl.getDocumentDOM().library.getItemProperty("linkageBaseClass");
linkageExportForAS = fl.getDocumentDOM().library.getItemProperty("linkageExportForAS");
linkageExportInFirstFrame = fl.getDocumentDOM().library.getItemProperty("linkageExportInFirstFrame");
for (i = 1; i < num; i++) {
@cellfusion
cellfusion / gist:1631965
Created January 18, 2012 08:25
極座標変換用の displacementMap 画像作成
var map:BitmapData = new BitmapData(w, h, false, 0xFF808080);
map.lock();
var center:Point = new Point(w / 2, h / 2);
var rmax:Number = Math.sqrt(Math.pow(center.x, 2) + Math.pow(center.y, 2));
for (var x:int = 0; x < w; x++) {
for (var y:int = 0; y < h; y++) {
var xpos:Number = center.x - x;
var ypos:Number = center.y - (h-y);
var radius:Number = Math.sqrt(xpos * xpos + ypos * ypos);
@cellfusion
cellfusion / DemoActionPlugin.as
Created May 11, 2012 07:07
FDT SWFBridge ActionPlugin の簡単な説明
package
{
import fdt.FdtTextEdit;
import swf.bridge.FdtEditorContext;
import swf.bridge.IFdtActionBridge;
import swf.plugin.ISwfActionPlugin;
import flash.display.Sprite;
import flash.utils.Dictionary;
@cellfusion
cellfusion / gist:3985724
Created October 31, 2012 07:57
Cinema4D Goz name reset script
import c4d
from c4d import documents
# C4D select Objects GoZ Data Reset
GoZ_CONTAINER_ID = 2000000
def main():
doc = documents.GetActiveDocument()
objs = doc.GetSelection()
@cellfusion
cellfusion / CinderProjectApp.cpp
Last active December 14, 2015 18:29
Cinder0.8.5 で Orientations 対応する方法
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class CinderProjectApp : public AppNative {
public:
void setup();
@cellfusion
cellfusion / gist:5604605
Created May 18, 2013 14:32
CoreData 使ってユニークキーもどきを NSManagedObject.valideateForInsert 内で判断してみた
- (BOOL)validateForInsert:(NSError **)error {
NSLog(@"validateForInsert:%@", self.id);
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Hoge"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K = %@", @"id", self.id];
[fetchRequest setPredicate:predicate];
NSArray *results = [self.managedObjectContext executeFetchRequest:fetchRequest error:nil];
if (results.count > 0) {
@cellfusion
cellfusion / gist:9777976
Created March 26, 2014 06:51
Unity でスクリーンショットを撮って画像を表示
// Screenshot を撮る
Application.CaptureScreenshot("screenshot.png");
// プラットフォームごとに保存位置変わる?
string path = "";
switch (Application.platform) {
case RuntimePlatform.IPhonePlayer:
path = Application.persistentDataPath + "/screenshot.png";
break;
case RuntimePlatform.Android:
@cellfusion
cellfusion / 0_reuse_code.js
Created May 22, 2014 01:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console