Problem with js call

I am calling javascript from my flex application using which is working fine when i run the application from within the eclipse but when i take generated swf and try running it independently its not able to make call to the javascript .What could be the problem.