View Full Version : onload get var from asp
and#77
10-29-2003, 10:25 PM
I have a file called main.asp
in this file I have a flash movie. This flash move loads different products by loading different swf's into the main file.
What I wanted to do, to save downloading multiple versions of the main file is when the page loads have the asp send a var to the flash file which will trigger flash to load the coresponding product .swf.
Can I do this to select which productarea I want? - main.asp?productarea=bikes
Then how do I get the main swf to load the var from the asp page (the same asp page that the flash file is imbeded in) ?
thanks for your help
freddycodes
10-30-2003, 12:36 AM
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>foo</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="550" HEIGHT="400" id="foo" ALIGN="">
<PARAM NAME=movie VALUE="foo.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<PARAM NAME=flashvars VALUE="productarea=<%=Request("productarea")%>"> <EMBED src="foo.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="foo" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" FLASHVARS="productarea=<%=Request("productarea")%>"></EMBED>
</OBJECT>
</BODY>
</HTML>
By using FLASHVARS you can have access to productarea in your flash movie by using the above code.
Your url would look like something.asp?productarea=underwear
and#77
10-30-2003, 01:28 AM
thanks looks good :)
will that work with a flash 5 player?
freddycodes
10-30-2003, 01:33 AM
No.
You'll need to use a query string on the swf itself for flash 5.
<%@ Language=VBScript %>
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>foo</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="550" HEIGHT="400" id="foo" ALIGN="">
<PARAM NAME=movie VALUE="foo.swf?productarea=<%=Request("productarea")%>"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="foo.swf?productarea=<%=Request("productarea")%>" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="foo" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ></EMBED>
</OBJECT>
</BODY>
</HTML>
and#77
10-30-2003, 01:34 AM
just found out it is only for fp6 <
Is there any other way I can do this so it will work with a flash 5 player ?
thanks for your help
freddycodes
10-30-2003, 01:41 AM
See my last post.
and#77
10-30-2003, 01:52 AM
then that will load a new .swf every time wont it ?
and how does the flash file get the value of the var?
thankyou again for your fast replies
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.