Publishing SWF using Adobe Flash - adobe

I have a SWF file which contains of an image (1keyframe) and also, it contains an AS3 file with the following codes:
var loader:Loader=new Loader();
var ur:URLRequest=new URLRequest("1.swf");
loader.load(ur);
addChild(loader);
I am trying to play the swf file (1.swf - an audio) while the image is being displayed. What I want to know is how will I be able to publish this project into an SWF file which can still play as expected even without the raw 1.swf file. I can publish SWF right now but when I delete the 1.swf file, my generated swf can only display the image.

If you are able to host your file 1.swf at an actual URL, you could change your AS3 code to fetch the file, over the network, from that specific URL.

Related

How to specify path with ImageIO write in JavaFX?

I have a JavaFX program in which the user may choose a profile picture. This profile picture is applied and should then be saved to a resources folder at the same level as my bin and src folders. I have a few questions:
How do you define the file path? This is my current attempt. I get a NullPointerException, but I think that has something to do with the output stream. It's fixable, so I am mostly worried about the path. This works when accessing an image, so why doesn't it work when saving one?
// Store chosen profile picture
File outputFile = new File("/resources/profilePicture.png");
ImageIO.write(SwingFXUtils.fromFXImage(croppedProfilePicture, null), "png", outputFile);
When I go to deploy the application, will I get issues with saving to a resource folder at the same level as bin and src? Do bin and src even exist when you deploy an application?
Thanks. I can supply any more information if needed.

Browse for file window without uploading the file

Is there a way to get the select file dialog box open and putting the location of the file into a textbox without ever uploading the file?
ETA I'm using VB.NET in a web page. By using the asp:fileupload tag I can get the file location
_fudFileLocation.PostedFile.FileName_
But how do I prevent the file from being uploaded at all. We don't need it, just the file location. (The files are on a shared drive so if it's M:\documents\todayslunch.pdf for person A, it's the same for person B.)
You do not get access to the full filepath in the browser because of security.
If this was possible, one could get the full layout of the computer of anyone going to any website.
System.Web.HttpPostedFile.FileName gets the fully qualified name of the file on the client which includes the directory path.

Flex build use local files

I have a very stupid problem. I'm using Flash Builder (Flex) 4.
My application displays a video using VideoDisplay component and some images.
The video filename is always named video.mp4 and the images are inside a folder called "real/".
The video file and the real folder are in the SAME location of the .swf built.
The video source in the code is set like this:
videoDisplay.source = 'video.mp4';
and the images, loaded dynamically, are like:
img.source = 'real/' + imageFilename;
In development, I put this video and real folder inside the Flash Builder folder called bin-debug: I can correctly display the video and see the images.
In the release version, when you export and build the release, I have tried to put this video file and the folder inside the folder bin-release, I open the index.html generated, but nothing, the video and the images are not loaded!
Is there any problem with the sandbox? I don't think so because it is in the same local folder!
Do I have to setup anything in the compiler? Some param?
use URLRequest to load the external files
new URLRequest("c:\folder\video.mp4"));

Flex: Load images and swf's dynamically

I'm building a slide-show like application in Flex and I'm trying to load images dynamically. The images are in a folder outside the application folder. This is the folder structure:
/Bildvisare-debug/
Bildvisare.html
Bildvisare.swf
/Images/
01_02_01_01_B.jpg
01_02_01_01_T.JPG
I'm reading the image names from an XML file and get them with a path of ../Images/01_03_01_01_B.jpg. In my mxml-file I've got an SWFLoader named picture and I try to load the images with the following code:
this.picture.source = images[currentImg]; //E.g. ../Images/01_03_01_01_B.jpg
this.picture.load();
The problem is that the images never show up, I only get the icon for a missing image. Can anyone help?
Edit to add: I've tried this both with and without the use-network flag set to false when compiling.
I believe this is relevant to your case.
A SWF file can access one type of external resource only, either local or over a network; it cannot access both types. You determine the type of access allowed by the SWF file using the use-network flag when you compile your application. When the use-network flag is set to false, you can access resources in the local file system, but not over the network. The default value is true, which allows you to access resources over the network, but not in the local file system.
From Flex Image Control

Setting Default SAVE Locations in flex3 web application

In flex 3 web application how to set default save location for images?
Thanks.
From the FileReference documentation:
The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box that the browse() or download() methods generate. The default location shown in the dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do not allow you to read from or write to the transferred file. They do not allow the SWF file that initiated the upload or download to access the uploaded or downloaded file or the file's location on the user's disk.
If you're using AIR, you have more control using the File class.

Resources