View Full Version : Question regarding Laszlo using .swf media type
ch_bowen
11-08-2004, 07:10 AM
I have a view and I am setting its source to a .swf file at runtime. When the .swf file gets loaded, it has some script that runs and calls a servlet. The .swf file runs fine on its own but when it runs in Laszlo, it seems that it is not getting the response. I am verifying that it is calling the servlet (afer attaching it to the view) but it isn't getting the response. Can this be done?
Thanks,
Chris
metasarah
11-08-2004, 08:39 AM
Laszlo supports SWF as art assets, not as script objects. This ensures that your Laszlo application will work on alternate runtimes in the future.
ch_bowen
11-08-2004, 09:16 AM
The thing is that the .swf file I load works if it loads an xml file from disk but when I change the url to hit a servlet, the servlet gets called but the .swf doesn't get the response. So, to say that the scripting can't be done in a .swf is inaccurate, isn't it?
" .. Laszlo supports SWF as art assets, not as script objects. This ensures that your Laszlo application will work on alternate runtimes in the future. "
Certainly it would be more than useful to be able to target swf objects (and svg objects) from within laszlo apps ..
the compromise seems to be to use an html wrapper for the laszlo app .. then embed the swf in the same html wrapper page ..
then use javascript to connect between laszlo and swf (or svg).
...
p.s. what calls do you have in your test.swf actionscript?
ch_bowen
11-08-2004, 12:29 PM
The .swf simply calls a servlet and it returns a response (a url to be more specific) to the .swf file telling it where to look up a resource at runtime. This works fine when the .swf is loading an xml file but not when it calls a servlet. I am verifying that the servlet gets called correctly by the .swf but the .swf doesn't get the response which it does if I run the .swf on its own. It seems that it does not get the parameters that are written out by the servlet response. I don't know if the lps intercepts this or not for certain, but that is the behaviour that I'm seeing.
Ideally, I want the .swf file to be set as a resource on the view, then when it is played, it (the .swf) calls a servlet and gets a response so that it can look up resources that it needs at runtime. There is no interaction between the Laszlo application and the .swf other than the fact the .swf file is being attached to the view via View.setSource().
Thanks in advance for any replies,
Chris
I have tried various ways (unsuccessfully) to get swf resource to communicate with laszlo from within laszlo app ..
my recent posting here .. (http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=1389&highlight=swf) .. or just search "swf" in the forum to see other like threads.
two test swfs I have can intercommunicate outside laszlo app .. but inside laszlo as swf resources the same swf's can't intercommunicate.
my own conclusions:
laszlo team have said it can't be done
there is some form of swf actionscript blocking in laszlo app
keep the interactive swf's outside laszlo apps
and communicate via javascript.
ch_bowen
11-09-2004, 05:05 AM
Thanks for the reply...
I have been developing various UI's in Laszlo for over a year now and I must say that has been a pleasant experience. I also find that it is much better than Macromedia Flex (what I've seen so far) but there is a major drawback by their lack of support for .swf communication.
I understand why the people at Laszlo are not supporting .swf communication (because they may switch runtimes in the future) but the fact of the matter is that .swf CAN be used as animation resources right now in this runtime environment...if they are going to support this than I think it is feasible to allow Laszlo to communicate more effectively with swf media resources. If they switch runtimes to something other than Flash, sobeit. Unless someone can prove to me that you can to the same types of animation that is capable of being done in Flash (by a Flash designer) can be done in Laszlo, I will not change opinion on this.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.