Flash on iOS issue with flash.net.navigateToUrl( );

I’m playing around with Flash packager for iPad and iPhone and it seems like there might be some restrictions on accessing files bundled with the application and delivered within the application directory.

During some video tests I delivered one h.264 video within the application directory and tried starting it using this code invoked on a MouseDown event:

var file : File = File.applicationDirectory.resolvePath( "video.mp4" );
navigateToURL( new URLRequest( file.url ) );

But nothing happened. Really nothing. No thrown error. It’s like I simply didn’t call navigateToUrl. Of course everything works fine with remote URLs so I’m quite sure I didn’t make a mistake.

After several different approaches I figured out I couldn’t access any of my files within the app:/ directory. Regardless of the filetype. Well, at least it didn’t work on my devices: iPhone with iOS 4.1 and iPad with iOS 3.2.2.

There’s a discussion about that the Adobe forums: http://forums.adobe.com/message/2979185

7 thoughts on “Flash on iOS issue with flash.net.navigateToUrl( );”

  1. Wie gehts derRaab,
    I’m trying to basically do the same thing with launching a PDF that’s bundled with my application. I was wondering if you found any solutions yet?

  2. Sorry. Didn’t test for a while. I’m sure there is no solution for that issue with the old PFI Flash packager. Have you tried the new AIR 2.6 for iOS? Maybe that works better in some way?

  3. I’m publishing straight out of Flash CS5, so I believe it is the latest and greatest.

  4. Using Air 2.7 you can display videos on IPhone/IPad using the StageWebView class.
    Furthermore, to load local files you can use the following sintax:
    new File(new File( ‘app:/assets/videos/video.mp4’).nativePath).url)

    It could be seems strange but it works perfectly! 😉

    Hope it’s usefull
    Fabio

  5. 1. Sorry Shane – I missed your second comment.

    2. Thanks Fabio! So StageWebView brings native video to AIR, but it’s still not possible to use StageVideo with h264? Kind regards!

  6. Fabio, how did you manage to get that line of code to work (see below)? It works when I Debug Movie from within Flash, but not from my iPhone.

    new File(new File( ‘app:/assets/videos/video.mp4?).nativePath).url)

    Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.