Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Links work in test, not after publishing

New Here ,
Jun 20, 2018 Jun 20, 2018

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.

331
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 20, 2018 Jun 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).

Translate
Community Expert ,
Jun 20, 2018 Jun 20, 2018

your navigatetourl path is almost certainly incorrect.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2018 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2018 Jun 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2018 Jun 20, 2018

What do you mean by a relative path?  As of now, my path is set up like this:

file://server/folder/folder/filename

I have my SWF movie file in the same folder as the files to be loaded.  I have not changed any of the locations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2018 Jun 20, 2018

use google to learn about path references.  afaik there's no shortcut unless you want to hire someone to do this for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2018 Jun 20, 2018

I did some research on relative paths.  I don't think you're answering what I'm asking.  The files I need to load are not among the assets in my movie.  They are located completely outside of my SWF.  I just need a way to link these files without having to rely on a hypertext URL

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2018 Jun 20, 2018
LATEST

what do you mean by, "I just need a way to link these files without having to rely on a hypertext URL"?

you don't want to use navigatetourl()?

do you know how to reference the url using an anchor tag?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines