Skip to content

Instantly share code, notes, and snippets.

@joshtynjala
Last active June 13, 2017 17:11
Show Gist options
  • Save joshtynjala/522c0461ad121607bcf3 to your computer and use it in GitHub Desktop.
Save joshtynjala/522c0461ad121607bcf3 to your computer and use it in GitHub Desktop.
Feathers HelloWorld example ported to MXML
<?xml version="1.0" encoding="utf-8"?>
<f:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:f="library://ns.feathersui.com/mxml"
theme="feathers.themes.MetalWorksMobileTheme">
<f:layout>
<f:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</f:layout>
<f:Button id="button" label="Click Me"
triggered="button_triggeredHandler(event)"/>
<fx:Script>
<![CDATA[
import feathers.controls.Callout;
import feathers.controls.Label;
private function button_triggeredHandler(event:Event):void
{
var label:Label = new Label();
label.text = "Hi, I'm Feathers!\nHave a nice day.";
Callout.show(label, this.button);
}
]]>
</fx:Script>
</f:Application>
@SuganNaickerf
Copy link

Hi, I tried using in a mobile feathers project and I get the following error : "Could not resolve <f:layout> to a component implementation.", Any ideas? It works if it is a standard flex application.

@joshtynjala
Copy link
Author

joshtynjala commented Jun 5, 2017

Make sure the MXML namespace prefix matches on the layout property and the component where you're trying to pass in the layout. Notice how it's <f:Application> and <f:layout> with the f namespace prefix in my example code. If it were <ns:Application>, it would need to be <ns:layout>. The namespace prefix of a property must always match the namespace prefix of the component.

By the way, it appears that I don't get email notifications on Gists, so I didn't see your comment until now. Sorry for the late response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment