LoadMovieNum in AS2/1 files loaded into an Air-based AS3 / Flex application?

I've concluded that level s are not supported in SWFs that are loaded directly into Air apps. For example, even level0 (which should always be defined) returns as undefined Consequently, it would appear very unlikely that loadMovieNum would be supported.

I've concluded that _levels are not supported in SWFs that are loaded directly into Air apps. For example, even _level0 (which should always be defined) returns as undefined. Consequently, it would appear very unlikely that loadMovieNum would be supported.

I have discovered a workaround, though. Using the HTML browser component in Air, a webpage - in which the AS2/1 SWFs are embedded - can be loaded into the Air app. If you do this then loadMovieNum works as expected in the AS2/1 files.

AS3 version: var hLoader:HTMLLoader = new HTMLLoader(); addChild(hLoader); hLoader. Width = stage. StageWidth; hLoader.

Height = stage. StageHeight; hLoader. Load(new URLRequest("file1.

Html")); Flex version: Unfortunately, the HTML component is not supported by all Air profiles. In particular, in my case, it is not supported by the TV profile.

Although it may not seem intuitive, this seems like a security issue. When AS2 content loads up other AS2 content, they have to be in the same security sandbox in order for them to run. I created a quick sample just to test this theory and I was right.

The reason it works in Flash is because the AS2 content is in the same sandbox as the content it is loading. But AIR security is different. So when you load up the AS2 content in AIR (using the logic you supplied), the loader gets put in the application sandbox.

The sandbox is now different than the content it is loading, so it refuses to load them. This explains why it works when using an HTML wrapper. When the HTML loads up the swf, it probably gets put in the local-with-network sandbox which is the same as the content.So... How do you fix it?

You can try to load your content up in a different security sandbox. But really the problem is that AS3 security isn't playing nice with the AS2 security. My suggestion would be to create the AIR application without an AS3 wrapper.

You can't do this directly in the tooling, but you should be able to use the ADT packager to do it. In the xml descriptor, make the initial content the AS2 swf, and package it together. Now when you launch your AIR application it uses the AS2 swf as the main application.

Suddenly your files should all be in the same security sandbox, and Flash won't prevent any of the content from running. You can test this locally by using ADL to launch the app instead of launching it directly from Flash Professional or Flash Builder.(They both use ADL, but if you call it directly you have more control over the arguments used. ) EDIT: Apparently you can't have an AS2 swf as the main swf for Desktop AIR applications.(I've tested using ADL on desktop and it works, but I have been told that you won't be able to install an AIR application on desktop with this setup.) So for desktop you probably want to use the HTML workaround.

This is supported in AIR for TV, so this would work on those devices.

Thanks, John. We discovered the ADL workaround too. It works but unfortunately, it isn't great for our circumstances.

I am able to load a second AS3 SWF into the "remote" sandbox. From there, I am able to load the first AS2 file and attempt to load the second AS2 file (presumably in the same "remote" sandbox as the AS3 file). Unfortunately, no joy there either.

– Oliver Moran Aug 31 at 8:45 Oliver, Is this application specifically for AIR for TV? If so, then you don't need to use the AS3 wrapper. You can set your application.

Xml to point to the main AS2 swf. Then all of your other AS2 content should be in the same sandbox. – John Simpson Sep 13 at 14:41.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions