Skip to content

Instantly share code, notes, and snippets.

View davidortinau's full-sized avatar
📱
making something amazing

David Ortinau davidortinau

📱
making something amazing
View GitHub Profile
package {
import reflex.containers.Application;
import reflex.behaviors.TouchScrollBehavior;
import reflex.components.Scroller;
import flash.display.Bitmap;
import flash.display.MovieClip;
/**
* @author David Ortinau <dave@davidortinau.com>
@davidortinau
davidortinau / TextArea in Scroller
Created November 25, 2010 00:07
scroller content with TextArea. TextArea touch can scroll the Scroller and not steal focus.
<s:Scroller width="100%" height="100%">
<s:VGroup width="100%" paddingTop="20" paddingLeft="20" paddingRight="20" paddingBottom="20" gap="20">
<s:Group width="100%">
<s:Rect width="100%" height="100%" radiusX="8" radiusY="8">
<s:fill>
<s:SolidColor color="#F1F0E6"/>
</s:fill>
</s:Rect>
<s:VGroup width="100%" paddingTop="20" paddingLeft="20" paddingRight="20" paddingBottom="20" gap="20">
@davidortinau
davidortinau / TextAreaHackaroundHome.mxml
Created November 25, 2010 03:21
Hero TextArea hack to detect tap vs scroll and set focus manually on TextArea
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="view1_creationCompleteHandler(event)"
title="TextArea Workaround">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
[Bindable]
@davidortinau
davidortinau / gist:770977
Created January 8, 2011 16:45
Dismiss the keyboard when the user clicks Search while using UISearchBar
- (void)viewDidLoad {
{
UIView * subView;
NSArray * subViews = [mySearchBar subviews];
// loop through search bar pieces to get to the text field so you can
// set the delegate and then resign first responder on it
for(subView in subViews)
{
if( [subView isKindOfClass:[UITextField class]] )
@davidortinau
davidortinau / gist:789047
Created January 21, 2011 00:49
LoaderMax Lazy Loading Strategy
// What I usually do is have an XML manifest that lists all of my assets as loaders for LoaderMax to handle
// For example:
<?xml version="1.0"?>
<config idletime="90000" launchPosition="right" webServiceURL="" scaleFactor="1">
<XMLLoader name="en" url="/assets/xml/content_en.xml" load="true" />
<XMLLoader name="es" url="/assets/xml/content_es.xml" load="false" />
<XMLLoader name="zh" url="/assets/xml/content_cn.xml" load="false" />
</config>
@davidortinau
davidortinau / gist:794524
Created January 25, 2011 04:44
My Rails3 Routing Issue - params are empty
# this is my route
match 'papers/:url_title' => 'papers#show', :as => :permalinkpaper
# this is the url being called
http://localhost:3000/papers/great-passion
# which properly matches to this controller#action for papers#show
def show
@paper = Paper.where(:url_title => params[:url_title]).first()
PaperHistory.add( current_user, @paper.id )
@davidortinau
davidortinau / gist:800303
Created January 28, 2011 14:18
AIR for Android Manfiest granting INTERNET permissions
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-configuration android:reqFiveWayNav="true"/>
<supports-screens android:normalScreens="true"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
<application android:enabled="true">
@davidortinau
davidortinau / gist:954462
Created May 3, 2011 23:31
Flex Embedded Font CSS
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face {
src: url("assets/fonts/HelveticaNeueLTStd-Bd.otf");
fontFamily: HelveticaNeueBold;
fontStyle: normal;
fontWeight: bold;
embedAsCFF:true;
@davidortinau
davidortinau / gist:954793
Created May 4, 2011 05:20
Spark Label with embedded font
<s:Label text="HelveticaNeueBold"
textAlign="left"
fontSize="12"
fontFamily="HelveticaNeueBold"
fontLookup="embeddedCFF"
color="#5d5c62"
>
<s:filters>
<s:DropShadowFilter blurX="0" blurY="0" distance="1" hideObject="false" color="#ffffff"
inner="false" strength="1" alpha="1" quality="2" knockout="false" angle="90"/>
@davidortinau
davidortinau / gist:998990
Created May 30, 2011 14:43
AS3 AIR Application w/ Swiz and NativeWindow
package {
// imports removed for brevity
import org.swizframework.core.BeanProvider;
import org.swizframework.core.ISwiz;
import org.swizframework.core.ISwizAware;
import org.swizframework.core.Swiz;
import org.swizframework.core.SwizConfig;
[SWF(width='1080', height='1920', backgroundColor='0xFFFFFF', frameRate='30')]