How To Encode a Flash Parameter in Python
I'm trying to generate an embeded flash widget on a page with Python using a dynamic parameter. Here's the code I currently have...
<embed src='http://musiclibre.org/dark_player' width='200' height='500' wmode='transparent' flashVars='http://pipes.yahoo.com/pipes/pipe.run?_id=39d7e59de5284e033c7019e12f02467b&artist={{query}}&autoplay=1' type='application/x-shockwave-flash' pluginsp开发者_Go百科age='http://www.adobe.com/go/getflashplayer'/>
The {{query}} parameter is passed through as a URL parameter. I'm not very technical, but I think the query value needs to be encoded for the flash to work. How do I encode the flash parameter?
The flashvars
are encoded as a standard URL query string. You can use Python's urllib.parse module to easily convert your string into this format.
From Flash you can access flashvars
using the FlexGlobals.topLevelApplication.parameters
dictionary (Application.application.parameters
if you are using an older SDK).
精彩评论