[SWFObject] Adding vars to SWFobject in Flash runtime

Danya Henninger danya at imagicdigital.com
Wed Jun 28 15:38:02 PDT 2006


I guess this is getting off the SWFObject topic.  But (somewhat) briefly,
your code is Flash should have something like:

//
function playVideo(vidToPlay){
    flv_player.contentPath = vidToPlay;
}
//

Then, because of the Callback you've registered (in my previous posts), the
JS function "playVideo" will call the Flash function "playVideo".  Whatever
string you pass to the JS function will be passed to your Flash function.
So if you have:
<a href="#" onclick="callFlashPlayVideo('flv/video2.flv')" > See other movie
</a>
that will pass the string "flv/video2.flv" to your function in Flash, which
will be passed as (vidToPlay) and end up evaluating like this when you click
the link:

flv_player.contentPath = "flv/video2.flv"

Since you want the player to start out with a certain video playing already,
before anything is clicked, you'll pass that string in with the
so.addVariable parameter as "flv_path" so it's available when the SWF first
loads.

Instead of writing this line:  flv_player.contentPath = _root.flv_path;

Write this line: playVideo(_root.flv_path);

HTH

-- 
Danya Henninger
Imagic  |   www.imagicdigital.com


> Date: Wed, 28 Jun 2006 13:24:38 +0200
> From: "Martin Eiler | Cumuli" < martin at cumuli.net>
> Subject: Re: [SWFObject] Adding vars to SWFobject in Flash runtime
>
> Hi
>
> Thank you Danya for your reply. It was exactly the stuff I was looking
> for.
>
> I stille have a small problem with the code. I can?t get the
> ExternalInterface in flash to work.
>
> Basicly I have an instance of the flash video component 8 on my stage
> called
> flv_player.
>
> Previously I used the action:  flv_player.contentPath = _root.flv_path;
> to
> set the paht to the flv-file.
>
> So my problem is that I can?t figure out what vars I get from the
> javascript, and how to handle them inside flash.
>
> Regards Martin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060628/19bcd27f/attachment-0005.htm>


More information about the Swfobject mailing list