0
votes

I've had the time to continue working on my flash site. I already have the entire layout built in Flash.

My site is built using timeline control scripts (AS3).

Because I couldn't figure out how to make a scrolling gallery (I've looked everywhere and still do not understand), I proceeded to buy one on Activeden so I not only can use it, but could see how its done and learn from it. But the .fla file of the gallery is in AS2. The .swf is "self-contained" so Actionscript versions don't matter right?

The gallery is XML based.

I used this AS3 "loader" to load the .swf into my flash site.

var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, showMySWF);
function showMySWF(e:Event):void {
 addChild(myLoader);
 myLoader.x=100;
 myLoader.y=150;
 myLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, showMySWF);
}
myLoader.load(new URLRequest( "xmlgallery.swf" ));

All the images and assets are in the same folder as my flash site.

But all I see is an empty gallery

If I play the xmlgallery.swf file itself, all the images are there, but when I use the Loader to load it into my webpage, all the images are not. In other words, the gallery design itself is completely functional, but I just cannot see the thumbnails and images on it unless I test the xml gallery's own standalone swf file. When I test my own flash site with the gallery loaded in, I see no photos; when I upload to a web server- nothing either and I tried 2 web servers.

The strangest thing is that the title and caption/image description information display and that information is located in the same XML file. So I'm thinking that flash has problems getting into those image folders even though it is all there in the same directory.

1
You probably have a better chance of getting an answer if you edit your question so not all code is on one line, so it can be read.Lars Blåsjö
Thanks to vasco who edited my post for me!Jen PC

1 Answers

0
votes

Considerations for loading an older SWF file

  • If the external SWF file has been published with an older version of ActionScript, there are important limitations to consider. Unlike an ActionScript 3.0 SWF file that runs in AVM2 (ActionScript Virtual Machine 2), a SWF file published for ActionScript 1.0 or 2.0 runs in AVM1 (ActionScript Virtual Machine 1).

  • There are important differences when loading an ActionScript 1.0 or 2.0 SWF file into an ActionScript 3.0 SWF file (compared to loading an ActionScript 3.0 SWF file). Flash Player provides full backward compatibility with previously published content. Any content that runs in previous versions of Flash Player runs in Flash Player versions that support ActionScript 3.0. However, the following limitations apply:

  • ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0. When an ActionScript 1.0 or 2.0 SWF file is successfully loaded, the loaded object (the Loader.content property) is an AVM1Movie object. An AVM1Movie instance is not the same as a MovieClip instance. It is a display object, but unlike a movie clip, it does not include timeline-related methods or properties. The parent AVM2 SWF file cannot access the properties, methods, or objects of the loaded AVM1Movie object.

  • SWF files written in ActionScript 1.0 or 2.0 cannot load SWF files written in ActionScript 3.0. This means that SWF files authored in Flash 8 or Flex Builder 1.5 or earlier versions cannot load ActionScript 3.0 SWF files.

  • The only exception to this rule is that an ActionScript 2.0 SWF file can replace itself with an ActionScript 3.0 SWF file, as long as the ActionScript 2.0 SWF file hasn't previously loaded anything into any of its levels. An ActionScript 2.0 SWF file can do this through a call to loadMovieNum(), passing a value of 0 to the level parameter.

  • In general, SWF files written in ActionScript 1.0 or 2.0 must be migrated if they are to work together with SWF files written in ActionScript 3.0. For example, suppose you created a media player using ActionScript 2.0. The media player loads various content that was also created using ActionScript 2.0. You cannot create new content in ActionScript 3.0 and load it in the media player. You must migrate the video player to ActionScript 3.0.

  • If, however, you create a media player in ActionScript 3.0, that media player can perform simple loads of your ActionScript 2.0 content.

limitations of previous versions of Flash Player