• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1314
  • Last Modified:

Adobe Flash CS4 ActionScript URL relative-path

Im a newbie in Flash authoring tool and need a help in following case:

I have a source Flash .FLA file. This file contains an animated picture or flash. However, when produce this file to .SWF format and put it on a web page, it purpose is that when a mouse hover over it to show some animation. On mouse click, it should instruct browser to load a specific .html file.

I dont know anything about ScriptAction language, but I did text search using Adobe Flash CS4 on that file to find a text of .html and I found the exact script as shown below:

onClipEvent (load) {
      this.p = 4;
      this.lnk = "Support.html";

The above script works only if Support.html file is in root-site folder AND the .html file that contains the .SWF is in root-site folder!
Considering my root site is like www.abc.com and I have a sub-folder called xxx; If I change the word Support.html in above script to /Support.html then insert the .SWF file in any .html file located in the xxx sub-folder of the root-site, then on mouse click browser will try to load the file Support.html from that sub-folder not from root-site.  Like this:

http://www.abc.com/xxx//Support.html which is an error due to double //

Where it should be, AFAIK, http://www.abc.com/Support.html 

What should I type in the script as a path?  I need to know what relative path to type.

Thank you for ant reply &

2 Solutions
just put the entire URL
Aneesh ChopraCommented:
try this:

"../" to come out a folder.

complete code would be:

onClipEvent (load) {
      this.p = 4;
      this.lnk = "../Support.html";
MoodynetAuthor Commented:
To: mharfouch

Using entire URL means using absolute path and this is not good for a site being moved from domain to another.

To: aneeshchopra

Using ../ means going 1 level up in directory. This is not good when I have several pages distributed in several sub-directories.

I will keep this discussion open to receive more comments. Meanwhile, I'd like to add:

I know in Linux that the tilde mark "~" refer to home directory of a user and in DOS that the slash mark   "/" refer to root directory. Using these principles, what is the mark that refer to root-site that Adobe Flash CS4 understand?
I'm using Dreamweaver CS4 to edit .html pages and Adobe Flash CS4 to edit .fla and produce .swf files. So how DW can show broken links contained in .swf file?

Thanks for those commented and any new comments

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now