[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Adobe Flash CS4 ActionScript URL relative-path

Posted on 2009-04-29
Medium Priority
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 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 &

Question by:Moodynet

Accepted Solution

mharfouch earned 750 total points
ID: 24266842
just put the entire URL
LVL 34

Assisted Solution

by:Aneesh Chopra
Aneesh Chopra earned 750 total points
ID: 24269219
try this:

"../" to come out a folder.

complete code would be:

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

Author Comment

ID: 24329778
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

872 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