Within my site I have the following code:-
By default when my site loads the flash file gets the value of currentItem from Flashvars and does what it needs to do with this value. The flash file in question is just a basic video player and the id of the video to be played is retrieved from flashvars.Code:<form> <button onClick="changeVideo(2)" type="button"/> </form> <object id="videoPlayer" type="application/x-shockwave-flash" data="http://www.mysite.com/videoplayer.swf"> <param name="movie" value="http://www.mysite.com/videoplayer.swf" /> <param name="allowscriptaccess" value="always" /> <param name="FlashVars" value="currentVideo=1" /> </object>
However I want users to now be able to click the button in my form and then the value of flashvars in my videoPlayer object will change to the value passed in the changeVideo() function i.e. in the above example value="currentVideo=1" will become value="currentVideo=2".
That's the easy part I think but what I then need to do is get the flash file itself to load this video without a page refresh but I have no idea how to get the flash file to recognise this value once it has already loaded. What exactly are my best options here?:-
1. Reload the flash component via ajax every time a user selects a new video i.e. every time changeVideo() is fired?
2. Something else?


Reply With Quote
Bookmarks