# Passing variable into flash via ASP

**URL:** <https://forum.kirupa.com/t/passing-variable-into-flash-via-asp/235997>\
**Category:** Uncategorized\
**Created:** [August 16, 2007, 11:44am UTC](https://forum.kirupa.com/t/passing-variable-into-flash-via-asp/235997 "2007-08-16T11:44:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navarone](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Navarone](https://forum.kirupa.com/u/Navarone)\
**Post date:** [August 16, 2007, 11:44am UTC](https://forum.kirupa.com/t/passing-variable-into-flash-via-asp/235997/1 "2007-08-16T11:44:40Z")

</div>

I have a web page that has text links on the left and I need to pass into my flash piece a variable so flash knows what movie to play. (see attached)

How do I set the html link so that flash reads in the correct value?

I was thinking in my asp I would have something like  
\<a href=“aboutua.asp?movie=Chapter\_1512K\_Stream.flv”\>

\<%  
if request(“movie”)= “” or request(“movie”)= “Chapter\_1512K\_Stream.flv” then  
movie=“Chapter\_1512K\_Stream.flv”  
elseif request(“movie”) = “movie=“Chapter\_2512K\_Stream.flv”” then  
movie=“Chapter\_2512K\_Stream.flv”  
…  
end if  
%\>

my flash code

```auto

[COLOR=#993300]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#f000f0]*// change title *[/COLOR]
[COLOR=#993300]_global[/COLOR].[COLOR=#000000]changeTitle[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]title:[COLOR=#993300]String[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*// set chapter text*[/COLOR]
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]vid[/COLOR].[COLOR=#000000]title[/COLOR].[COLOR=#993300]autoSize[/COLOR] = [COLOR=#993300]true[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]vid[/COLOR].[COLOR=#000000]title[/COLOR].[COLOR=#993300]text[/COLOR] = title;
    [COLOR=#f000f0]*// shadow text*[/COLOR]
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]vid[/COLOR].[COLOR=#000000]title2[/COLOR].[COLOR=#993300]autoSize[/COLOR] = [COLOR=#993300]true[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]vid[/COLOR].[COLOR=#000000]title2[/COLOR].[COLOR=#993300]text[/COLOR] = title;
[COLOR=#000000]}[/COLOR];
changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Our Focus..Caring for Life."[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#f000f0]*//*[/COLOR]
[COLOR=#f000f0]*// create the array of filenames*[/COLOR]
[COLOR=#993300]var[/COLOR] vidList:[COLOR=#993300]Array[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Array[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"Chapter_1512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_2512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_3512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_4512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_5512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_6512K_Stream.flv"[/COLOR], [COLOR=#0000ff]"Chapter_7512K_Stream.flv"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#f000f0]*// set the current video id*[/COLOR]
[COLOR=#993300]var[/COLOR] currentVideo:[COLOR=#993300]Number[/COLOR] = [COLOR=#000000]0[/COLOR];
[COLOR=#f000f0]*// create the listener for the media*[/COLOR]
[COLOR=#993300]var[/COLOR] myListener:[COLOR=#993300]Object[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Object[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] referrer = [COLOR=#993300]this[/COLOR];
[COLOR=#f000f0]*// set up the listener*[/COLOR]
myListener.[COLOR=#000000]complete[/COLOR] = [COLOR=#993300]function[/COLOR][COLOR=#000000]([/COLOR]eventObject[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"media is Finished"[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*// increment the current video*[/COLOR]
    referrer.[COLOR=#000000]currentVideo[/COLOR]++;
    [COLOR=#f000f0]*// play the next one*[/COLOR]
    referrer.[COLOR=#000000]playMovie[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]addEventListener[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"complete"[/COLOR], myListener[COLOR=#000000])[/COLOR];
setupMedia[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
playMovie[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#f000f0]*// only has to set the player settings once*[/COLOR]
[COLOR=#993300]function[/COLOR] setupMedia[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#993300]Void[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#993300]stop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]autoPlay[/COLOR] = [COLOR=#993300]true[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]activePlayControl[/COLOR] = [COLOR=#993300]true[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]controllerPolicy[/COLOR] = [COLOR=#0000ff]'on'[/COLOR];
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_controller[/COLOR].[COLOR=#000000]volume[/COLOR] = [COLOR=#000000]100[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#f000f0]*// set the media to the current video and play it*[/COLOR]
[COLOR=#993300]function[/COLOR] playMovie[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#993300]Void[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]setMedia[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"videos/"[/COLOR]+referrer.[COLOR=#000000]vidList[/COLOR][COLOR=#000000][[/COLOR]currentVideo[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*//*[/COLOR]
    [COLOR=#f000f0]*//trace(referrer.vidList[currentVideo]); *[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Our Focus..Caring for Life."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]1[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"A Message from our CEO."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Our 24/7/365 Pharmacy."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]3[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Physicians Continue to Praise Our Clinical Excellence."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]4[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Referral Sources Talk about Our Dependability and Service."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]5[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Our Patients Understand that it's about People!"[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]6[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Clinical Excellence...Medical Service Company Professionals."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#f000f0]*//start over after call to action*[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]currentVideo == [COLOR=#000000]7[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR]currentVideo[COLOR=#000000])[/COLOR]
        currentVideo = [COLOR=#000000]0[/COLOR];
        [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#000000]setMedia[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]"videos/"[/COLOR]+referrer.[COLOR=#000000]vidList[/COLOR][COLOR=#000000][[/COLOR]currentVideo[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR]
        [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#993300]play[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR];
        changeTitle[COLOR=#000000]([/COLOR][COLOR=#0000ff]"Our Focus..Caring for Life."[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#f000f0]*//*[/COLOR]
    [COLOR=#993300]_root[/COLOR].[COLOR=#000000]my_video[/COLOR].[COLOR=#993300]play[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]

```
