MisterSaisho.com

Archive for October, 2011

Rotate display object from center point

by MisterSaisho on Oct.28, 2011, under Uncategorized

package com.DougsRotationTest
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Matrix;
import flash.geom.Point;
/**
* @author arthuroliveira
*/
public class TestRotation extends Sprite
{
private var box : DisplayObject;
private var point : Point;
public function TestRotation()
{
box = new Box();
box.addEventListener(MouseEvent.CLICK, rotate);
addChild(box);
point = new Point(box.x+box.width/2, box.y+box.height/2 );
}
private function rotate(event : MouseEvent) : void
{
var m:Matrix = box.transform.matrix;
m.tx -= point.x;
m.ty -= point.y;
m.rotate(45*(Math.PI/180));
m.tx += point.x;
m.ty += point.y;
box.transform.matrix = m;
}
}
}
import flash.display.Sprite;
class Box extends Sprite
{
public function Box():void
{
graphics.beginFill(0xff0000, 1);
graphics.drawRect(0, 0, 100, 100);
graphics.endFill();
}
}

package com.DougsRotationTest{ import flash.display.DisplayObject; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Matrix; import flash.geom.Point;
/** * @author arthuroliveira */ public class TestRotation extends Sprite { private var box : DisplayObject; private var point : Point; public function TestRotation() { box = new Box(); box.addEventListener(MouseEvent.CLICK, rotate); addChild(box); point = new Point(box.x+box.width/2, box.y+box.height/2 ); }
private function rotate(event : MouseEvent) : void { var m:Matrix = box.transform.matrix; m.tx -= point.x; m.ty -= point.y; m.rotate(45*(Math.PI/180)); m.tx += point.x; m.ty += point.y; box.transform.matrix = m; } }}import flash.display.Sprite;class Box extends Sprite{ public function Box():void { graphics.beginFill(0xff0000, 1); graphics.drawRect(0, 0, 100, 100); graphics.endFill(); }}

Print
1 Comment more...


Make phone call from phone with as3

by MisterSaisho on Oct.28, 2011, under Uncategorized

navigateToURL(new URLRequest(tel:555555555));

Print
Leave a Comment more...


Captive runtime with adobe air for FDT

by MisterSaisho on Oct.18, 2011, under Uncategorized

In Ant build, set -target to apk-captive-runtime

Default is one of the following: apk / apk-debug / apk-emulator

in debug configurations, set swf version to 13:

-swf-version=13

Application Descriptor changes:

change namespace to- 3.0

example:

<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?><application xmlns=”http://ns.adobe.com/air/application/3.0″>

make sure to have air 3 overlay onto flex sdk

Print
1 Comment more...





Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!