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.

Thanks.
ModifyMeAsked:
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.

dgofmanCommented:
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.

0
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.


Output-to-Desktop.jpg
0
dgofmanCommented:
oh its you again :)  Please attach your bin directory
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

Go to this URL

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

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
0
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.
0
dgofmanCommented:
XML/SWF and you Flex SWF inside the same bin directory?
0
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

dir-structure.jpg
0
ModifyMeAuthor Commented:
The questionnaire folder structure is:

questionnaire-folder-structure.jpg
0
dgofmanCommented:
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
0
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


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

david_gofman@yahoo.com
0
ModifyMeAuthor Commented:
Coming your way...
0
dgofmanCommented:
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.
0

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?
0
dgofmanCommented:
I don't know I don't have your source files
0
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.
0
dgofmanCommented:
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";
0
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?
0
dgofmanCommented:
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:
history,
swfobject.js
Pinnacle.html
Pinnacle.swf
playerProductInstall.swf

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

Another option to modify swfobject.js or download from
http://blog.deconcept.com/swfobject/ 
and forget about playerProductInstall.swf and history folder

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

http://kb2.adobe.com/cps/415/tn_4150.html

http://stackoverflow.com/questions/137326/best-way-to-embed-a-swf-file-in-a-html-page

0
ModifyMeAuthor Commented:
Wow, thanks A LOT for your very helpful information!
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.