Swapping out videos

1 view
Skip to first unread message

Derek

unread,
Jul 21, 2008, 2:03:01 PM7/21/08
to SWFObject
Hi Guys,

I am using swfobject2 to show an swf inside a div. (.swf calls .flv
file, default cs3 flash import wizard stuff)

I would like to have two clickable plaintext links on the same page,
that would allow me to swap the video in the div.

Target behavior:

Default Load: Video1

onclick "Video 2 link" , show video 2
onlick "video 1 link", show video 1

I have been looking for a way to do this, but I haven't found a top-to-
bottom swfobject2 video swap tutorial anywhere.

Thank you for your time, any help would be much appreciated.

Getify Solutions

unread,
Jul 21, 2008, 2:38:48 PM7/21/08
to swfo...@googlegroups.com
Probably the reason no such "top-to-bottom tutorial" exists for this task is
that the most likely (and probably most efficient) way to tell the SWF to
pick a different FLV file to display completely depends on which player you
are using. I've seen reference many times on this list to "JW Player" which
is a very commonly used flv player swf that *does* have the ability to both
pass parameters and call functions on it which can tell the player to switch
to a new FLV file. You might consider looking into that one.

If you are just using a standard FLVPlayback component publish from the
Flash IDE, and you've not specifically built in any actionscript code to do
so, than by default your swf will not have such capability, meaning it is
only capable of displaying the one and only FLV that it knows about at
compilation time.

Here's a tutorial video which covers a lot of SWFObject stuff and some basic
actionscript stuff to set up a SWF to be able to receive a parameter at
embed time. http://www.gotoandlearn.com/player.php?id=77

This is a good place to start, but that alone will *not* get you the ability
to switch FLV's on the fly, without reloading the page or something of that
sort. To do that, you'd have to get more in-depth, by exposing some sort of
callback function (fscommand, ExternalInterface, etc) that your javascript
could call and pass in a new FLV url parameter for each button/link.

In all cases, this type of request, while common here, is really a bit
off-topic for the list because we deal with specifically supporting
SWFObject usage and issues, and your request is much more in the realm of
Actionscript and HTML/Javascript authoring. If what I've presented here
doesn't turn out to be enough to get you on the right track, you could look
into the forums at kirupa.com or actionscript.org for more help with that
kind of authoring.


--Kyle

--------------------------------------------------
From: "Derek" <leur...@gmail.com>
Sent: Monday, July 21, 2008 1:03 PM
To: "SWFObject" <swfo...@googlegroups.com>
Subject: Swapping out videos

Reply all
Reply to author
Forward
0 new messages