I need to be able to load images from URLs. When a user loads one of their projects, I use AJAX and php to retrieve:
# of parts|partid1|partURL1|partid2|parturl2| etc...
Thanks to the chrome debugging tip, I learned how to avoid the cross-domain issue, temporarily.
I'm not sure how to approach this next step:
At first I tried attaching a single tempSprite to the layout and using System>Create Object, then calling Load image from URL on (what I think is) a new copy of the sprite? The result was all the sprites ended up changing image, not just the newly created one.
Next, just to see if it would work, I created two separate tempsprite1 and tempsprite2 sprites and attached them to the layout/layer. This approach works (as far as each sprite loading a different image/url), but so far, all I can see to do is set values (positions, scaling, custom zindex, rotations, etc) through actions attached to each individual sprite. This route means I would have to pre-define a large number of sprites and value setting actions to each sprite. Should I expand on the app (say color offsets etc) I would have to go back and edit every tempspriteX's 'set' actions. I tried functions as well, but to no avail.
I tried using Families. I tried creating a new Family "parts" where parts contained a tempSprite sprite, but this had the same problem as the first approach, everything was the same image.
I'm coming/converting from pure actionscript3 where I just create a loop that defined a temporary sprite each iteration, set its image and attributes, then pushed it to an array of sprites and continued until there were no more images from the php/url request. I do not know if anything like this is possible in C2.
I have searched the forums a few times with no success. C2 is great. I've learned a lot in the few days I have used it. I'm amazed by the # of sprites I can manipulate on a desktop/html5 app compared to Flash. Even if I cannot find a good solution to this particular problem, I'm already happy to have paid for it.