snippets
Rotate iPhone video with mencoder
mencoder -vf rotate=1 -o OUTPUT.mp4 -oac pcm -ovc lavc INPUT.MOVabsolute positioning in flex - simple example
<mx:Canvas
xmlns:mx="http://www.adobe.com/2006/mxml"
autoLayout="false"
height="50">
<mx:HBox backgroundColor="0x000000" width="50" height="50"/>
<mx:Label text="SOME TEXT" />
</mx:Canvas>Drupal taxonomy snippet - get all terms for a vocabulary
I was unable to find this anywhere online, but it's a pretty basic one - get all terms for a vocabulary and create a list with their names...
<?php
/*
* Get all terms for a vocabulary
*
* @author Benjamin Lowenstein, Colingo Labs LLC
*/
// set vocabulary id #
$vid = 1;
$sql = "SELECT * FROM {term_data} WHERE vid = %d";
$result = db_query(db_rewrite_sql($sql), $vid);
$terms = array();
while ($data = db_fetch_object($result)){
$term = $data->name;
$terms[] = $term;
}
echo theme_item_list($terms);
?>My first red5 flex video recorder
So this is a bit cooler than adding two numbers together....
Here's my very first bare-bones Flex / red5 video recorder, and a few lessons I learned in creating it.
1) Red5 handles NetSteam's .publish() methods automagically. In other words, your java application does not have to do anything except extend ApplicationAdapter to let you use it from Flex to record video. In fact, if you don't want to tinker with java/red5 at all, you can just use a demo application like oflaDemo as your NetConnection hookup. So if you have red5 running out of the box and do:
SetTimeout in AS3
A quick snippet to do a setTimeout() in Actionscript 3:
import flash.events.TimerEvent;
import flash.utils.Timer;
var myTimer:Timer = new Timer(1000, 1); // delay 1 second, repeats once
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerHandler);
private function timerHandler(e:TimerEvent):void
{
//_root.log(root.options[int(option)].caption);
//_root.playPlaylist();
}