Skip to content

Instantly share code, notes, and snippets.

View odoe's full-sized avatar
👽
It's full of stars

Rene Rubalcava odoe

👽
It's full of stars
View GitHub Profile
package org.lacsd.components {
import com.esri.ags.Map;
import com.esri.ags.events.MapEvent;
import com.esri.ags.layers.Layer;
import flash.events.Event;
import mx.collections.ArrayCollection;
import mx.logging.ILogger;
package net.odoe.components {
import com.esri.ags.Map;
import mx.controls.Image;
// New logo looks cool, but position changed
// slightly from previous versions and now it's in my way.
// Extend the Map object to tweak it a bit
public class MyMap extends Map {
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoDrawBackground="true">
<fx:Metadata>
[Event(name="visibleLayerID", type="org.lacsd.events.LayerInfoDetailsEvent")]
</fx:Metadata>
<fx:Script>
@odoe
odoe / IteratorUtil.as
Created November 18, 2010 17:56
Actionscript 3 implementation of Duff's Device. Seems to work well.
package {
public class IteratorUtil {
public static function duffDeviceOptimized(ar:Array, process:Function):void {
var x:int = ar.length;
if (x > 0) {
var t:int = 0;
var n:int = x % 8;
while (n--) {
process(ar[t++]);
@odoe
odoe / MagnifyWindow.as
Created December 23, 2010 14:38
Component that will Magnify a source ESRI Map.
package org.lacsd.sf.view.components {
import com.esri.ags.Map;
import com.esri.ags.events.MapEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
import flash.events.Event;
import mx.collections.ArrayCollection;
import mx.logging.ILogger;
@odoe
odoe / MagnifyPopUpWindow.as
Created December 23, 2010 14:40
TitleWindow that holds MagnifyWindow.as
package org.lacsd.sf.view.components {
import spark.components.TitleWindow;
import spark.events.TitleWindowBoundsEvent;
public class MagnifyPopUpWindow extends TitleWindow {
public function MagnifyPopUpWindow() {
super();
this.addEventListener(TitleWindowBoundsEvent.WINDOW_MOVING, onWindowMove_handler, false, 0, true);
this.addEventListener(TitleWindowBoundsEvent.WINDOW_MOVE_END, onWindowMove_handler, false, 0, true);
@odoe
odoe / CollapseContainer.as
Created January 10, 2011 22:52
A skinnable container component for Flex 4, used with ESRI Map.
package org.lacsd.sf.view.components
{
import com.esri.ags.Map;
import flash.events.Event;
import mx.states.State;
import spark.components.SkinnableContainer;
@odoe
odoe / CollapseContainerSkin.mxml
Created January 10, 2011 22:55
Skin for CollapseContainer.as
<?xml version="1.0" encoding="utf-8"?>
<!--
ADOBE SYSTEMS INCORPORATED
Copyright 2008 Adobe Systems Incorporated
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file
in accordance with the terms of the license agreement accompanying it.
@odoe
odoe / PopUpWindow.as
Created January 24, 2011 15:14
TitleWindow designed to not be dragged outside Flex Application Area.
package net.odoe.components
{
import flash.events.Event;
import mx.core.FlexGlobals;
import mx.events.CloseEvent;
import mx.events.FlexEvent;
import mx.logging.ILogger;
import mx.managers.PopUpManager;
@odoe
odoe / MyComp.as
Created January 27, 2011 19:39
Simple example of using NativeMappedSignal in a Flex Component
package net.odoe.nmsExample.components
{
import flash.events.MouseEvent;
import org.osflash.signals.natives.NativeMappedSignal;
import spark.components.Button;
import spark.components.TextInput;
import spark.components.supportClasses.SkinnableComponent;
public class MyComp extends SkinnableComponent