Flash
Gesture flash as3 multitouch multi touch
by MisterSaisho on Apr.19, 2011, under Flash
113 Comments more...Shared object info
by MisterSaisho on Mar.22, 2011, under Flash
http://www.techrepublic.com/article/create-powerful-flash-applications-with-shared-objects/5061241
http://mistersaisho.com/flash/sharedObject/sharedTest.html
PrintLoading 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++;
}
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();
}
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
PrintSUCCESS 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.
PrintDrag 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();
}
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});
}
}
}
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);
}
}
}
Android Links
by MisterSaisho on Nov.08, 2010, under Flash
http://www.flashlounge.net/workflow/2010/android-air-development-using-ant-adt-for-fdt-4/
http://blog.digitalbackcountry.com/2010/10/publishing-air-apps-to-the-android-market/
http://www.slideshare.net/v3ronique/using-air-for-mobile-development
http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-8000.html
http://insideria.com/2008/05/air-api-creating-tables-and-in.html
Print