Expand my Community achievements bar.

SOLVED

Problem connecting with database when Flex Builder closed

Avatar

Level 1

Hello,

I developed a web page that connects to a database, reads some data and shows it on the screen. I use HTTPService to connect to a php server that takes the data from MySQL. Everything is OK when I run the web page from the Flex Builder, but when I run the page doing double click on the released .html file the connection fails and the program throws this error:

[RPC Fault faultString="Error #2028: Local-with-filesystem SWF file file:///Q:/2009-08-05-1330FinalFrontEnd/bin-release/FrontEnd.swf cannot access Internet URL http://localhost/Test2/Test2.php." faultCode="InvokeFailed" faultDetail="null"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::invoke()
    at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::invoke()
    at mx.rpc.http::HTTPService/send()
    at mx.rpc.http.mxml::HTTPService/send()
    at FrontEnd/submitLabelsQuery()
    at FrontEnd/updateLabels()
    at FrontEnd/___FrontEnd_SetEventHandler5_handler()

Does anyone know how can I run the web page without using Flex Builder?

More info:

I'm using Flex Builder 3 for developing the web page and WampServer 2.0 for the connection with the database.

Thank you,

Onditz

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi Onditz,

                  Previously i too faced the Same Problem when working With Php as the Backend, The problem is Flex is unable to Call your PHP page

                 This is the way how i solved it out Export Your Flex Project To Flex Release Build.

                 Right click on the Project Export---------->Flex Project--------->Release Build-----------> Copy all the Files to your Server where all your PHP                     files are and then call the application from the browser

http://localhost/Test2/Sample.html."

View solution in original post

4 Replies

Avatar

Former Community Member

In Flex Builder main menu:

Project - Properties - Flex Compiler - Additional compiler arguments

add    -use-network=true

If this post answered your question or helped, please mark it as such.

Avatar

Correct answer by
Level 3

Hi Onditz,

                  Previously i too faced the Same Problem when working With Php as the Backend, The problem is Flex is unable to Call your PHP page

                 This is the way how i solved it out Export Your Flex Project To Flex Release Build.

                 Right click on the Project Export---------->Flex Project--------->Release Build-----------> Copy all the Files to your Server where all your PHP                     files are and then call the application from the browser

http://localhost/Test2/Sample.html."

Avatar

Level 10

You need to add a crossdomain.xml  file at the root directory of your php server.

Thanks,

Nith

***************

See the piece of information copied from the flex documentation:

To make a data service or asset available to SWF files in different domains or on different computers, use a crossdomain policy file on the server that hosts the data service or asset.

A crossdomain policy file is an XML file that provides a way for the server to indicate that its data services and assets are available to SWF files served from certain domains, or from all domains.

Any SWF file that is served from a domain specified by the server's policy file is permitted to access a data service or asset from that server.

By default, place the crossdomain.xml at the root directory of the server that is serving the data.

Avatar

Level 1

The web page is running now.

Thank you for your help.

Onditz