MisterSaisho.com

Flash

Gesture flash as3 multitouch multi touch

by MisterSaisho on Apr.19, 2011, under Flash

http://gestureworks.com/documentation/

http://openexhibits.org/software

Print
113 Comments more...


Loading json data flash as3 twitter

by MisterSaisho on Mar.19, 2011, under Flash, Uncategorized

NEED THIS PACKATE* import com.adobe.serialization.json.JSON;

public function Twitter(_search:String=”san diego”)
{
loader = new BulkLoader();
loader.add(‘http://search.twitter.com/search.json?q=’+_search,{id:’json’});
loader.addEventListener(BulkLoader.COMPLETE, onDataComplete);
loader.start();
}

private function onDataComplete(event : Event) : void
{
var c:int = 0;
twitterData = JSON.decode(loader.getContent(‘json’));

for each(var obj:Object in twitterData.results)
{
tf = new TextField();
tf.width = stage.stageWidth;
tf.multiline = true;
tf.height = 35;
tf.border = true;
tf.y = tf.height*c;
tf.wordWrap = true;
tf.text = obj.text;
addChild(tf);

c++;
}

Print
191 Comments more...

very simple print with as3

by MisterSaisho on Feb.15, 2011, under Flash

var myPrint:PrintJob = new PrintJob();
if(myPrint.start())
{
myPrint.addPage(thinToPrint);//movie clip
myPrint.send();
}

Print
Leave a Comment more...

conditional vars

by MisterSaisho on Dec.13, 2010, under Flash, Uncategorized, Web Dev

var test:String = (5+5==10)?”true”:”false”;
trace(test);
test=(5+5==11)?”true”:”false”;
trace(test);

Will echo

true

false

Print
Leave a Comment more...

SUCCESS NOTE!!! Packaging air with ANT in FDT Fix.

by MisterSaisho on Dec.11, 2010, under Flash

I was having an error when running the ‘package air application’ option from the ant build.  The error was that when my app would load, it would be completely blank. The fix, to the problem was:

1. remove the depends property(depends=”Air-2…”>) from the ‘package air application’ ant option.

2. put the swf that the fdt compiler creates in the build folder.

3. run the ‘package air application’ task

There you go.

Print
Leave a Comment more...

Drag air as3

by MisterSaisho on Dec.11, 2010, under Flash

http://www.adobe.com/devnet/air/flex/quickstart/articles/creating_transparent_window.html

listen for MouseDown event. in the handler write       “stage.nativeWindow.startMove()”

public function ViewNotesMain()
{

this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

}

private function mouseDownHandler(event : MouseEvent) : void
{
stage.nativeWindow.startMove();
}

Print
Leave a Comment more...

Reverse geocode info

by MisterSaisho on Dec.11, 2010, under Flash

**you need a map on the stage before you can add a new ClientGeocoder!!!!

user reverseGeocode() method from ClientGeocoder to get address from lat/lng

package
{
import caurina.transitions.Tweener;

import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.services.ClientGeocoder;
import com.google.maps.services.GeocodingEvent;

import flash.display.MovieClip;
import flash.events.Event;
import flash.geom.Point;

/**
* @author Doug
*/
public class GoogleMap extends MovieClip
{
private static const KEY:String = “ABQIAAAA3sm4v7SDLnIEaxuqSgOYcWEl7OvhS6aeZwPb8g9HYyAy56NaXtgRxy3Q”;
public var map : Map;
//private var gClient : ClientGeocoder;

public function GoogleMap()
{
addEventListener(Event.ADDED_TO_STAGE, setUp);
}

private function setUp(event:Event):void
{

removeEventListener(Event.ADDED_TO_STAGE,setUp);
var p:Point=new Point(stage.stageWidth, stage.stageHeight);
map = new Map();
map.key = KEY;
map.setSize(p);
map.sensor=”false”;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
addChild(map);
map.alpha = 0;
//fadeMapIn();
}

private function onMapReady(event : MapEvent) : void
{
var gClient:ClientGeocoder = new ClientGeocoder();
var lat:LatLng = new LatLng(32.788585,-117.10919);
gClient.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, onGeoSuccess);
gClient.reverseGeocode(lat);

map.removeEventListener(MapEvent.MAP_READY, onMapReady);
dispatchEvent(new Event(“GoogleMapLoaded”,true,true));
}
private function onGeoSuccess(event : GeocodingEvent) : void
{
trace(event.response.placemarks[0]);
}
public function fadeMapIn():void
{
Tweener.addTween(map,{alpha:1,time:1});
}
}
}

Print
Leave a Comment more...

video info as3 flash

by MisterSaisho on Nov.17, 2010, under Flash

package
{
import flash.display.MovieClip;
import flash.events.NetStatusEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;

/**
* @author Doug
*/
public class vidTest extends MovieClip
{
private var vid : Video;
private var nc : NetConnection;
private var metao : Object;
private var ns : NetStream;

public function vidTest()
{
vid = new Video(500,500);
addChild(vid);

nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);

metao = new Object();
metao.onMetaData = function(meta:Object)
{
trace(meta.duration+” is the duration”);
}
ns.client = metao;
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
vid.attachNetStream(ns);
ns.play(“http://mistersaisho.com/a/Part3.flv”);
ns.seek(10);

}

private function onNetStatus(event : NetStatusEvent) : void
{
trace(event.info.code);
}
}
}

Print
Leave a 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!