Grabbing movieclips from a database

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

IcarusII
Posts: 10
Joined: 18 Aug 2008, 23:26

Grabbing movieclips from a database

Postby IcarusII » 26 Aug 2008, 03:04

Hi, i was wondering how you would store and access single movieclips from a database. I want to bring certain movieclips in based on what the user has specified, but im not exactly sure how to do this.

Im very new to using databases, so please be nice :P
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Aug 2008, 12:29

Problem is ... there's no way you can store a movieclip outside of a SWF file, so this is not possible.
You might want to store an entire SWF file as BLOB in the database ... but you must have your own very good reasons for doing so.
Not that is a bad thing, but you should aware of what you are doing and why.
Lapo
--
gotoAndPlay()
...addicted to flash games
orthiac
Posts: 115
Joined: 25 Jun 2008, 10:03
Location: Massachusetts, USA

Postby orthiac » 26 Aug 2008, 12:36

Another alternative would be to store the name of the clip in the database. Then use it in a load routine. You would only need to make sure your class linkage is set in the original swf.
This would also cut down on the db access time.

- Mike
IcarusII
Posts: 10
Joined: 18 Aug 2008, 23:26

Postby IcarusII » 26 Aug 2008, 18:45

Im worried about load times for my main app so i would like to keep a lot of the art outside and only access it when i need to. Although now that i think if it, im building an app that has multiple users and they will all have different artwork on them so i would probably need to store the art in the main app anyways.

*sigh*

Can you please explain what a BLOB is. I thought of storing a SWF with all the artwork in the database before, but im also not sure how i would go about doing that.
orthiac
Posts: 115
Joined: 25 Jun 2008, 10:03
Location: Massachusetts, USA

Postby orthiac » 26 Aug 2008, 19:14

To keep the main app thinner, what I do is create separate swf's that I load into the main app. Those would contain the "art" you are requesting.
That way the extra load is on a "demand only" basis.

- Mike
IcarusII
Posts: 10
Joined: 18 Aug 2008, 23:26

Postby IcarusII » 26 Aug 2008, 20:20

Alright, i'll give that a shot.

Thanks for the help! :)
Menser
Posts: 111
Joined: 13 Nov 2007, 18:32

Postby Menser » 28 Aug 2008, 16:30

Hey-


SOmething to consider about loading stuff "on demand".

While you are cuting own on initial size requirments of the file, and initial load time, you are basically just putting off loading the content. In doing so, you need to take into account that when you goto load your assests later, you will have to take into account LOTS of things.

1) Do you stll have a connection to the internet at this point? You can never be sure, my girlfriend loads up games on her laptop before she hops in the car for a long ride then plays them on the road with no connection. Games that require to load assests later dont work for her. In addition if you will ever release a downloaded version of your game, it will also require an internet connection to play.

2) It takes time, and memory to load the assets whenever you do it. Putting it off just means your doing it later. Which means if a particular part of your game depends on the assests you have to wait for it to load. Waiting for things to load in the middle of a game is WAY WAY more annoying then waiting for an extra bit of time in the begining.


So, unless your loading RETARDED amounts of assets, and people will only use a small subset at any given time, i wouldnt waste my time trying to "thin" the client down.

_-Menser-_

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 74 guests