Skip to content

Instantly share code, notes, and snippets.

View claus's full-sized avatar
🎅

Claus Wahlers claus

🎅
View GitHub Profile
//
// Shape1View.h
// Shape1View
//
// Created by Claus Wahlers on Mon Sep 14 2009.
// Copyright 2009 côdeazur brasil. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// Shape1View.m
// Shape1View
//
// Created by Claus Wahlers on Mon Sep 14 2009.
// Copyright 2009 côdeazur brasil. All rights reserved.
//
#import "Shape1View.h"
// Author: Claus Wahlers
// License: Public Domain
// Dependencies:
// as3commons-bytecode-1.0-RC1.swc
// as3commons-lang-0.3.2.swc
// as3commons-logging-2.0.swc
// as3commons-reflect-1.3.4.swc
// as3swf.swc
// MinimalComps_0_9_9.swc
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import com.codeazur.as3redis.*;
// packages, classes and contructors never cuddle
package
{
public class MyClass
{
public function MyClass()
{
// code
}
}
Frames:
[0] Start: 0, Length: 11
Depth: 1, CharacterId: 1, PlacedAtIndex: 4
Depth: 2, CharacterId: 3, PlacedAtIndex: 7
[1] Start: 11, Length: 4
Depth: 1, CharacterId: 4, PlacedAtIndex: 12
Depth: 2, CharacterId: 3, PlacedAtIndex: 7, ModifiedAtIndex: 13
[2] Start: 15, Length: 3
Depth: 2, CharacterId: 3, PlacedAtIndex: 7, ModifiedAtIndex: 16
[3] Start: 18, Length: 2
Frames:
[0] Start: 0, Length: 11
Depth: 1, CharacterId: 1, PlacedAtIndex: 4
Depth: 2, CharacterId: 3, PlacedAtIndex: 7
[1] Start: 11, Length: 4
Depth: 1, CharacterId: 4, PlacedAtIndex: 12
Depth: 2, CharacterId: 3, PlacedAtIndex: 7, ModifiedAtIndex: 13
[2] Start: 15, Length: 3
Depth: 2, CharacterId: 3, PlacedAtIndex: 7, ModifiedAtIndex: 16
[3] Start: 18, Length: 2
<s:Graphic xmlns:s="library://ns.adobe.com/flex/spark">
<s:Group>
<s:Path data="M165 165 L40 165 40 40 165 40 165 165">
<s:fill>
<s:RadialGradient focalPointRatio="0.0078125">
<s:matrix>
<s:Matrix tx="101" ty="148" a="0" b="200" c="-125.125" d="0"/>
</s:matrix>
<s:GradientEntry ratio="0" color="#0000FF"/>
<s:GradientEntry ratio="1"/>
// Parse the SWF contained in ByteArray ba
var swf:SWF = new SWF(ba);
// Grab a DefineShape tag from the internal dictionary
// We assume here that character ID 1 represents a shape tag
var shape:TagDefineShape = swf.getTagByCharacterId(1) as TagDefineShape;
// Export the shape to FXG
var doc:FXGShapeExporter = new FXGShapeExporter(swf);
shape.export(doc);
// Dump the generated FXG
trace(doc.fxg.toXMLString());
<?xml version="1.0" encoding="utf-8"?>
<!-- Convert HTML to XML and use E4X to access DOM (AIR required) -->
<s:WindowedApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[