View Full Version : use of SWF
mwalker
10-01-2003, 02:48 PM
Hello, I am wondering if anyone can explain the use of shockwave files on the various demo apps, (specifically the weather app). I ask since I am somewhat intimidated by shockwave files - have never edited or created one and wondering how crucial it is to the overall functionality of the weather app.
Much thanks.
-Matt
antun
10-01-2003, 02:56 PM
Actually you never work directly with SWF files, except if you're using a SWF as an art asset.
The way the Laszlo Presentation Server works is by compiling LZX code (similar to XML & JavaScript) into SWF bytecode and returning that to your browser. The Flash Player is what renders Laszlo applications.
If you want to quickly experience what it's like to develop a Laszlo application, you can use the LZXplorer:
http://www.laszlosystems.com/lps/lzxplorer2/lzxplorer.htm
This is what the LZX source for the weather app looks like:
http://www.laszlosystems.com/lps/viewer/viewer.jsp?file=/sample-apps/weather/weather.lzx
Does that answer your question?
-Antun
mwalker
10-01-2003, 05:38 PM
Thanks for the response. I have already downloaded and begun creating apps with the presentation server - but the explorer is something new that I will definitely check out.
Getting back to my concen - Why, then, would any care to use swf files as an art asset. They obviously provide some animation capabilities (such as the word clock demo. I can tell that the shockwave program just spins the hour hand around and script is used to simply stop it at a given frame). Beyond animation, what do they provide?
For instance, the calendar and dashboard applications are very slick and I would love be able to use Laszlo to create similar utils. But would I be able to without learning shockwave?
( not that learning it would be a bad thing)
Regards,
-Matt
antun
10-01-2003, 06:08 PM
You don't need to use SWFs at all to create a Laszlo app.
Why, then, would any care to use swf files as an art asset.
The reason you would use a SWF as an art asset is because SWF is a vector art format, so it stretches really well. This might be important if you're creating a window; the stretchy bits of the window chrome need to be able to stretch without distorting, so that would be a good place to use a SWF.
Also there are some situations where a particular art asset might be smaller in size when saved as a SWF, than a bitmap format (such as a GIF, JPEG or PNG).
Check out the window tutorial for more on that:
http://www.laszlosystems.com/developers/learn/documentation/tutorials/window.php
They obviously provide some animation capabilities (such as the word clock demo. I can tell that the shockwave program just spins the hour hand around and script is used to simply stop it at a given frame).
No that's not correct - the second hand is rotated purely through LZX. This part of the app moves the second hand:
this.shs.setAttribute('rotation',secNum*6,dur);
this.sh.setAttribute('rotation',secNum*6,dur);
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.