Skip to main content
Damon Edwards
Inspiring
May 15, 2007
Question

complicated loading swf with xml

  • May 15, 2007
  • 12 replies
  • 950 views
main swf loads in new swf with xml image carousel including reflection of image. when you click an image on the carousel, the image slides over and changes to a new image with that image being reflected. the new image is loaded into an empy movie clip, along with the flipped image as well. the reflection is masking the flipped image by creating a gradient fill in an empty movie clip, cached as bitmap... in the xml swf, everything works just fine, however, once its loaded into the main swf, the reflection doent work, but the new images loads fine. which doesnt make much sense to me since they are both being called the same way... any ideas? flash 8 pro
This topic has been closed for replies.

12 replies

Participating Frequently
May 16, 2007
Super!
Damon Edwards
Inspiring
May 16, 2007
making some progress... it has to do with the depths.. when i mess with the depths, things start to happen, i just cant dial it in right so they all display
Damon Edwards
Inspiring
May 16, 2007
got it to work with this...FINALLY, i felt like i was on crazy pills.
Damon Edwards
Inspiring
May 16, 2007
if i just trace(gradient_mc), once it's loaded into other swf it came back "_level0.carousel_mc.gradient_mc"
carousel_mc is the empty movie clip im loading the swf into

however, if i do the trace once one of the images has been clicked and the gradient and flipped image should appear, it doesnt show anything when its loaded into the SWF.....but does show _level0.bigImageFlip in original.
_level0.gradient_mc

all files are flash 8 AS2
Participating Frequently
May 16, 2007
1. Trace gradient_mc and others. See if it/they are undefined. Then possible coding, timing issue.
2. Be sure the main.swf is Flash version that supports cacheAsBitmap or any item.
Damon Edwards
Inspiring
May 16, 2007
if I trace(gradient_mc.cacheAsBitmap); and do the same for bigImageFlip, on the original SWF it comes back 'true'.. however, once it's loaded into SWF it comes back 'undefined'
Damon Edwards
Inspiring
May 16, 2007
well the rest of the movie loads just fine, instantly and stays, its just the flipped image and its mask that doesnt appear to load.
Edit: those are the two that are cached... and the security setting doesnt work... tried several times.. including putting my domain in the (" ") and with the *, both no luck. not locally or hosted.
Damon Edwards
Inspiring
May 16, 2007
Damon Edwards
Inspiring
May 16, 2007
just playing around with it.. i set the gradient_mc alpha to 100, and when i test the movie it works fine, the gradient shows all the time..but once loaded into the main SWF it flashes on then it goes away instead of staying on...
Participating Frequently
May 16, 2007
Actually I believe the cacheAsBitmap also has the Security Issue when applied to a clip externally loaded content.

"but once loaded into the main SWF it flashes on then it goes away instead of staying on..."

That sounds like a timing issue. Did you try making a plain testingMain.swf and see what happens if you simply load it?
Damon Edwards
Inspiring
May 16, 2007
i think its a problem with the cacheAsBitmap. it doesnt seem to work when its loaded into the parent swf.. if I take that out of the child SWF and test, it doesnt work either, so, i'm guessing its not running that script..??... i tried the System.security, but still nothing. any other suggestions??? greatly appreciated
Participating Frequently
May 16, 2007
1. Be sure in main.swf there is no masking or layering hiding the reflection area. A way to test quickly is to load in a plain master swf that is much larger than the externals swf.


2. Know the weakness of loadMovie for timing issues that require the external movie to be fully loaded before actions are taken on it. I see a bunch of these in the code you posted. Best to use MovieClipLoader.onLoadInit before you attempt to access the external swf properties or code or add code.

3. Be sure the code is firing on load and all objects are created. Add some trace statements for those objects.

4. I noticed you do not use BitmapData so this may not be relevant but be sure to add
System.security.allowDomain("*");
to the main.swf as well as in external swfs and only if you are using the BitmapData class.


5. As I started to look at the code a bit and noticed this item:

There is no constructor for the Flash MovieClip class. You will not see a compiler error message because you do not have the code wrapped into a class.

var home:MovieClip = new MovieClip();

However it does not have impact on the code.

better would be

var home:MovieClip;
Damon Edwards
Inspiring
May 15, 2007
tried, and didnt work.