Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] Ming and flash detection

0 views
Skip to first unread message

Jason Stechschulte

unread,
Apr 2, 2001, 10:58:42 AM4/2/01
to
Hi, I'm having a problem writing a flash detector, and was hoping
someone would help. I had one working that I created with Flash 4, but
it would fetch another webpage after loading so that it knew where to
redirect to. So it looked like:

PHP embeds FLASH ---> load variables from PHP ----> redirects to correct
page.

If FLASH wouldn't load, then javascript or a http refresh header would
send them elsewhere.

I'm trying to use Ming to eliminate the load variables from PHP
portion. That way once the FLASH file loads, it will redirect, and you
won't have to wait for the program to go to the server and load more
variables. Here is the code I'm using:

<brokencode>
<?php

// $load is a variable that is passed in the embed tag ex:
// <embed src=detectflash.php?load=<?=$PHP_SELF?>>
$thisURL = "$load?hasflash=yes";
Ming_setScale(1.0);

// Create a very small movie with a white background.
$m = new SWFMovie();
$m->setBackground(0xff, 0xff, 0xff);
$m->setDimension(18, 18);

// This movie simply redirects to the appropriate page.
$m->add(new SWFAction("getURL('$thisURL', ''); stop();"));
$m->nextFrame();
$m->add(new SWFAction("play();"));

header('Content-type: application/x-shockwave-flash');
$m->output();
?>
</brokencode>

So far I've tested this in 3 browsers all on Windows 2000.
IE5 - works just fine.
Opera 5 - works just fine.
Netscape 4.08 - Never redirects.

I added code to write $thisURL to a file so I could see if it is getting
passed correctly, and it is. So there must be a problem with the movie
somewhere. In the getURL() function, I have tried many different things
for the second argument. _self, _parent, _top. None of these makes any
difference. Anyone have any ideas I could try??

--
Jason Stechschulte
University of Northwestern Ohio
jps...@unoh.edu
(419)998-3108
--
When it's dark enough you can see the stars.
-- Ralph Waldo Emerson,

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net

Chris Adams

unread,
Apr 2, 2001, 11:54:56 AM4/2/01
to
On 2 Apr 2001 07:58:42 -0700, Jason Stechschulte <jps...@unoh.edu> wrote:
>// This movie simply redirects to the appropriate page.
>$m->add(new SWFAction("getURL('$thisURL', ''); stop();"));

>I added code to write $thisURL to a file so I could see if it is getting


>passed correctly, and it is. So there must be a problem with the movie
>somewhere. In the getURL() function, I have tried many different things
>for the second argument. _self, _parent, _top. None of these makes any
>difference. Anyone have any ideas I could try??

Try _level0 - that's what you'd need to replace the current movie.

Alternately, you can avoid needing to load Flash at all - use JavaScript to
iterate over the plugins array on Netscape and use VBScript with an On Error
handler to instantiate the Flash ActiveX control - if it fails, your VBScript
can assume Flash isn't installed (which is the sane default).

Jason Stechschulte

unread,
Apr 2, 2001, 1:41:43 PM4/2/01
to
On Mon, Apr 02, 2001 at 08:41:29AM -0700, Chris Adams wrote:
> On 2 Apr 2001 07:58:42 -0700, Jason Stechschulte <jps...@unoh.edu> wrote:
> >// This movie simply redirects to the appropriate page.
> >$m->add(new SWFAction("getURL('$thisURL', ''); stop();"));
>
> >I added code to write $thisURL to a file so I could see if it is getting
> >passed correctly, and it is. So there must be a problem with the movie
> >somewhere. In the getURL() function, I have tried many different things
> >for the second argument. _self, _parent, _top. None of these makes any
> >difference. Anyone have any ideas I could try??
>
> Try _level0 - that's what you'd need to replace the current movie.

I forgot to mention that I've also tried the different _level* arguemnts
too. _level0 actually breaks IE and still doesn't work in Netscape.

> Alternately, you can avoid needing to load Flash at all - use JavaScript to
> iterate over the plugins array on Netscape and use VBScript with an On Error
> handler to instantiate the Flash ActiveX control - if it fails, your VBScript
> can assume Flash isn't installed (which is the sane default).

I guess I will just have to implement this solution. I was hoping to do
it using Ming just to help familiarize myself with it, but this will
probably be more efficient than how it is being done today.

--
Jason Stechschulte
jps...@unoh.edu
--
If you consistently take an antagonistic approach, however, people are
going to start thinking you're from New York. :-)
-- Larry Wall to Dan Bernstein in <10...@jpl-devvax.JPL.NASA.GOV>

0 new messages