Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

complicated loading swf with xml

Guru ,
May 15, 2007 May 15, 2007
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
TOPICS
ActionScript
828
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 15, 2007 May 15, 2007
if it helps, here my AS. when this is loaded into my main timeline (another SWF) the gradient_mc and bigImageFlip dont work. however, bigImageLoader does.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 15, 2007 May 15, 2007
There is a security issue with loaded images and BitMapData I believe.

You may need System.security.allowDomain("*");
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 15, 2007 May 15, 2007
tried, and didnt work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2007 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;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2007 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 May 16, 2007
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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'
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2007 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 16, 2007 May 16, 2007
got it to work with this...FINALLY, i felt like i was on crazy pills.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2007 May 16, 2007
LATEST
Super!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines