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: Can view components load images?  (Read 7489 times)
hesten
Sr. Member
****
Posts: 52


View Profile Email
« on: July 12, 2009, 02:03:53 »

Hi

This is probably a stupid question, but is a view component allowed to load the external images it needs (using Loader in Flash)?

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


View Profile WWW Email
« Reply #1 on: July 12, 2009, 05:47:31 »

When I only have to load a unique image I fully load it in a mediator. When it cames to a list of images, I prefer to use a proxy. But sometimes, when the loading is too dependent of the view state (scrolling, complex user interaction), I suppose that to manage all the loading in a well designed mediator is sufficient.
Logged
Sammi
Courseware Beta
Full Member
***
Posts: 45


View Profile Email
« Reply #2 on: July 12, 2009, 06:20:24 »

It is perfectly fine to have the views load external images.

Most of the time my views are responsible for loading the images it requires, unless the images are required at startup.  Then my InitialAssetsProxy loads them and the view's mediator passes them to the view.

Someone made a simple BulkLoaderProxy recently and shared it here on the forums and I might use that in upcoming projects.

Best,
Sammi
Logged
hesten
Sr. Member
****
Posts: 52


View Profile Email
« Reply #3 on: July 12, 2009, 10:02:13 »

Tek > Why do you load it in the mediator, I was under the impression that a mediator should do nothing more than mediate?

Sammi > I was thinking about a gallery where a list of images is loaded when the callery is requested. My own perspective is the same as yours, that the view component should be able to load the images it needs - the list from which it gathers information on which images to load on the other hand I have in a Proxy.
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #4 on: July 12, 2009, 10:29:09 »

hesten> I mean to use the mediator to initiate loading, receive complete event and add the image to the display list in the mediated view. You don't need this when the view is able by itself to load the image (when an image component is used in Flex or when you have your own component).
Logged
hesten
Sr. Member
****
Posts: 52


View Profile Email
« Reply #5 on: July 12, 2009, 11:58:09 »

Oh ok, I get what you're saying now :)
Logged
Pages: [1]
Print