Skip to main content
Participant
June 20, 2018
Answered

Links work in test, not after publishing

  • June 20, 2018
  • 1 reply
  • 389 views

Preface: I'm a novice a little over his head.  Trying to teach myself on the fly, so any answers given might need a little more context or explanation than usual.  Thanks in advance.

I'm building a simple menu interface.  Buttons link to various URLs on the company intranet and well as documents and folders on the company network.  My URL links work fine, but the ones I created for network folders and files aren't working properly.  When I test the movie in Animate, they work fine, but they don't work after I publish the movie.

I used the code below to create the network links:

pg_5_btn16.addEventListener(MouseEvent.CLICK, pg5_btn_16);

function pg5_btn_16(event:MouseEvent):void

{

navigateToURL(new URLRequest("file://NETWORK LOCATION"), "_blank");

}

I suspect I'm using the wrong action for what I want to do, but I'm not sure.  I've poked around some and tried experimenting with fscommand and externalinterface, but haven't been able to use either of those methods to resolve the issue.  Any advice is appreciated.

This topic has been closed for replies.
Correct answer kglad

if the loading and loaded files are on the same server, use a relative path.  that path will be the same when testing as when deployed (as long as the relative locations stay the same).

1 reply

kglad
Community Expert
Community Expert
June 20, 2018

your navigatetourl path is almost certainly incorrect.

Participant
June 20, 2018

great...so how do I fix it?  The use of file:// in place of http:// is needed due to restrictions on what file types are allowed to be uploaded to the company intranet sites.  I can't upload the needed files to a site, so I they will never have an http:// URL.  I have the true network path in my code.  I used NETWORK LOCATION as a place holder to redact proprietary information.

Again, I'm a novice, so some context and explanation is helpful. Thanks.

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 20, 2018

if the loading and loaded files are on the same server, use a relative path.  that path will be the same when testing as when deployed (as long as the relative locations stay the same).