First Step with Fever

Welcome to the Fever dev blog !

With some articles, I will try to explain you how to use the Fever and FvAsWing frameworks in for your ActionScript developement.
Let's go with the first step : How to initialize Fever ?

 

Fever need an intialization process to work well.
This process has 3 main goals :

  • Initializes default framework properties
  • Declares proper Context to use
  • Starts the Configuration engine

Thus, for a good use of all Fever classes and API, you need to initialize properly the framework at application starting.

All backstage processes are executed automatically by the framework, we just need to call the Fever.run() method to start a correct Fever application.
This is a correct starting point :

class Main
{

    /**
     * MTASC Access point.
     */
    public static function main() : Void 
    {
        Fever.run( new  MyDemo() ); 
    }
   
}

As you can see it's really simple.
Fever.run() method wait for 3 arguments ( only the first must be set ) :

  • Application main class instance
  • Context to use in application ( default is BrowserContext )
  • Application use the Configuration engine ( default is false )
So a complete call could be :
class Main
{

    /**
     * MTASC Access point.
     */
    public static function main() : Void 
    {
        FeverDebug.isOn = true;
        Fever.run( new  MyDemo(), HaxeContext.getInstance(), true );   
    }
   
}

Which means

  • My real main application instance is a MyDemo class instance
  • My application will be embeded in a Screenweaver HX container, so I use the Haxe context
  • A configuration file exist, Configuration engine must load it

Ok let's take a look now at a complete MTASC call and a basic application class.

Main.as
import fever.app.context.haxe.HaxeContext;
import fever.demo.MyDemo;
import fever.Fever;
import fever.log.FeverDebug;

class Main
{
    public static function main() : Void 
    {
        // Enables debugging
        FeverDebug.isOn = true;
       
        // Starts initialization
        Fever.run( new MyDemo(), HaxeContext.getInstance(), true );
    }
}

MyDemo.as
import fever.FeverApplication;
import fever.log.FeverDebug;

class fever.demo.MyDemo implements FeverApplication
{
    /**
     * Constructor.
     */
    public function MyDemo()
    {
       
    }   
   
    /**
     * Calls when Fever is ready and configuration is loaded.
     */
    public function run() : Void
    {
        FeverDebug.INFO( "application ready !" );
    }

}

Our application is ready and configuration loaded and parsed when the FeverApplication.run() method is called.
You can start your application code here.

That's it ! your application is ready, Fever is correctly initialized, we can play now...

Cheers,
Romain Ecarnot.

Related Blog Entries

Comments
darmowe tapety's Gravatar It is good that someone writes articles which really matters something. Thank you for this article, it's full of knowledge which is hard to find in tons of rubbish in our famous world wide web.

Regards and good luck!
<a href="http://www.epulpit.pl" title="darmowe tapety">tapety na pulpit komputera</a>
# Posted By darmowe tapety | 12/7/07 10:57 PM
wow's Gravatar <a href="http://www.feelingame.com/">wow power leveling</a>
<a href="http://www.feelingame.com">wow powerleveling</a>
<a href="http://www.feelingame.com/wow-power-leveling.asp">wow power leveling</a>
<a href="http://www.feelingame.com/wow-gold.asp">wow gold</a>
<a href="http://www.feelingame.com/wow-items.asp">wow items</a>
<a href="http://www.feelingame.com/about-us.asp" target="_blank">http://www.feelingame.com/about-us.asp">feelingame.com</a>
<a href="http://www.feelingame.com/wow-tips.asp" target="_blank">http://www.feelingame.com/wow-tips.asp">wow tips</a>
<a href="http://www.feelingame.com/most-valuable.asp" target="_blank">http://www.feelingame.com/most-valuable.asp">Most Valuable WOW Power Leveling Service</a>
<a href="http://www.feelingame.com/faq.asp">wow power leveling faq</a>
<a href="http://www.cheap-wow-power-leveling.com">cheap wow power leveling</a>
<a href="http://www.cheap-wow-power-leveling.com/">wow power leveling</a>
<a href="http://www.cheap-wow-power-leveling.com/">wow powerleveling</a>
<a href="http://www.cheap-wow-power-leveling.com/">wow power lvl</a>
# Posted By wow | 12/10/07 1:09 AM
??'s Gravatar ????<a href="http://www.ewkej.com">??</a>??????<a href="http://www.xunte.com">???</a>???<a href="http://www.84587422.com/forum-2-1.html">????</a>???<a href="http://www.ewkej.com/suliaotuopan.htm">????</a>???<a href="http://hi.baidu.com/sltuopan">????</a>???<a href="http://www.sltuopan.obm.cn">????</a>???<a href="http://hi.baidu.com/cangclong">???</a>????<a href="http://www.ewkej.com/cangchulong.htm">???</a>???<a href="http://blog.sina.com.cn/s/reader_4cee8eb90100091b....">???</a>???<a href="http://merryljt.blogcn.com">???</a>?
# Posted By ?? | 4/6/08 10:21 PM
yy's Gravatar http://www.j-gala.co.jp/
http://www.beatitudevfx.com/
http://fuzokudx.com/deli/?
http://fuzokudx.com/soap/?
http://www.kajimitsuo.com/
http://www.omakasetai.com
http://www.cleat.bz
http://man3.jp
http://loan.saisoncard.co.jp
http://www.mvn.jp
http://www.2dou3.com
http://www.tealla.com
http://www.valer.jp
http://www.wayzup.com
http://www.koushouki.com
http://www.bmbeauty.co.jp/
http://pc.m-friend.jp/index1.asp
http://www.rs-group.jp/mb/index.html
http://movamova.net/?n=deco_top
http://digi-comi.net/
http://ihinseiri.jp
http://www.soushow.co.jp/car/
http://www.daishin.biz/DAN/DAN.html
http://www.kaigo-sora.co.jp
http://www.kaisha-seturitsu.com
http://www.sanyukk.com
http://kango.bunnabi.jp/m/
http://www.propaganda-web.com/design/gcom285/mens....
http://www.refonavi.com/
http://www.hide-clinic.com/
http://www.ec-engine.jp
http://lei.ne.jp/h/w-dress
http://lei.ne.jp/h
http://www.legal-agent.jp
http://www.za-hitonotsuma.com
http://wikifipau.org/
http://www.good-stay.net
http://www.monthly-urban.com
http://www.koukokunavi.jp
http://www.gaikaex.net/
http://www.dentouin.or.jp/
http://drprojet.com/
http://www.adultshop.co.jp/
http://zensyoji.or.jp/
http://www.chizai-job.com/" target="_blank">http://www.chizai-job.com/
http://www.daichou-koumon.com/
http://www.legal-lab.com/
http://www7b.biglobe.ne.jp/~houjyu/
http://www.jinmyouji-nokotsudo.jp/
http://www.giftbank.co.jp/
http://www.sweepdesign.jp/wakaresase/
http://www.30upclub.com/items/muscle2.html
http://www.30upclub.com/items/shape_getia.html
http://www.miraiclub.jp/
http://www.adire.jp/cashing/index.html
http://www.le-poisson-japan.com/
http://www.icb-finishing.co.jp/
http://www.nipponsoft.co.jp/recovery
http://www.max.ac.jp/
http://www.chizai-job.com
http://www.green-f.biz
http://www.icb-finishing.co.jp/image_consult/index.html" target="_blank">http://www.icb-finishing.co.jp/image_consult/index...
http://www.rs-holdings.net/
http://www.deli-spot.net
# Posted By yy | 5/7/08 12:26 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006.