Skip to content
Enables using Parsley for Starling projects
ActionScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
libs
src/org/spicefactory/parsley
.gitignore
README.md
parsley-starling.iml

README.md

parsley-starling

Enables Parsley for Starling-based projects

NOTE: This library requires modified version of Parsley from rozd-spicefactory/parsley-core

Implementation Notes

  • Requires modified version of Parsley with less dependency on Flash prebuilt classes such as DisplayObject and Event. it could be founf here rozd-spicefactory/parsley-core
  • Configuration process is triggered by Event.ADDED event, instead of Event.ADDED_TO_STAGE as in standard Flash implementation of Parsley. It is due to Starling dispatches Event.ADDED_TO_STAGE without bubbles flag.

Usage

For explicit wiring

During configuration add StarlingViewManagerDecorator ViewManager decorator and pass Starling istance to it:

ContextBuilder.newSetup()
    .services()
        .viewManager()
            .addDecorator(StarlingViewManagerDecorator, _starling)
    .newBuilder()
        .config(XmlConfig.forFile("config.xml"))
    .build();

Use StarlingConfigure class to add specified View into Parsley's Context:

import feathers.controls.Screen
public class NewsView extends Screen
{
    public function NewsView()
    {
        super();

        StarlingConfigure.view(this).execute();
    }
}

For automatic wiring

Enable Parsley's autowiring feature and change default ViewAutowireFilter implementation to StarlingViewAutowireFilter:

BootstrapDefaults.config.viewSettings.autowireComponents = true;
BootstrapDefaults.config.viewSettings.autowireFilter = new StarlingViewAutowireFilter();

Configure Parsley with Starling support:

ContextBuilder.newSetup()
    .services()
        .viewManager()
            .addDecorator(StarlingViewManagerDecorator, _starling)
    .newBuilder()
        .config(XmlConfig.forFile("config.xml"))
    .build();

In your config.xml define some View:

<?xml version="1.0"?>
<objects
        xmlns="http://www.spicefactory.org/parsley"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.spicefactory.org/parsley
        http://www.spicefactory.org/parsley/schema/3.0/parsley-core.xsd"
        >

    <view type="com.example.presentation.MessagesView">

    </view>

</objects>
You can’t perform that action at this time.