Adobe Flash CS4 ActionScript URL relative-path

Posted on 2009-04-29
Last Modified: 2013-11-17
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 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: which is an error due to double //

Where it should be, AFAIK,

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

Thank you for ant reply &

Question by:Moodynet
    LVL 3

    Accepted Solution

    just put the entire URL
    LVL 34

    Assisted Solution

    by:Aneesh Chopra
    try this:

    "../" to come out a folder.

    complete code would be:

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

    Author Comment

    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


    Featured Post

    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!

    Join & Write a Comment

    When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure ( It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Click on Too…
    The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Go t…

    754 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

    17 Experts available now in Live!

    Get 1:1 Help Now