Dynamically created images disappear when animated?

I’m creating a flash application which loads external images from an XML file and places them in an animated slideshow, however - whenever i run the animation the external images (which have previously loaded completely) are replaced with the placeholder images that they replaced when loaded… if that makes sense???

Basically there is a movie clip which includes the tweens and masks for the slideshow images, within this clip there is another one holding a background colour on layer 1 and another movieclip on layer 2. This movie clip on layer 2 holds a placeholder ‘loading’ movieclip which is then replaced with the external image when loaded. The external images load and display fine, however when the first clip is animated the ‘loading’ placeholder reappears.

All the movieclips are added to the stage programmatically and the external images only appear once they have fully loaded - I cannot work out a) why they are being replaced with the ‘loading’ movie that they loaded in place of and b) how to stop this happening!

Any help would be gratefully appreciated!

Caroline

upload an fla,

i’ve attached a zip file, as the actionscript is in classes :slight_smile:

WHY OH WHY DO CS3 people post in the flash 8 section without converting their files

convert the file to flash 8 format if you want a responce… I assume you are working in AS2?

I’ve attached a Flash 8 version, my mistake, sorry!

I’d advise you to look at papervision3d to get the effect you want, it looks naff what you have

there is a component that does this also but its very bulky and limited

luckily CS3 AS3 versions are a plenty

what level of coder are you?

there are so many classes its taking the piss, plus you didn’t include them all :stuck_out_tongue:

while i appreciate the reply, with all due respect the classes are all included and there are ‘so many’ purely because much of the code is used elsewhere, secondly because this is 10% finished (the primary reason it looks ‘naff’ as you so kindly put :wink: ) and there is a large amount of additional functionality to be included.

I’m aware of the components which do the same thing, alongside the open-source versions knocking around - as you correctly mention most of these are very bulky (mainly due to the use of matrices to produce the animated effect).

My level of coding is advanced but I come from a background of other languages, using Actionscript mainly with Flex previously.

Thanks again for the reply, but papervision is not an option due to time constraints and the fact that no-one here actually works with Flash (we’re producing this slideshow thingy for another agency to help out), if there’s no obvious solution that can be seen we will pass the work back to them.

well tell me which class deals with loading and maintaining the assets?

and which animates?

“LoadExternal.as” holds 2 functions - one to parse the XML data, the second to load the external image files. “GenerateSlideshow.as” creates the movieclips to hold the images and backgrounds and “Slideshow.as” holds the current animation code.

My suspicion is that, due to the animation occuring in a movieclip rather than programmatically, Flash is loading this clip and it’s child placeholders (which are replaced by the external images) before the external images have completed loading. The functions run in the following order:

  1. Load XML
  2. Generate empty movieclip assets based upon the XML data
  3. Load external images

I have tried to force the flash to load the external images completely first (exporting flash classes in frame 1, adding the movieclips to the stage on frame 3 with a gotoAndStop control following the completion of the images loading), however, the problem is that the movieclips holding the external images are nested in order to allow the masks/animations to work and externally loaded assets cannot be directly referenced (i.e they are not provided their own instance by flash, rather once loaded they can be referenced only through the clip into which they are loaded). As a result the external images have to be loaded and then duplicated once the main movieclips are produced on stage, and this causes exactly the same problem.

Thanks again.

I’d say remove the masks:P

AS and timeline don’t get along, you’ve mess with the centre of the MC, which will probably throw the contense off

diagnosis your going to give yourself a headache

the mask is there from using a matrix previously which was too slow, so admittedly it does need to be removed but that’s not the cause of the problem. Also, the centre of the ‘mc’ has not been messed with - if you’re referring to the registration point it’s been intentionally moved to create a smooth animation and if you’re referring to the assignment of X & Y centre points in the actionscript it’s there to ensure that the code will work with any movie, regardless of the stage size and/or the external image size (this is designed to be reusable hence the use of ‘so many’ classes, as mentioned previously, besides which the use of OOP is far better coding practice - flash or otherwise).

As for the headache, I already have one :wink: - this is going back to the original agency. I appreciate your looking into it though :slight_smile:

Caroline