use like this

Mxml file

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
private function onCreationComplete():void
{
TestModel.getInstance().initialize();
}
]]>
</mx:Script>
<mx:TabNavigator horizontalAlign="right" bottom="10" top="10"
left="10" right="10">
<mx:Canvas label="Search" width="100%" height="100%" id="search">
<mx:Label x="130" y="136" text="{TestModel.getInstance().name}" 
id="testLabel"/>

</mx:Canvas>
</mx:TabNavigator>
</mx:Application>


TestModel.as

package
{
import com.adobe.cairngorm.model.ModelLocator;

[Bindable]
public class TestModel implements ModelLocator
{
public var name:String;
private static var modelLocator : TestModel;

public static function getInstance() : TestModel
{
if ( modelLocator == null )
modelLocator = new TestModel();

return modelLocator;
}

public function initialize():void
{
name = "Some text";
}
}
}









------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to