Skip to content

Instantly share code, notes, and snippets.

@benstucki
Forked from davidortinau/reflex_scoller.as
Created October 23, 2010 18:40
Show Gist options
  • Save benstucki/642543 to your computer and use it in GitHub Desktop.
Save benstucki/642543 to your computer and use it in GitHub Desktop.
package
{
import flash.display.Bitmap;
import flash.display.MovieClip;
import flash.display.Sprite;
import reflex.behaviors.TouchScrollBehavior;
import reflex.components.Scroller;
import reflex.containers.Application;
[SWF(backgroundColor="#FFFFFF", frameRate="31", width="1200", height="800")]
public class ReflexExamplesAS3 extends Application
{
[Embed(source="../bin/assets/images/475159790_7da9daa6d2_o.png")]
private var imgCls:Class;
private var scroller:Scroller;
public function ReflexExamplesAS3()
{
scroller = new Scroller();
scroller.width = 200;
scroller.height = 200;
scroller.x = 20;
scroller.content = [new imgCls() as Bitmap];
scroller.behaviors.addItem(new TouchScrollBehavior());
this.content = [scroller];
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<rx:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:rx="http://rx.reflex.io/2010"
xmlns:behaviors="reflex.behaviors.*" >
<rx:Scroller width="400" height="400">
<rx:behaviors>
<behaviors:TouchScrollBehavior />
</rx:behaviors>
<rx:BitmapImage source="http://farm3.static.flickr.com/2766/4474105201_af63f79a2d_b.jpg" />
</rx:Scroller>
</rx:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment