I have about 125MB worth of video files that I need to play from an expansion file (OBB). The OBB file itself is in place and is successfully 'mounted' using a 3rd party native extension, so I can access the files using traditional methods, like the File class, the Loader class, etc.
I use the NetStream and NetConnection classes to play the video file, but the problem is that for the stream to play, the video file needs to be in the same folder as the SWF that is trying to play it (or a subfolder). This is also in the Adobe documentation:
Play a local file
In Flash Player and in AIR content outside the application security
sandbox, you can play local video files that are stored in the same
directory as the SWF file or in a subdirectory; however, you can't
navigate to a higher-level directory.
I tried to play the stream nevertheless, just out of curiosity, and it throws a StreamNotFound error (as it should, because the video file is not in the same folder/subfolder as the SWF). My hunch is that this is some security sandbox thing, and there's a way around it, but I can't find it.
Any help is appreciated.
Eventually I was able to play a video file from the mounted obb using the built-in as3 VideoPlayer class, which it seems is able to play video from any folder.
Related
I've create an app using flash cc for android. It works great but now my goal is to publish it in windows. I know I can use air for windows. I've tried it and it works. But the problem with that is, you can see all the swf files on installed folder. That makes my files vulnerable for theft. So I want to know if there's any methods or converter to convert my whole air application in exe so that it doesn't expose all the included swf files. I think game like machinarium was created using flash. But when I got the setup file it include exe files and non of flash files or any other files were exposed. Is it possible to achieve with flash as3? Any help would be much appreciated.
If you're using Adobe Flash you can go to your publish settings and a small menu will pop up and there will be tabs at the top. Go to the tab that has a list of the various file formats you can export to and .exe will be one of them. Check the box and then set the file location, then hit 'Publish' and you should have an .exe file.
I have a swf file (game file) which reads the content of external text file which I have created. This swf file will not be used in any browser. It's for windows only. I was wondering if I can delete or update that text file after I read it's content without using air.
Your question isn't very clear, I'm not sure what exactly you wanted to know. But if I understood you correctly:
You cannot delete files from the filesystem in the through Flash Player, but you can however delete it from SWF file's memory.
Deleting from the file system (basically like putting into trash) is something that only AIR can help you with.
Deleting from memory would mean to remove all the listeners from URLLoader or Loader object instance and setting it to null.
You cannot write the file with Flash player to edit it's content (update), but you can load it again and check if anything changed in that file's content that also would be considered as updating.
Hope that answers your question.
you cant do that without air. but you can use an external application using fscommand().
or you can use Multimedia Zinc
Somehow in moving my flash project files to my external hard drive, I lost the two background music tracks. They still play in the swf, but they're nowhere to be found (when I click on properties, it has it sitting somewhere it clearly isn't).
Is there a way to export the sound to a new mp3? The sound file definitely exists, but I can't seem to find it or access it. I want to make a new version of this on iPad hence I need all the original sounds.
If you have a .FLA file you can just open it in WinRAR and go to LIBRARY folder, which contains all the stuff you had in your project library.
If you only have a .SWF file I recommend using Sothink SWF Decompiler, which you can try for free. From there you can export all the assets you want.
I have a document class in my project and after I update it and put it on server the flash player loads the old version. It doesn't save in the cache memory which I clean every time I test the results, but seems to work when I change the name and modify the swf's doc class. Any idea how I could get around this? My document class is in the same folder the swf is, if it matters.
You must recompile your .swf locally and reupload that to your server. Any classes (.as files) are compiled into the .swf and not loaded by the .swf In fact, there's no reason to put any source code on a server, just like there's no reason to upload a .fla file.
I have an mpg file which I want to convert to flv format, but I have a requirement that while converting the mpg file, I also have to simultaneously play the converted flv file in the flash cs3. How to do it? I am using cs3 and as3.
If you want to convert your files programmaticly then use ffmpeg. This is a commandline tool which can convert video files to nearly everything. You have to execute ffmpeg with the correct params and wait until the video is ready. This works only on serverside. Means the flash client loads up the video file to the server. There it gets converted. You can execute ffmpeg with any serverside language like php.
Sadly I have no idea if it is possible to watch the video while converting. I think not but maybe someone else knows more.