PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: WillyCornbread on April 19, 2010, 07:18:40



Title: Should a view component retrieve it's own assets?
Post by: WillyCornbread 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


Title: Re: Should a view component retrieve it's own assets?
Post by: Tekool 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...


Title: Re: Should a view component retrieve it's own assets?
Post by: WillyCornbread 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


Title: Re: Should a view component retrieve it's own assets?
Post by: puremvc 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>


Title: Re: Should a view component retrieve it's own assets?
Post by: WillyCornbread 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