Skip to content

Instantly share code, notes, and snippets.

@Ondina
Ondina / ModularRouter.as
Last active December 20, 2015 13:19
ModuleConnectionConfigurator
package robotlegs.bender.extensions.modularity.impl
{
import flash.events.Event;
import flash.events.IEventDispatcher;
import flash.utils.Dictionary;
import robotlegs.bender.framework.impl.UID;
public class ModularRouter
{
private var _localDispatcher:IEventDispatcher;
@Ondina
Ondina / ViewManagerBasedExistenceWatcher
Created February 9, 2013 11:17
ViewManagerBasedExistenceWatcher bad hack
Context:
private var _parentContext:IContext;
public function set parentContext(value:IContext):void
{
_parentContext = value;
}
public function get parentContext():Icontext
{
public function loadStory(storyStub:StoryVO, recache:Boolean=false):StoryVO
{//Also bad
if (!storyStub.type)
populateEmptyStory(storyStub);
// Optionally force loading from disc and recaching
if (recache)
facade.removeProxy(storyStub.uid);
public function loadStory(storyStub:StoryVO, recache:Boolean=false):StoryVO
{
//Actually bad
if (!storyStub.type)
populateEmptyStory(storyStub);
// Optionally force loading from disc and recaching
if (recache)
facade.removeProxy(storyStub.uid);
var cacheProxy:IProxy;
package com.futurescale.sa.controller.command.story
{
import com.futurescale.sa.controller.constant.AppConstants;
import com.futurescale.sa.model.proxy.StoryProxy;
import com.futurescale.sa.model.vo.ChapterVO;
import com.futurescale.sa.model.vo.PartVO;
import com.futurescale.sa.model.vo.SceneVO;
import com.futurescale.sa.model.vo.StoryVO;
import com.futurescale.sa.view.context.SelectionContext;
public class EditStoryCommand extends SimpleCommand
{
private var chapter:ChapterVO;
private var part:PartVO;
private var scene:SceneVO;
override public function execute(note:INotification):void
{
// Get the story from the note body.
var story:StoryVO=StoryVO(note.getBody());
@Ondina
Ondina / SomeXML
Created November 3, 2011 13:28
SomeXML (ViewNavigatorApplication)
<!--SomeXML-->
<somexml>
<someitem>
<somename>SomeView</somename>
<someid>0</someid>
</someitem>
<someitem>
<somename>AnotherView</somename>
<someid>1</someid>
</someitem>
@Ondina
Ondina / NavigationModel
Created November 3, 2011 13:26
NavigationModel (ViewNavigatorApplication)
package com.robotlegs.demos.robotlegsincremental.models
{
import com.robotlegs.demos.robotlegsincremental.views.components.AnotherView;
import com.robotlegs.demos.robotlegsincremental.views.components.OtherView;
import com.robotlegs.demos.robotlegsincremental.views.components.SomeView;
public class NavigationModel
{
protected var _stackViews:Array=[SomeView, AnotherView, OtherView];
@Ondina
Ondina / NavigationCommand
Created November 3, 2011 13:24
NavigationCommand (ViewNavigatorApplication)
package com.robotlegs.demos.robotlegsincremental.controllers.commands.mappings
{
import com.robotlegs.demos.robotlegsincremental.controllers.events.NavigationEvent;
import com.robotlegs.demos.robotlegsincremental.controllers.events.SomeViewListEvent;
import com.robotlegs.demos.robotlegsincremental.models.NavigationModel;
import org.robotlegs.mvcs.Command;
/**
*
* @author [Ondina D. F.]
@Ondina
Ondina / NavigationEvent
Created November 3, 2011 13:23
NavigationEvent (ViewNavigatorApplication)
package com.robotlegs.demos.robotlegsincremental.controllers.events
{
import flash.events.Event;
/**
*
* @author [Ondina D. F.]
*
*/
public class NavigationEvent extends Event