Jeash render priority

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Jeash render priority

Confidant
Just getting into using Jeash and I have compiled both a .js and a .swf. Now I'm trying to modify the rendering priority as described at http://haxe.org/com/libs/jeash/tweak

Unfortunately I can't get the swf to be the default; it always defaults to canvas. Thoughts anyone? HTML below.

<html>
    <head>
        <title>My first Jeash example</title>
    </head>
    <body>
        <div id="haxe:jeash" data-priority="swf(JeashTest.swf):2d"></div>
        <script type="text/javascript" src="JeashTest.js"></script>
    </body>
</html>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Jeash render priority

Niel Drummond-3
On 05/17/11 18:41, Allan Dowdeswell wrote:
Just getting into using Jeash and I have compiled both a .js and a .swf. Now I'm trying to modify the rendering priority as described at http://haxe.org/com/libs/jeash/tweak

Unfortunately I can't get the swf to be the default; it always defaults to canvas. Thoughts anyone? HTML below.

<html>
    <head>
        <title>My first Jeash example</title>
    </head>
    <body>
        <div id="haxe:jeash" data-priority="swf(JeashTest.swf):2d"></div>
        <script type="text/javascript" src="JeashTest.js"></script>
    </body>
</html>

Hi Allan,

Sorry to report that the priority system was recently dropped from jeash.

Although your goal is quite a common use case, the way it worked before was a little silly because it loaded the entire flash hierarchy in javascript and in flash.

There are other (arguably technically better) ways of doing this, like using a wrapper script that checks for the flash plugin and appropriately calls swfobject or appends a script node to the document.

Hope that helps,

- Niel

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Jeash render priority

David Peek
Hi Allan,

Here's a snippet I use for switching between swf/js

It's testing for a particular version of flash (10.0.0 in this case) and also allows you to force canvas using a query param (http://domain.com/?flash=0)

It's using the latest version of SWFObject.

HTH
dp

<script type="text/javascript" charset="utf-8">
if (SWFObject.getQueryParamValue("flash") != "0" && SWFObject.hasFlashPlayerVersion("10.0.0"))
{
SWFObject.embedSWF("JeashTest.swf", "haxe:jeash", "100%", "100%", "10.0.0", "ExpressInstall.swf", {}, {allowscriptaccess:true,allowfullscreen:true,allownetworking:true,wmode:"opaque"}, {});
}
else
{
var app = document.createElement("script");
app.setAttribute("type","text/javascript");
app.setAttribute("src", "JeashTest.js");
document.getElementsByTagName("head")[0].appendChild(app)
}
</script>

On 18/05/2011, at 4:01 AM, Niel Drummond wrote:

On 05/17/11 18:41, Allan Dowdeswell wrote:
Just getting into using Jeash and I have compiled both a .js and a .swf. Now I'm trying to modify the rendering priority as described at http://haxe.org/com/libs/jeash/tweak

Unfortunately I can't get the swf to be the default; it always defaults to canvas. Thoughts anyone? HTML below.

<html>
    <head>
        <title>My first Jeash example</title>
    </head>
    <body>
        <div id="haxe:jeash" data-priority="swf(JeashTest.swf):2d"></div>
        <script type="text/javascript" src="JeashTest.js"></script>
    </body>
</html>

Hi Allan,

Sorry to report that the priority system was recently dropped from jeash.

Although your goal is quite a common use case, the way it worked before was a little silly because it loaded the entire flash hierarchy in javascript and in flash.

There are other (arguably technically better) ways of doing this, like using a wrapper script that checks for the flash plugin and appropriately calls swfobject or appends a script node to the document.

Hope that helps,

- Niel
--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Jeash render priority

Confidant
In reply to this post by Confidant
That's absolutely perfect, Dave, thanks! Went straight to my SpringPad for future use. :)
-Allan

On 17-May-11, at 9:45 PM, [hidden email] wrote:


Here's a snippet I use for switching between swf/js

It's testing for a particular version of flash (10.0.0 in this case) and also allows you to force canvas using a query param (http://domain.com/?flash=0)

It's using the latest version of SWFObject.

HTH
dp

<script type="text/javascript" charset="utf-8">
if (SWFObject.getQueryParamValue("flash") != "0" && SWFObject.hasFlashPlayerVersion("10.0.0"))
{
SWFObject.embedSWF("JeashTest.swf", "haxe:jeash", "100%", "100%", "10.0.0", "ExpressInstall.swf", {}, {allowscriptaccess:true,allowfullscreen:true,allownetworking:true,wmode:"opaque"}, {});
}
else
{
var app = document.createElement("script");
app.setAttribute("type","text/javascript");
app.setAttribute("src", "JeashTest.js");
document.getElementsByTagName("head")[0].appendChild(app)
}
</script>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Jeash render priority

clemos
Hi,

It's not very well known, the embedSWF method accepts an additionnal
parameter which is a callback :
http://code.google.com/p/swfobject/wiki/api

This makes it more like this:
function embedJS(){
  var app = document.createElement("script");
  app.setAttribute("type","text/javascript");
  app.setAttribute("src", "JeashTest.js");
  document.getElementsByTagName("head")[0].appendChild(app);
}

swfobject.embedSWF(
  "JeashTest.swf",
  "haxe:jeash",
  "100%",
  "100%",
  "10.0.0",
  "ExpressInstall.swf",
  {},
  {allowscriptaccess:true,allowfullscreen:true,allownetworking:true,wmode:"opaque"},
  {},
  function(e){ if(!e.success) embedJS(); }
);

Cheers,
Clément

On Wed, May 18, 2011 at 4:42 PM, Allan Dowdeswell <[hidden email]> wrote:

> That's absolutely perfect, Dave, thanks! Went straight to my SpringPad for
> future use. :)
> -Allan
>
> On 17-May-11, at 9:45 PM, [hidden email] wrote:
>
> Here's a snippet I use for switching between swf/js
>
> It's testing for a particular version of flash (10.0.0 in this case) and
> also allows you to force canvas using a query param
> (http://domain.com/?flash=0)
>
> It's using the latest version of SWFObject.
>
> HTH
> dp
>
> <script type="text/javascript" charset="utf-8">
> if (SWFObject.getQueryParamValue("flash") != "0" &&
> SWFObject.hasFlashPlayerVersion("10.0.0"))
> {
> SWFObject.embedSWF("JeashTest.swf", "haxe:jeash", "100%", "100%", "10.0.0",
> "ExpressInstall.swf", {},
> {allowscriptaccess:true,allowfullscreen:true,allownetworking:true,wmode:"opaque"},
> {});
> }
> else
> {
> var app = document.createElement("script");
> app.setAttribute("type","text/javascript");
> app.setAttribute("src", "JeashTest.js");
> document.getElementsByTagName("head")[0].appendChild(app)
> }
> </script>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org