# Help with links

**URL:** https://forum.kirupa.com/t/help-with-links/22069
**Category:** Uncategorized
**Created:** [May 29, 2003, 8:19pm UTC](https://forum.kirupa.com/t/help-with-links/22069 "2003-05-29T20:19:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jazzman121](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jazzman121/32/127_2.png) [@jazzman121](https://forum.kirupa.com/u/jazzman121)
#### Post date: [May 29, 2003, 8:19pm UTC](https://forum.kirupa.com/t/help-with-links/22069/1 "2003-05-29T20:19:00Z")

</div>

this is what i wanna do… when i make website… I use variable names for each page i load… soo there is one frame… that checks what the **page\_status** variable value is… and if that value is **“page1”** it loads page1.swf… if its\*\* “page2”\*\* it loads page2.swf…  
and so on…  
what i wanna do is… make my website soo that… i can give direct links too specific pages… for eg… if i want i can give a direct link in html … so that… when clicked it loads the **main\_page.swf** … with the loaded swf… depending on the link i gave… for eg… i can give a link…

[www.mywebsite.com/main.swf?page\_status=page2](http://www.mywebsite.com/main.swf?page_status=page2)

soo that should direcly load page2.swf into my main\_page.swf…

how can i do this??? please help

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 29, 2003, 10:55pm UTC](https://forum.kirupa.com/t/help-with-links/22069/2 "2003-05-29T22:55:00Z")

</div>

Hi there,

The only time Flash can read URL variables is if they are embedded in the html document which first instantiates the .swf:

```auto

&lt;embed src="myMovie.swf?myURLVar=hello%20World"&gt;
etc...

```

If you did that, then “myURLVar” would be available to the entire .swf.

This is the “FlashVars” approach ([http://www.macromedia.com/support/flash/ts/documents/flashvars.htm](http://www.macromedia.com/support/flash/ts/documents/flashvars.htm)). This sounds to me like what you’re after.

Your html would have “main.swf?page\_status=2”. Then your main.swf would have this code:

```auto

switch (page_status) {
  case "1":
    this.loadMovie("page1.swf");
    break;
  case "2":
    this.loadMovie("page2.swf");
    break;
  case "3":
    this.loadMovie("page3.swf");
    break;
  etc...
} // end switch (page_status)

```

That kind of thing should work.

However, you cannot include url query strings _inside_ a .swf.

When you use mc.loadMovie(), for example, you can’t pass URL variables in the same manner, at least not as a url query string.

If you try this:

```auto

this.loadMovie("myMovie.swf?myURLVar=hello%20world");

```

you get an error, because the Flash Player can’t resolve a url query string.

On the other hand, if you use loadMovieNum (or use the global loadMovie() with \_levels) and use the “GET” or “POST” method, you can send variables to a script that can then load a .swf, but this script is not a .swf.

Also, see this thread:  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24622](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24622)
