82760

Using AS2 in Air Application

Question:

I'm working on bringing a game over from Flash to Android using Air 3.2. The SWF I am testing with is an AS2 SWF.

I used this method to get the SWF file to load: <a href="http://www.mikechambers.com/blog/2008/08/18/anyone-using-actionscript-2-to-build-air-applications/#comment-13360" rel="nofollow">http://www.mikechambers.com/blog/2008/08/18/anyone-using-actionscript-2-to-build-air-applications/#comment-13360</a>

However, when I open the app, the SWF loads, but no code works. <a href="https://drive.google.com/file/d/0B4kU4M05PZsCdU5kQ0FTZm5yQmc/edit?usp=sharing" rel="nofollow">Here's the APK so you can see it in action.</a>

Is there like a .SWC or something similar I can include to get the code to work?

Thanks, -Sandor

Answer1:

What you want simply is not possible on mobile.

<ol><li>

On iOS, you cannot load AS bytecode in SWFs prior to AIR 3.6. You must package them at compile-time (loading at runtime is against iTunes Store policies and flat out cannot run) and the code in the embedded SWF is cross-compiled to Objective-C with the rest of the APP.

Because there is no AIR Runtime in an app compiled for iOS (everything is cross-compiled to Objective-C), you cannot load in a SWF with bytecode, even if you do not plan to submit to the iTunes Store. There is no runtime available to actually run it.

The workaround in your link will not work either since there is not and never was a flash player for iOS, which that relies on

</li> <li>

On Android, the AIR runtime is AS3-only. There is no support whatsoever for loading AS2; that runtime simply does not exist.

Additionally, the little workaround mentioned in the comments of your link will not work either. That workaround relies on the device having Flash Player installed to run the SWF. Adobe dropped Flash Player for Android a few years ago and no device has been able to install it since then. Odds are only a fraction of a percentage of all Android users still have Flash on their phone.

</li> </ol>

So there is no way to do what you want. You must convert it to AS3 or not support Android and iOS.

Recommend

  • How to define a new kind of scope in Maven?
  • Flash Builder 4.6 not compiling for Flash Player 10.2
  • How to find AS code in FLA file
  • Complex Maven2 with Flex4 Setup
  • Loop animation drawable
  • Gray line inside cardview :)?
  • Wrapping text in spinner android
  • You tube videos are not playing
  • How to resolve permission denied maybe missing internet permission?
  • Problem with Django using Apache2 (mod_wsgi), Occassionally is “unable to import from module” for no
  • Bootstrap (v3.3.4) glyphicons not displayed in IE when refresh page (F5)
  • Implementing “partial void” in VB
  • Sending HTML Form Data to Spring REST Web Service
  • Loading .coffee files via a view in Rails
  • how to avoid repetitive constructor in children
  • Spark fat jar to run multiple versions on YARN
  • req.body is undefined - nodejs
  • How to recover from a Spring Social ExpiredAuthorizationException
  • Controls, properties, events and timers running in design time
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • ILMerge & Keep Assembly Name
  • Can I make an Android app that runs a web view in Chrome 39?
  • Symfony2: How to get request parameter
  • ActionScript 2 vs ActionScript 3 performance
  • what is the difference between the asp.net mvc application and asp.net web application
  • Why is the timeout on a windows udp receive socket always 500ms longer than set by SO_RCVTIMEO?
  • Large data - storage and query
  • Akka Routing: Reply's send to router ends up as dead letters
  • WOWZA + RTMP + HTML5 Playback?
  • Is there a mandatory requirement to switch app.yaml?
  • json Serialization in asp
  • Buffer size for converting unsigned long to string
  • Acquiring multiple attributes from .xml file in c#
  • Hits per day in Google Big Query
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How to get Windows thread pool to call class member function?
  • LevelDB C iterator
  • Linking SubReports Without LinkChild/LinkMaster
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal