There are a couple of ways to conditionalize code based on the runtime

1) In script, you can look at these constants that the compiler sets
$runtime := swf7,swf8,swf9,dhtml,svg

And these are booleans that will be set depending on runtime

$swf7
$swf8
$as2
$swf9
$as3
$dhtml
$j2me
$svg
$js1

example:

// this is used for compatibility between swf and dhtml runtimes
if ($as2) {
var encodeURIComponent = escape;
}

example using #include

if ($dhtml) {
    #include "kernel/dhtml/Library.lzs"
} else if ($svg) {
    #include "kernel/svg/Library.lzs"
} else if ($as2) {
    #include "kernel/swf/Library.lzs"
} else if ($debug) {
    Debug.error('kernel/Library.lzs unsupported runtime %s', $runtime);
}



2) In LZX code, there is a special <switch> tag, which can be used to
conditionally
compile code based on the runtime

Example

  <switch>
    <when runtime="dhtml">
      <!-- no debug window in DHTML, it is in its own iframe -->
    </when>
    <otherwise>
      <include href="debugger.lzx"/>
    </otherwise>
  </switch>



On 9/24/07, Mark Bobsin <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
>  This is my first post here as am new to OpenLaszlo.
>
>  I am working on a video streaming platform and in past Alpha "development"
> release was using SMIL 2.0 with RealPlayer.  This actually worked quite well
> but wanted more out of it and began looking at SWF + Flash Video.
>
>  I know Flash is much more popular and greater PC deployment, but basically
> want to support both ways for a couple of reasons:
>  1) partner affiliates/support (i.e. not sure but down the road could work
> with Real Networks)
>  2) current issues in Flash Player due to synch of multiple streams (video
> with multiple audio languages)
>
>  ,... so thinking of using OpenLaszlo for SWF + FLV as well as DHTML + SMIL.
>  The former can all be run via Flash Player whereas the latter of course
> would launch Real Player or use embedded in webpage and have to do video
> streaming in separate part of webpage or within Real Player's HTML Pane.
> This way I can have my logon, user profile, setup pages and other portal
> aspects (searching for and listing available VOD movies), etc. in OpenLaszlo
> regardless of SWF or DHTML execution.
>
>  This is the background and now on to my question:
>
>  In respect to above, can I have differing program code logic execution
> (i.e. branching) based upon whether an OpenLaszlo app is running in DHTML
> versus SWF mode?  Is there a way to tell?  I would like to keep all SWF +
> FLV processing within same OpenLaszlo app as portal.  Otherwise, maybe
> better to spawn separate process or another OpenLaszlo or Flash SWF app?
>
>
>  Thank you and kindest regards,
>  Mark Bobsin
>


-- 
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to