Skip to main content
Participant
November 9, 2006
Question

Loading Variables from ASP into Flash

  • November 9, 2006
  • 1 reply
  • 239 views
I can find plenty of tutorials detailing how to load variables from a defined asp page into Flash, but here's my dilemma...

I have an asp page that is reading a URL with a unique identifier in it (www.sampleURL.com?id=123456), and then turns the id number from the URL into a variable. On the same page then, sits my swf where I need to use LoadVars to pull in that ASP variable via Actionscript. If I don't have a static asp page to pull the variables in from and I want to pass the variable within the same asp page the swf is located on, how do I do it? Many thanks in advance...
This topic has been closed for replies.

1 reply

Inspiring
November 9, 2006

"bonzomn65" <webforumsuser@macromedia.com> wrote in message
news:ej0630$pjh$1@forums.macromedia.com...
>I can find plenty of tutorials detailing how to load variables from a
>defined
> asp page into Flash, but here's my dilemma...
>
> I have an asp page that is reading a URL with a unique identifier in it
> (www.sampleURL.com?id=123456), and then turns the id number from the URL
> into a
> variable. On the same page then, sits my swf where I need to use LoadVars
> to
> pull in that ASP variable via Actionscript. If I don't have a static asp
> page
> to pull the variables in from and I want to pass the variable within the
> same
> asp page the swf is located on, how do I do it? Many thanks in advance...
>

You don't need LoadVars for this at all. You can just pass the variable to
your Flash movie by specifying a query string when you are calling the
movie.

If you are using the straight object, embed method then it would look
something like this:

<param name="movie" value="movie.swf?id=11111">
<embed src="movie.swf?id=11111" ... >

If you are using the ActiveContent JavaScript for your movie then you just
leave off the .swf... so
"name", "movie?id=11111"

Then, in flash you can access the value of id from the _root, like
var idInFlash:Number = _root.id;

Of course in the above example you would replace 11111 with the proper
syntax for printing a variable's value in ASP.