Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Should a view component retrieve it's own assets?  (Read 7764 times)
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« on: April 19, 2010, 07:18:40 »

As the subject suggests, I have some view components that need visual assets for rendering - is it acceptable for these to do the actual loading of these assets themselves based on a value object of url's passed in?

Thanks in advance -

b
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #1 on: April 19, 2010, 09:57:35 »

If the visual assets don't introduce any new behavior nor imply changes out of the context of the view imho there is no problem with it. This is even more right if those visual assets are images, raw animations, text etc...
Logged
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« Reply #2 on: April 19, 2010, 10:51:20 »

Thanks for the advice, the assets I'm referring to are indeed images that are strictly applicable to only the view component. So I pass in a list of url's, or a url and have the view component both get them and place them - then custom events handle the rest to inform the mediator what's going on.

b
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: April 19, 2010, 11:28:26 »

Sure you can do this. The image tag in Flex is just a loader anyway.

Involve PureMVC in the loading of images only when it makes sense to. Like, for instance, if you're loading a bunch of images while a splash screen is shown and then you only show the view with the images when they're all done loading.

-=Cliff>
Logged
WillyCornbread
Jr. Member
**
Posts: 11


View Profile Email
« Reply #4 on: April 20, 2010, 09:01:40 »

Thanks for the advice, I feel like I'm finally getting up to speed on the framework...

b
Logged
Pages: [1]
Print