开发者

What's the best way to utilize static data in an AIR application?

I'm building my first AIR application after two years of building Flex applications with a SQL Server database, using ColdFusion CFCs and .NET as WebService interfaces.

I want to create an AIR application with static data and I'm trying to figure out the best way of doing this, and how to do this. I have several related pieces of data.

Should I store all the data in XML files and read it directly from there? Or should I use the built-in SQLite database? If I use the SQLite Database, is there anyway to have the data pre-populated with the application, or does it have to be built each time the application is loaded? If using the SQLite database, can someone point me to some help on how to do this?

I apologize if these questions are too basic, I'm just looking for ideas as I try to build m开发者_Python百科y first AIR application.


I agree with MysticEarth. And depending on what kind of data you have, how often it will change, how comfortable you are with xml parsing/generation vs. sql queries, you'll want to use whichever approach best suites your needs. For all I know it might be a combination of the two...

And for what it's worth, in my experience sqlite has some shortcomings and the e4x xml extension is pretty sweet (and fast)!

Good luck!

Edit:

Yes you can "embed" the xml in your app. It's not the most flexible implementation, but if that's what you want you can have it :)

It's as easy as:

var xml:XML = 
        <foo>
            <bar>text1</bar>
            <bar>text2</bar>
        </foo>;

Check out the following link: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜