View Full Version : 3D component
fgomes
10-25-2005, 01:36 AM
I'm new to laszlo, I'm follow the tutorials, and I think it is very good (except for the memory footprint on the browser, this could limit it's use for some customers).
What I whish for it (I think is missing, please correct me if I'm wrong) is a 3D component, that can import from 3D Studio Max, like Swift3d for flash. I want to show a 3D image and be able to 'animate' it in runtime, interacting with the server (could use RPC for this).
I can use a Swift3d component in the same web page as the laszlo application, but is it possible to interact with it (between laszlo app and other flash components in the same web page) using the browser as a gateway? I can call javascript functions from laszlo applications, using LzBrowser, anyone did something similar (interact with othe flash app in the same browser)? Any tips, performance problems, browser compatibility problems, etc?
And about my first question, can we expect a 3D component for laszlo in the near future?
Thanks!
Fernando
I'm following a similar path .. but embedding SVG objects (including 3D effects) instead of 3D flash objects.
Laszlo SWF object and SVG object are in separate div containers on same browser window.
And the browser javascript is the "gateway" as you suggest.
There is some useful advice on browser compatibility and DOM navigation at this site (http://www.quirksmode.org/js/).
And you might try the javascript integration kit (http://weblogs.macromedia.com/flashjavascript/).
I use flashobject (http://blog.deconcept.com/flashobject/) instead of the laszlo embed.js script. Easier to understand for passing variables between neighbouring SWF files.
..
You should post your question on 3D component at openlaszlo.org laszlo-dev mailing list where it might get more attention.
fgomes
10-25-2005, 05:29 AM
Hi d~l
Thanks for your answer, now i know I'm not the only one doing it - well, I'm just thinking right now, not doing it :-)
If this is not asking to much, can you post a little sample of your use of FlashObject from Laszlo? Just a simple example to know how to start will help a bit
Thanks again!
Fernando
Similar to the laszlo version embed.js .. flashobject.js provides a means of embedding SWF objects, and passing vars onload or via url query parameters.
If vars need to be passed after loading then you need to invoke javascript in HTML page which sets canvas attributes
e.g.
document.getElementById("theTarget").SetVariable("var_width", "400");
document.getElementById("theTarget").SetVariable("var_height", "800");
(note .. if flashobject.js is used in lieu of embed.js this eliminates the lzSetCanvasAttribute option as described in Browser Integration chapter).
You might wish to also test the lzEmbed option which requires embed.js to be included.
On balance I prefer to use flashobject.js
...
Here is a flashobject embed snippet for the HTML wrapper page
<html>
<head>
<title></title>
</head>
<body>
<script src="flashobject.js" type="text/javascript"></script>
<div class="embedTop" id="laszloembed">
<p>This is replaced by the Flash content.</p>
<p>Place your alternate content here and users without the Flash plugin or with Javascript turned off will see this.
Content here allows you to leave out <code>noscript</code> tags.
Include a link to <a href=\"flashobject.html?detectflash=false\">bypass the detection</a> if you wish.</p>
</div>
<br/>
<script type="text/javascript">
var fo = new FlashObject("laszloapp.lzx?lzt=swf", "theTarget", "800", "400", "7", "#BCB9AE");
fo.addParam("quality", "high");
fo.addParam("scale", "exactfit");
fo.addParam("salign", "LT");
fo.addParam("menu", "false");
fo.addParam("swLiveConnect", "true");
fo.addParam("name", "theTarget");
// fo.addParam("wmode", "transparent"); // optional parameter
// using url query parameters .....
// flashobjectpage.html?var1=value1&var2=value2
// fo.addVariable("var1", getQueryParamValue("var1"));
// fo.addVariable("var2", getQueryParamValue("var2"));
fo.write("laszloembed"); // write Flash Object into div container - div id = laszloembed
</script>
</body>
</html>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.