Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Best Practices

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-26-2008, 12:40 PM   #1
unkulunkulu
Registered User
 
Join Date: Oct 2004
Location: Helsinki / Finland
Posts: 42
Default MVC: Where do I keep my graphical assets?

Hello everyone,

I'm coding an application that uses MVC architecture, but I can't figure out where I should keep my graphical assets. I have a single SWF file with several library items with Linkage identifiers and I load the SWF file at the very beginning of the app.

After I get the reference to the swf (MovieClip), I pass it to the main Application, which passes it along to View, which passes it to whichever of it's descendants need it. That's quite a lot of passing along...

I'm wondering if it would be better to keep it in a single Singleton class, so I could reference it from wherever I need it. Has anyone used another approach to this.

Any help is greatly appreciated.
unkulunkulu is offline   Reply With Quote
Old 08-26-2008, 08:15 PM   #2
swivelmaster
Tasty donuts.
 
Join Date: Aug 2008
Location: Berkeley, CA
Posts: 24
Send a message via AIM to swivelmaster Send a message via Yahoo to swivelmaster Send a message via Skype™ to swivelmaster
Default

Check this out, I found it very helpful:

http://www.rogue-development.com/blo...ution-modules/

It seems like a pain in the butt, but the module/interface method has worked really well for me. It adds some overhead for setup for each extra asset you'd like to reference, but it means your singletons work great and you rarely need to rebuild your asset module.
swivelmaster is offline   Reply With Quote
Old 09-02-2008, 01:06 PM   #3
unkulunkulu
Registered User
 
Join Date: Oct 2004
Location: Helsinki / Finland
Posts: 42
Default

Thanks!

I concluded the Singleton approach was the most versatile as well. I did it a bit differently from the examples you gave though. I ended up not embedding the graphics, but instead making a separate swf called graphics.swf, which contains all the graphical assets.

What I have is a separate GraphicManager singleton class a lot like what Marc has in the link you sent. I initialize it in Main class and then just call the assets when needed.
unkulunkulu is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading assets (symbols/bmps etc...) from seperate SWF at Runtime stegs_1 ActionScript 2.0 1 11-16-2008 04:29 AM
shared library assets on web fail brainwater ActionScript 2.0 0 07-09-2005 04:25 AM
Loading library assets FFighter ActionScript 2.0 1 06-18-2005 09:34 PM
ComboBox doesn't use ComboBox Assets fx2ooo Components 6 04-26-2005 10:12 AM
Importing assets from Fireworks to Flash Mathieu_BSL Other Flash General Questions 2 04-18-2004 11:41 AM


All times are GMT. The time now is 04:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.