Flashbuilder 4 build of project.

Hey all,

When I build my Flashbuilder 4/Flex project and check the bin-release folder created from the build, the project works fine.

But, if i copy ALL of the files/dirs into another folder and test, I get the following error:
Error #2148: ...Only local-with-filesystem and trusted local SWF files may access local resources.null

Is there not a way that I can build the project with local assets and the build just creates the paths upon build and I could just be able to take a folder with the project and sub-dirs w/o having to move things around AFTER the build.

I don't see a way of making the paths of my assets to be relative instead of absolute.

Basically, I just want to hit the BUILD button...FB4 builds it, and I just take that folder anywhere an it works w/o any other file moving manipulation.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you just for testing purpose change in the Flash Builder output directory to your Desktop or other directory where are you planning to run. Go to Project Properties->Flex Build Path->Output Folder and Browse  to other folder. Compile and run from Flex builder and then try to run from new output folder.
My guess you may don’t have permission running from your output directory, but maybe I am wrong.

ModifyMeAuthor Commented:
I set it to my desktop, attached image.  

But I am again at the, not using XML stage again.  So when I go to the bin-release folder on my desktop, the app works well with the LocalConnection, but the quiz no longer absorbs the XML file again.

oh its you again :)  Please attach your bin directory
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

But before try to change security rule to read your file from local machine

Go to this URL


Click on radio buton "Always alow"

In the dropdown "Edit location..."
Pick "Add Location..."
Type C:\
and cllick "Confirm" Button

Goto your bin and try to run SWF file again
ModifyMeAuthor Commented:
Yep, me again.  

So I did add the dir in the security role, but still get same results.  If the swf would hit the XML file, then all would be good.
XML/SWF and you Flex SWF inside the same bin directory?
ModifyMeAuthor Commented:
My XML/SWF files are in the questionnaire folder and of course the project html file is in the bin-release.

The code for the Flex project to access the swf is:
<mx:SWFLoader source="../questionnaires/multiple_choice/Questionnaire.swf" width="357" height="276" id="quizContainer"/>

Open in new window

The code for the Flash swf to access the XML is:
xmlLoader.load(new URLRequest("questionnaire.xml"));

Open in new window

ModifyMeAuthor Commented:
The questionnaire folder structure is:

You cannot execute SWF file wihtout questionnaries directory

Create a new folder on the desktop "MyFolder"

and drop into that folder bin-release or bin-debug and questionnaries folder

And then try to execute SWF
ModifyMeAuthor Commented:
Same outcome.

The SWF file does have the questionnaire directory available.  In the Flex SWF, the code goes up a directory ../questionnaires/blahblah

----bin-release(code goes up to questionnaire and grabs swf)
Please send me your bin folder by email

ModifyMeAuthor Commented:
Coming your way...
Actually you are hardcoded path to your XML

URL: file:///C:/Users/avalentin/Adobe Flash Builder 4/Pinnacle/data/questionnaire.xml".
URL: C:/Users/avalentin/Adobe Flash Builder 4/Pinnacle/data/questionnaire.xml

I don't have such user on my box :)

By the way in your Flash Builder select Project Properties->Flex Build Path->Library Path

and switch Framework linkage to  "Merged into code"

You don't want to load Adobe RSL from desktop application, file will be large but shouldn't ne problem for you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ModifyMeAuthor Commented:
I must be completely out-of-it on this project.  

When I open the .fla file, my code is:
xmlLoader.load(new URLRequest("questionnaire.xml"));

Open in new window

Where do you see that path?
I don't know I don't have your source files
ModifyMeAuthor Commented:
Oh wait, I see the absolute in Flex for the SWF.  That should not have been setup like that, it was setup as ..  not absolute.

Lemme fix and resend via email.
public function _Super_Questionnaire()
        // initialize service control
        _serviceControl = new mx.rpc.http.HTTPMultiService();
         var operations:Array = new Array();
         var operation:mx.rpc.http.Operation;
         var argsArray:Array;      
         operation = new mx.rpc.http.Operation(null, "getData");
         operation.url = "C:/Users/avalentin/Adobe Flash Builder 4/Pinnacle/data/questionnaire.xml";
ModifyMeAuthor Commented:
Ok, well I started a completely new project, brought in the assets and voila it works.  So there must be something I did with my project that is screwed up.  I will move forward with the new project I just created.

You definitely make my payment to EE worth every cent.

Thank you for sticking with me to solve my issue!

One question, for deployment do you just bring the [b]bin-release[/b] and any folder with assets that the bin-release needs to access?
If you want to run locally you should merge framework file into SWF
for running from your webhost you can skip this step.

If you are planing to use Adobe generated HTML file and swfobject.js
You have to copy:

Optional is you want to display your source code you have copy srcview

Another option to modify swfobject.js or download from
and forget about playerProductInstall.swf and history folder

And last option to create HTML file embed SWF
and copy only HTML and Pinnacle.swf



ModifyMeAuthor Commented:
Wow, thanks A LOT for your very helpful information!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.