[SWFObject] Audio Flash Player

Patricia Davidson pddesigns at gmail.com
Sun Nov 19 17:16:04 PST 2006


I understand what you are saying and by looking at the output file, I
can see where it is looking for the particular file and can't find it,
except the first one.

Here is an example in another blog (EE by pMachine ) where I've added
a Flash video player and used swfOject for it.

Since we are dealing with php programming, this site is set up to
display the player whenever a movie is detected.  So I used one div,
but the programming says to look for the file - hope that makes sense.
http://www.mikenpat.com/index.php/site/fire_on_the_chetco/

here is the output code if you view source:
<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new
SWFObject("http://www.mikenpat.com/player/flvplayer.swf?file=http://mikenpat.com/movies/bike_ride_video.flv&autoStart=true",
"mymovie", "320", "240", "7", "#f9f8f2");
   so.write("flashcontent");
   so.addParam("wmode", "transparent");
</script>

Now what the script looks like in the page template through EE:

{if flvideo}
<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new
SWFObject("http://www.mikenpat.com/player/flvplayer.swf?file={flvideo}&autoStart=true",
"mymovie", "320", "240", "7", "#f9f8f2");
   so.write("flashcontent");
   so.addParam("wmode", "transparent");
</script>
{/if}

So using this as an example, I'm assuming that I can do something to
tell the programming to look for the particular file that is within
each blog entry.

Back to Gold Beach youth group site.  I thought I could do something like this:
{if audioplayer != ""}
<div id="flashcontent">
  This text is replaced by the Flash Audio Player.
</div>

<script type="text/javascript">
       var so = new
SWFObject("http://goldbeachyouthgroup.com/player/player.swf",
"audioplayer2", "290", "24", "7");
        so.addVariable("soundFile",
"http://goldbeachyouthgroup.com/player/player.swf?file={audioplayer}");
       so.addVariable("bg", "0xDDA246");
       so.addVariable("slider", "0xAF0000");
       so.addVariable("track", "0xFFFFFF");
       so.addVariable("border", "0xFFFFFF");
       so.addVariable("loader", "0x790022");
       so.addParam("wmode", "transparent");
       so.addParam("menu", "false");
       so.write("flashcontent");
</script>
{/if}


Since the tempate / page template only has this item once but will
display whenever and audio is detected within an entry.  Does that
make better sense where I"m at with this?  I've tried posting to EE
forum, but maybe no one is using swfOject and doesn't understand what
I'm trying to do.

Thanks for the help.

Pat :)

On 11/19/06, Aran Rhee <aran.rhee at qdc.net.au> wrote:
> Patricia.
>
> Remember from my last email when I said you needed to have individual names
> for your DIV's for each audio player to write into? This is an error cause
> by all your DIV's are called "flashcontent". Each definition of swfObejct is
> trying to write to that DIV (and overwriting the content with the last file
> to render to screen)
>
> Can you get the expression engine to tack on a counter "flashcontent1",
> "flashcontent2" etc to each DIV? Out of good practice, you should really
> uniquely ID each flash file too "audioplayer1", "audioplayer2" etc.
>
>
> Regards,
> Aran
>
>
>
> > -----Original Message-----
> > From: swfobject-bounces at lists.deconcept.com
> > [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of
> > Patricia Davidson
> > Sent: Monday, 20 November 2006 11:48 AM
> > To: swfobject at lists.deconcept.com
> > Subject: Re: [SWFObject] Audio Flash Player
> >
> > I am posting again, even though Aran helped me with this
> > website.  I am having an issue though with IE 6.  My flash
> > player (swfOject wrapped around it) is set up within the
> > pMachine Expression Engine programming.  What's happening is
> > that the flash audio player will not display for all my
> > clients audio teachings in IE6.  The first audio displays,
> > not not the next couple of ones.  In Firefox it is displaying
> > correctly.
> >
> > here's my site again:
> > http://goldbeachyouthgroup.com/index.php/site/teachings
> >
> > here is the code with swfOject:
> >
> > {if audioplayer != ""}
> > <div id="flashcontent">
> >   This text is replaced by the Flash Audio Player.
> > </div>
> >
> > <script type="text/javascript">
> >        var so = new
> > SWFObject("http://goldbeachyouthgroup.com/player/player.swf",
> > "audioplayer2", "290", "24", "7");
> >         so.addVariable("soundFile",
> > "http://goldbeachyouthgroup.com/player/{audioplayer}");
> >        so.addVariable("bg", "0xDDA246");
> >        so.addVariable("slider", "0xAF0000");
> >        so.addVariable("track", "0xFFFFFF");
> >        so.addVariable("border", "0xFFFFFF");
> >        so.addVariable("loader", "0x790022");
> >        so.addParam("wmode", "transparent");
> >        so.addParam("menu", "false");
> >        so.write("flashcontent");
> > </script>
> > {/if}
> >
> >
> > Thanks, Pat :)
> > _______________________________________________
> > SWFObject mailing list
> > SWFObject at lists.deconcept.com
> > http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>


-- 
Patricia Davidson
PD Designs
http://pddesigns.com
Web Design ~ E-Commerce ~ Hosting



More information about the Swfobject mailing list