[SWFObject] Using PHP with SWFObj

Geoff Stearns geoff at deconcept.com
Fri Dec 8 12:30:54 PST 2006


well if you can just post a link that's the best way to get help...  
we could keep guessing all night and probably never figure it out  
without just looking at the code :)



On Dec 8, 2006, at 3:17 PM, Matt S. wrote:

> yeah, It works fine with plain text. Its only when the PHP gets added
> that it breaks, and even then only in IE6 and lower.
>
> I'll keep playing with it and let y'all know if I figure it out.
>
> thanks,
>
> .m
>
> On 12/8/06, Steve Kamerman <kamermans at teratechnologies.net> wrote:
>>> Is it possible that because the PHP code appears BEFORE the  
>>> swfobject
>>> script, it gets processed as soon as the browser hits it, and then
>>> immediately afterwards the swfobject script does its thing as  
>>> well and
>>> generates the flash?
>>
>> Yes - that is how it works.  It shows the div by default but it is
>> immediately replaced with the flash content via Javascript.  What  
>> kind
>> of output is your PHP code generating in the div?  Can you try
>> commenting that PHP code out and just putting some plain text in  
>> there
>> to see if it's actually the content that's the problem?  If it is the
>> content itself, we will need to see it.
>>
>> Steve Kamerman
>> Director of IT
>> Tera Technologies
>>
>> -----Original Message-----
>> From: swfobject-bounces at lists.deconcept.com
>> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Matt S.
>> Sent: Friday, December 08, 2006 1:48 PM
>> To: swfobject at lists.deconcept.com
>> Subject: Re: [SWFObject] Using PHP with SWFObj
>>
>> it works fine in most browsers, and it works fine in ALL if I remove
>> the PHP code from flashcontent (as in your test below). In IE 6- is
>> the only browser where I end up with the flash object appearing, but
>> then the PHP-generated code appears below it.
>>
>> Is it possible that because the PHP code appears BEFORE the swfobject
>> script, it gets processed as soon as the browser hits it, and then
>> immediately afterwards the swfobject script does its thing as well  
>> and
>> generates the flash?
>>
>> thanks,
>>
>> ..m
>>
>> On 12/8/06, Steve Kamerman <kamermans at teratechnologies.net> wrote:
>>> Maybe you've got another div or element with the id  
>>> "flashcontent" or
>>> something.  You said you that you can still see the text in the
>>> flashcontent div - how?  wmode=transparent?  It should be completely
>>> replaced - it's my understanding that SWFObject overwrites the
>> innerHTML
>>> of whatever div you specify (flashcontent), this would completely
>> erase
>>> the initial contents of the div.  Are you getting any Javascript
>> errors
>>> on the page?  Can you isolate the problem by making a new test page
>> like
>>> this?:
>>>
>>> <html><head></head><body>
>>> <!--start flash header-->
>>>                 <div id="flashcontent">
>>>                 I should not see this
>>>                 </div>
>>>
>>>         <script type="text/javascript">
>>>                 // <![CDATA[
>>>
>>>                 var so = new
>>> SWFObject("http://www.someurl.com/dir/flashheader.swf",
>>> "header", "564", "150", "8", "#000000");
>>>                 so.addParam("scale", "noscale");
>>>                  so.addVariable("hdrtext", "This is a FlashVar");
>>>                 so.write("flashcontent");
>>>
>>>                 // ]]>
>>>         </script>
>>>
>>> <!--end flash header-->
>>> </body></html>
>>>
>>> Also, I would recommend using a relative path to your SWF to prevent
>> any
>>> cross domain issues (i.e. /dir/flashheader.swf ).
>>>
>>> Good luck!
>>>
>>> Steve Kamerman
>>> Director of IT
>>> Tera Technologies
>>>
>>> -----Original Message-----
>>> From: swfobject-bounces at lists.deconcept.com
>>> [mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Matt S.
>>> Sent: Friday, December 08, 2006 11:21 AM
>>> To: swfobject at lists.deconcept.com
>>> Subject: [SWFObject] Using PHP with SWFObj
>>>
>>> HI,
>>> so I'm trying to integrate SWFObject into a Wordpress blog, and it's
>>> been going fine, except for in IE (imagine that). I have the  
>>> following
>>> content:
>>>
>>> <!--start flash header-->
>>>                 <div id="flashcontent">
>>>                 <?php bloginfo('name'); ?>
>>>                 </div>
>>>
>>>         <script type="text/javascript">
>>>                 // <![CDATA[
>>>
>>>                 var so = new
>>> SWFObject("http://www.someurl.com/dir/flashheader.swf",
>>> "header", "564", "150", "8", "#000000");
>>>                 so.addParam("scale", "noscale");
>>>                  so.addVariable("hdrtext", "<?php bloginfo('name');
>>> ?>");
>>>                 so.write("flashcontent");
>>>
>>>                 // ]]>
>>>         </script>
>>>
>>> <!--end flash header-->
>>>
>>>
>>> And its working great, its passing in the blog name as a  
>>> variable, but
>>> the problem is that in IE  6 and older, the "<?php bloginfo('name');
>>> ?>" thats in "flashcontent", and should be appearing only if flash
>>> isnt present, is getting processed anyway, so what you end up  
>>> with is
>>> the flash object generated, but then under it the content  
>>> generated by
>>> the php gets inserted as well.
>>>
>>> The basic goal is that if flash is present, show the flash, and  
>>> if its
>>> not, run the PHP as Wordpress normally would. In this case  
>>> though, in
>>> IE 6, its doing both.
>>>
>>> Any suggestions much appreciated,
>>>
>>> thanks!
>>>
>>> ..m
>>> _______________________________________________
>>> 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
>>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list