views:

90

answers:

2

I am creating a flash object that does some heavy image lifting. What I am looking to do is load many flash objects onto the same page to take an image, modify it, and display it within the flash object.

The problem I am running into is that when I try to add 100 flex objects to the page, the browser freezes as it tries to re-load/initialize each instance. Once they are all loaded, the processing of the images goes by quick.

Does anyone know how to duplicate the flash piece without having to reload everything?

Another thought of mine would be to load the image into one flex object, and have that one modify the image tags using MHTML/data URI. Any thoughts?

A: 

You can't, Flex has to initialize, and that's a horrible horrible idea.

Flash is extremely CPU intensive, Flex doubly so since the interface itself uses a lot of power from the CPU to draw its interface effects.

Do whatever you need to, but don't initialize 100 Flex SWF's unless you want angry users.

Jasconius
I obviously know that. Which is why I was asking here. I don't want to initialize more than one flash object, but you provide no alternative, and certainly no answer to this question...
Daniel
"Does anyone know how to duplicate the flash piece without having to reload everything?"You asked that. I told you. You can't do it. I don't see the problem.Can you even explain why you are using 100 Flex SWF's instead of just loading 100 images into the same SWF?
Jasconius
That was one alternative I had thought of, which I might end up having to do. I want to display them in a list view, but the list view will be HTML and people will be able to edit the list, so I did not want to have to deal with resizing the flex object and editing the images within...
Daniel
You don't resize the flex object. You create a scrollable list within the Flex stage itself.
Jasconius
Well, most of the page is HTML, so I don't want to have the Flex object scroll within the html page... Anyways, I found a new way to do it...
Daniel
A: 

The answer I came up with is using the data URI scheme. I send the image to a single flash object, have it run the pixel bender scripts and then output a Base64 image string to the data URI on the image tags.

For IE, which does not support the scheme, I will output the string to a php script that will return the decoded image. The reason I am doing so much work for this is because Pixel Bender is powerful and allows me to pass a lot of the processing to the client side. Also, in testing, applying all image manipulations using pixel bender is exponentially faster than doing it in PHP/GraphicsMagick.

Daniel