Reading in existing file in Flex 4.6 - apache-flex

Alright, I'm really new to flex. I have a data file on my computer that I need my flex mobile app to read from. Is it possible to put this file in a certain location on my computer so that the app will see it when I'm testing(ex-can i put it in a folder that is linked to the applicationstoragedirectory directory)? Thanks

You can just drop it in the source folder, it will automatically be copied into the bin-debug folder (there are a few choice exceptions that you can find in the window->preferences->Flash Builder->File Exclusions) Everything that is copied into the bin-debug would also be packaged into an air or airi file and ultimately deployed next to the bytecode/executable just like it is in the bin-debug in the builder.
You can also make another folder, say "resources" then in the project properties in the flex build path go to source path tab and click add folder button and type "resources". Then it will treat that and the src folder the same.

Related

QT Creator Disable displaying file path in file browser

I move source and header files in include and src dirrectories. Then i define this dirrectories in VPATH and include files without specifying any directory.
After all of this, I want to see files in the File Browser panel as included directly (without any path), but I see relative paths anyway!
Is there some way to disable relative paths in File Browser panel?
P. S. I doesn't like "Simplify Tree" option, coz it place all headers and sources in one folder. This is uncomfortabel.
The screenshots are all taken from "Projects" view, not from file view. The project view is meant to visualize the build system. Your build system has the files stored in a subfolder, so Creator will display that. Since the Projects view is used to add files into the project this is important: Which folder should a new file go into if that folder was not displayed?
It does not matter how you write the filenames into your .pro-file: Creator will get a list of absolute paths for all your sources -- as long as qmake/make can build your project that is:-)

How to select location for Asp.net Website project?

Creating a new website allows you to choose the path of the website files. However, the project file itself is created under the Projects folder. How can I create it somewhere else? I would expect some field for that in the dialog, but can't find it.
(This is not a web-application.)
At least in VS 2013, there is no project file associated with web sites. There is only the .SLN file. The .SLN file is merely a simple container for all of the different websites and projects that you would like opened simultaneously in your Solution Explorer, so the location of the .SLN file on disk is not really important.
Still, if you would like to control its location, you cannot do so through the New Website dialog. You'll have to manually move the .SLN file after you've already created the website. And in doing so, you would also have to open up the .SLN in a text editor and manually adjust all the relative paths to point to your website location.

Bluimp Backload folder reference issue with virtual directories

I am working on a solution which has two projects in it. One is a virtual app which works in another. The first application is the panel and the second is the website. First application can be accessed with "localhost:10001/panel" and the second with "localhost:10001". You see, I created a virtual path for the first app to work under the second one in Visual Studio and they work great that way.
The problem I am having now is about the file uplaod system, "Blueimp's jQuery-File-Upload" plugin and as backend using "Backload". I must say that these work great on a standalone project. That's why I decided to continue the project using these.
But when it comes to a setup which I explained below, I cannot access the files I upload. I installed fileupload system in the panel project, which is accessed as "localhost:10001/panel" so when I leave the default web.config configuration for backload (default is "~/files"), all files are uploaded to the "localhost:10001/panel/files" path. And after the upload when I refresh the page, all uploaded file links are referencing "localhost:10001/files/" without the "panel" folder.
In BackLoad web.config notes how to change and use root upload folders are explained like that
filesRoot: // Root upload folder. If the value starts with '~/' (e.g. ~/files) the path is relative to the web root, otherwise set an absolute local path (e.g. d:/files) [Default: "~/Files"].
I understand that having "~/" at the beggining of a folder reference shows the project's root. But I can't figure out how to reference the upload folder, instead of the default "~/files", to upload and access all files from the second project's root. When I need to reference folder between these two projects I simple use "../", or "/" to access the second project's (site) root. But doing that in "filesRoot" attribute of BackLoad config settings, all file references are starting "///file....." and shows a local path in the computer.
I simply want to upload and access the files from the "localhost:10001/files" location when I upload files from the panel. Now, I cannot even use the "localhost:10001/panel/files" path because files are uploaded to "panel/files" folder, but are accessed from "files" folder with default settings.
BTW: I am using BackLoad's WebForms Example on this project, and this is a Web Forms project.
I ended up using Files folder as a temp folder. At the time of submit, I move the file which is uploaded in Files folder, to the folder of my need. And the problem is solved.
Thanks anyway...

How to prevent an html-template sub-folder from being refreshed during build?

I placed my AMFPHP folder inside my htmltemplate project folder, but now everytime i build it wants to 'refresh' the folder which takes forever. Is there a way to set it so that folder does not refresh each time? I put the AMFPHP folder in there so I can have a unique copy for my debug builds and leave the production build one alone.
I'm not sure what you mean by 'refresh'
The HTML-Template folder is just a template. During build all files/folders in the template folder are copied to the bin-debug (or bin-release) folder. Is this 'copy' the refresh your talking about?
If you don't want these files copied over every time; just put them in your bin-debug / bin-release folders directly instead of the template folder.
If your AMFPHP folder contains config files; and nothing else, then you probably don't need those files in the html-template, bin-debug, or bin-release folders. You can compile them into the SWF using the services compiler argument.
There is also a setting in the Flash Builder Project Properties that may help. Under Flex Compiler, uncheck 'copy non-embedded files to output folder'. However, I think this relates to files int he source directory; not the HTML Template directory.
Does any of this help?

flex air include a directory with the installer

I am creating an AIR application using Flex. In it I need 2 directories downloads & uploads. These directories will have downloaded files & uploaded files.
But the problem is I am not able to create these 2 directories programmatically & also I am not able to include the 2 directories with the installer in the application directory.
Is there any way to create or include directories in the application directory.
Thanks
Create an empty folder inside your Flex project. Right click on your project and go to Properties->Compiler (not exact name but something like that). Make sure it has "Copy nonembedded assets to output directory" (check it if it doesn't). Click Ok.
Export a release build of your AIR app. Do NOT click Finish after the "signing" step. Follow each step until you get to the "assets" screen. It will show you a list of every file and folder in your output (bin-debug, by default) directory.
Check the files you want, uncheck the one's you don't, and click OK. Done. You have your AIR file packaged with whatever file and folder you want.
[...] But I need to create the directories in application directory. I am using: var dir = File.applicationDirectory.resolvePath("upload directory");dir.createDirectory(); And I am getting: at runtime::SecurityManager$/checkPrivilegeForCaller()
This is a know issue. AIR wouldn't allow you to write to the application directory. Instead try writing
either to the File.applicationStorageDirectory (application's scratchpad),
or to the File.documentsDirectory (stuff user might want to lookup)
Related resources:
Adobe AIR team blogpost
Use This Dear :)
var dir:File = File.applicationDirectory.resolvePath("NewFolder");
dir =new File(dir.nativePath.toString());
dir.createDirectory();
Regards
Ali Naqvi
have you tried something like the following
var dir = File.userDirectory.resolvePath("upload directory");
dir.createDirectory();
This will create the directory 'upload directory' if it does not already exist (inside the users home directory).
To add to johncblandii's anwser:
I've found that for the above to work, you also need to include the folder in the project's build path. I also had to refresh the project's file listing before flash builder recognized the folder and added it to the include options.
I just want to add another thing to johncblandii's comment: Create an empty.txt file and write something there. Because it looks like empty folders are nod allowed to be included in your packed application

Resources