[SWFObject] ExternalInterface and FLVPlayBack

Aran Rhee aran.rhee at qdc.net.au
Mon Aug 14 23:52:16 PDT 2006


Tim.
 
The onClick handler of the image would call a JavaScript function just like
the pressing of the form submit button does at present (in Geoff's example =
updateText(); ).
 
function updateText() {
         if (flashMovie) {
            var txt = document.getElementById("textarea").value;
            flashMovie.updateText(txt);
         }
      }
 
your video function might be something like:
 
function updateContentPath(path) {
         if (flashMovie) {
            flashMovie.updateContentPath(path);
         }
      }
 
And you would call it on your image like:
<a href="#"><img src="some.gif"
onClick='updateContentPath("some\FLV\location\vid.flv");'/></a>
 
 
 
In flash you would add your external interface callback(s), and define a
function within flash that would actually change the content path and play
the vid:
 
var ei1 = flash.external.ExternalInterface.addCallback("updateContentPath",
null, updateContentPath);

function updateContentPath (path)
{
    flv_playback.contentPath = path;
    flv_playback.play();
}

//this function assumes you have a flvplayback component on the stage called
"flv_playback".

 

Now this is all untested, but that is the general idea...Hope that helps,

Aran

 


  _____  

From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of ReDrUm
Sent: Tuesday, 15 August 2006 12:59 PM
To: swfobject at lists.deconcept.com
Subject: [SWFObject] ExternalInterface and FLVPlayBack


Hi All,
 
I'm wondering how to dynamically change the FLVplayback.contentPath using
the ExternalInterface in Flash 8 and swfObject via a webpage. Looking at
geoffs example of externalInterface from August 05, im having a little
difficulty following it without the source files which were lost. 
How would i setup my swf/js to change the contentPath onclick of an image
rather than a form?
 
E.g. <img onclick=""> thumbnails on the website with some kind of onclick to
set the contentPath of the appropriate video, which in turn loads inside my
swf via the FLVplayback component.
 
Is this very simple? any/all help much appreciated.
 
Cheers,

-- 
Tim Keir

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060815/d4ff762a/attachment-0005.htm>


More information about the Swfobject mailing list