Solved

Calling Flex function from javascript in a non server environment.

Posted on 2013-05-16
16
383 Views
Last Modified: 2013-12-17
Hello Experts,

I am calling a flex function  from javascript, flex function is getresults(), which returns a array of numbers.

It works perfectly fine when I run the html file on server or localhost.

I want to know is there any way to call the function getResults() when the html and all associated files are placed in non server environment?

Look froward to your replies and suggestions.

Regards
Parag T
0
Comment
Question by:ParagTCV
  • 5
  • 4
  • 2
  • +1
16 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39171587
The scripting is run by the scripting engine of the browser.  It has nothing to do with a server.  the browser will render whatever is presented to it as long as it does not need any resources from a server.  So everything must be in the environment with the browser and accessible to it.

Cd&
0
 

Author Comment

by:ParagTCV
ID: 39174115
I tried that a lot but to no avail. I have attached the code which I am trying.

Path of the html file is: bin-release/coloringWeb.html

Will you be able to find the issue and may be fix it? I am trying to fix this from many days. It works absolutely fine when I place this folder on server or localhost(Wamp) but does not work when I open the html file directly in browser.

When I open file directly in browser then path is like this ""
0
 

Author Comment

by:ParagTCV
ID: 39174624
EE wouldn't let me upload the zip file. Let me know if you want me to send the file on email. It will really help me a lot.

Regards
Parag T
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39175174
The default protocol for a browser, is http:
if you are not using a web server, then you have to specify the protocol such as file: on windows.

Cd&
0
 

Author Comment

by:ParagTCV
ID: 39176828
In that case it will not work on Android isn't it?

Regards
Parag T
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39177393
I don't know the internals of Android. So I have no idea how you are going to get that to interface.

Cd&
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:ParagTCV
ID: 39178418
I am not sure what you meant by "specify the protocol such as file: on windows." can you please let me know in detail about the same.

Many Thanks.
Parag T
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39178666
Any transfer of information requires that both the sending side and the receiving side agree on how the transfer will take place; how the data is encoded; the speed of the transfer; and possible a number of other things.  The agreement is reached by handshakes between the two entities that are specified in the protocol being used.

Most activity on web pages uses http: (default) or https: (default for secure transfer) how ever. the file: protocol is a protocol used when the data is to come from the file system manager.

I am getting the feeling that you may not have a level of technical understanding to be able to do what you want.  You might need to hire a local professional with android experience who can look at the detail and help implement what you want.  

Cd&
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 39183556
Sounds to me like this could be a security issue

Your server needs to have a crossdomain.xml file in it's public root directory, see attached file

There is also a setting in the HTML SWF loader that needs to be set (I highly recommend using SWFObject to embed your SWF if you are not doing so already):
var params = { allowscriptaccess: "always"};
swfobject.embedSWF("myApp.swf", "flashContent", "250", "250", "9.0.0", "", flashvars, params );

Open in new window


ref 1
ref 2
crossdomain.xml
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39673822
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 39673823
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39684370
a99.

While hobbit72 has made a good effort, I am not sure the question has been answered and the CVs assessment carries the most weight.  However hobbit 72 is the number one Expert in the Adobe flex topic, so we should give weight to that.

I am not sure the OP even understands the question or the comments that have been posted, and I would be inclined to award the points to http:#a39183556 as a probable solution and de-index the thread.

Cd&
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39708264
hobbit72 is certainly correct for a crossdomain request in a server environment but my recommendation lay with the fact it is a security issue around file:// same domain origin.

As I understand it, each file referenced as file://[filename] are classed as different domains and the OP was specifically asking about non-server environments so in theory the xml file would need to appear in every directory that a file is referenced.  I'm not sure that would work anyway.

https://developer.mozilla.org/en-US/docs/Same-origin_policy_for_file:_URIs

Concur with &Cd to accept hobbit72's comment as the solution as following that lead would either give you what you want or tell you it can't be done .
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Phone Dialer 5 36
Change month dropdown 5 15
onOpen. check dates in column, colour background 6 21
CSS measurement 10 14
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now