Tuesday, March 30, 2010

loadmovie issue, only one displays

hello flash users,

i am new to as3 and am having some issues getting movie clips to load via loadmovie. I created two .swf files, both are same size but on different timelines. I simply want to add each to a new movie, one as background and one as overlay, and let each play repeatedly. I can get one of them to load at a time by removing the actionscript for the other layer, but I have not been able to get both to display at the same time, one on top of the other. I put the actionscript on the layers where I want to load the .swf...

here is the actionscript for the background layer: (name: xbkg)

var loadMovie2 = new Loader();

addChild(loadMovie2);

loadMovie2.load(new URLRequest(''xbkg.swf''));

here is the code for the overlay layer: (name: x)

var loadMovie1 = new Loader();

addChild(loadMovie1);

loadMovie1.load(new URLRequest(''x.swf''));

As I stated, if I erase either of these and leave the other the same, it displays the one perfectly.

I have a feeling it has something to do with assigning the var, but I am not sure. Any help would be appreciated before I throw my computer into the street.

Thank you in advance!

Aaron

loadmovie issue, only one displays

is there any reason to think you should see both if one lies directly on top of the other?

loadmovie issue, only one displays

yes, the top movie is mostly transparent (that would have been good info to include)

on that note, when i try to display one on top of the other, i get nothing. blank white screen.

the script you showed will load 2 swfs (or you'd see an error message in the test environment). it can't be determined from what you showed if xbkg.swf will be below x.swf.

can swf file handle transparency? i had the layers in flash such that the layer on top contains the swf with mostly transparent features and the layer on the bottom is the 'background' movie. i find it strange that when i have both movies loading i see nothing at all. just a plain white screen. it seems like i should at the least see the movie on top without transparently seeing the movie beneath. i believe what you are referring to is some sort of z-index value, but currently i am not seeing any movie to know which movie flash is placing 'on top of' the other movie.

you must be doing something, other than what you've displayed and explained, to cause this problem.

to confirm, create a new fla that contains only the code you showed in this forum with those external swfs in the same directory.

kglad, you were right. not sure what i had in the original file to prevent it from working, but recreating it in a new file works perfectly. thank you for your time.

you're welcome.

  • philosophy
  • No comments:

    Post a Comment