[SWFObject] .net 2.0 and swfObject

Aran Rhee aran.rhee at qdc.net.au
Wed Nov 1 20:42:31 PST 2006


Matt

You shouldn't need to append the  ?whatDestination="emailFlashForm" to the
source file location. It just needs to passed in using the addVariable()
function.

Just do something like:

<head>
	<script src="swfObject.js" language="javascript"></script>
</head>
.
.
.
<body>
<div id="flashcontent">
	Alt content goes here...
</div> 

<script type="text/javascript"> 
	var so = new SWFObject("/swf/emailFlashForm.swf", "262", "62", "7",
"#ffffff"); 	so.addVariable("whatDestination", whatDestination);
	so.write("flashcontent")
</script>
</body>

I am not a c# guy (or .NET full stop for that matter), so I am not 100% of
what access you have to your code behind vars, but if it is available to the
page you should be able to insert it by name as above. If it was part of the
session, you could pass it in like:

so.addVariable("whatDestination", Session["whatDestination"]);

I believe you could also get to the http request object if required by doing
something like:

so.addVariable("whatDestination", Request["whatDestination"];);


Hope this helps.


Cheers,
Aran

> -----Original Message-----
> From: swfobject-bounces at lists.deconcept.com 
> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Matt .
> Sent: Thursday, 2 November 2006 11:30 AM
> To: swfobject at lists.deconcept.com
> Subject: [SWFObject] .net 2.0 and swfObject
> 
> Im trying to dynamically include a variable into my flash file.
> 
> I have a variable defined in the code-behind (aspx.cs file) 
> file which is  
> -- >    whatDestination = "Las Vegas".
> 
> Now I need to get the variable into the aspx. file. This is 
> what I have so far.....
> 
> <script type="text/javascript" 
> src="/swf/swfobject.js"></script> <div 
> id="flashcontent"></div> <script type="text/javascript"> var 
> so = new SWFObject("/swf/emailFlashForm.swf?whatDestination=",
> "emailFlashForm", "262", "62", "7", "#ffffff"); 
> so.addParam("quality", "high"); so.addVariable("whatDestination", ?);
> so.write("flashcontent")
> </script>
> 
> The part with the question mark is where I need help. Thanks!!
> 
> _________________________________________________________________
> Get today's hot entertainment gossip
> http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001
> 
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com



More information about the Swfobject mailing list