PDA

View Full Version : A complete website using laszlo


jaddik
08-18-2007, 10:45 PM
Here is a site that I re-designed just using laszlo. Its really not a RIA site so I probably didnt have to use laszlo for a site like this, but I wanted to learn. some of the laszlo stuff I did on the site: animation, datasets with php/xml, video, rss feeds, image thumbnails, form submission/validation, affiliate product links, browser resolution detect/resize. I can help out anyone wanting to do any of these things. thanks to the examples and forums.

http://www.healthfruit.com/beta/index.htm

You may download the entire source code here (http://store.payloadz.com/go?id=132024)

sreeramabrahmam
08-29-2007, 02:02 AM
Hi jaddik,
i am new to OpenLaszlo,
here i am facing a problem in dynamically populating the combobox (where data is coming dynamically from DataBase),.
i am very thankful to u , if u can provide me the code for this one.

Thanks & regards
brahmam

JimA
04-24-2008, 05:16 AM
Hi jaddik: Very nicely designed site! I am wondering how you did the following:

1. When the view changes on the right based on the onclick of a tab -- are you simply hiding and unhiding views? I really like the effect.

2. How do you determine screen resolution and adjust accordingly?

Many thanks,

Jim

jaddik
04-25-2008, 06:58 AM
Hi jaddik: Very nicely designed site! I am wondering how you did the following:

1. When the view changes on the right based on the onclick of a tab -- are you simply hiding and unhiding views? I really like the effect.

2. How do you determine screen resolution and adjust accordingly?

Many thanks,

Jim

Jim,
All I did to change the view was to animate(fade) the old page away, and animate the new page in. Here is my class fade, and passed in the page(view) names.

<class name="fade">
<attribute name="old_page" type="string" value="null"/>
<attribute name="new_page" type="string" value="null"/>
<attribute name="running" type="boolean" value="false"/>
<method name="start" args="oldpage, newpage">
if(this.getAttribute('running') != true){
//no animation currently running
//start animation
this.setAttribute('running', true);
this.setAttribute("old_page", oldpage);
this.setAttribute("new_page", newpage);
var anm = oldpage.animate("opacity",0,1500,false); //animate old page
var d = new LzDelegate(this, "fadeInNewPage");
d.register(anm, "onstop"); //triggers method fadeInNewPage
}
</method>
<method name="fadeInNewPage">
//after oldpage animates, starts newpage animate
var oldpage = this.getAttribute("old_page");
var newpage = this.getAttribute("new_page");
oldpage.setVisible(false);
newpage.setVisible(true);
newpage.setAttribute("opacity",0);
var anm = newpage.animate("opacity",1,1000,false); //animate new page
var d = new LzDelegate(this, "anmDone");
d.register(anm, "onstop"); //triggers method anmDone
</method>
<method name="anmDone">
this.setAttribute('running', false);
</method>
</class>


For the screen resolution, if you have your canvas set at 100% for the height and width, you place javascript in your html page to detect the resolution and resize the flash object accordingly. Here I keep the width constant, but adjust the height based on their screen height.

<script type="text/javascript">
var screenH = screen.height;
var height;
if(screenH<700){height=355;}
else if(screenH>=700 && screenH<=799){height=455;}
else if(screenH>=900 && screenH<=999){height=655;}
else if(screenH>=1000 && screenH<=1099){height=755;}
else if(screenH>=1100 && screenH<=1199){height=855;}
else if(screenH>=1200){height=955;}
else{height=555;}
AC_FL_RunContent('type','application/x-shockwave-flash','data','index.lzx.lzr=swf8.swf?lzproxied=fa lse','width','785','height', height,'movie','index.lzx.lzr=swf8?lzproxied=false ','quality','high','scale','noscale','salign','LT' ,'menu','false');
</script>


The Laszlo book covers these topics as well. Good Luck :D

JimA
04-25-2008, 07:08 AM
Hi Jaddik: Thanks so much for the helpful response. Will try what you suggeest. Looks like I'll have to buy the book.

Coming from a different background, it's a process of getting used to the way OL behaves and does things. I'm very impressed by what I've seen, though.

Again, thanks for your help. I really like your site.

Best,

Jim

JimA
04-28-2008, 10:41 AM
Hi Jaddik: Just a followup question, please.

In your "fade" class -- you dim the old_page and fade in the new_page. This may sound dumb, but do you simply create the new_page on the fly (with information from the dataset) and then destroy that when you're done? Is that a viable way to handle presenting details from the dataset?

Here's what I'm trying to do:

1. I'd like to present a list of thumbnails (similar to the the LZPIX demo or the Load Images sample app).

2. When user clicks on the thumbnail, a medium picture appears with details to the right of it (or on a 2nd tab behind it). I don't need anything fancy -- just the option to see the details and to go back to the list of thumbnails. My thought was to create the details View that could receive the proper data, fade in, etc. When the user clicks a new photo, the view gets recreated (or reloaded). Am I approaching this properly?


Much obliged,

Jim

spoco2
05-01-2008, 04:42 PM
Quite nice, although can I suggest two changes:
1) Speed up the fade of the pages, too long to wait, about twice as quick would be nice
2) Change the font to be a TTF font, therefore when you do a fade everything will fade, not just the pictures.

jaddik
05-02-2008, 08:08 AM
Quite nice, although can I suggest two changes:
1) Speed up the fade of the pages, too long to wait, about twice as quick would be nice
2) Change the font to be a TTF font, therefore when you do a fade everything will fade, not just the pictures.

1. Yes, you are probably right about this.
2. I tried both options of fonts: embedding the fonts vs using the user fonts and I choose using the user's fonts(I dont remember why). So without embedding fonts I couldn't fade them- I think this is because of Flash player.

thanks.

jaddik
05-02-2008, 08:16 AM
Hi Jaddik: Just a followup question, please.

In your "fade" class -- you dim the old_page and fade in the new_page. This may sound dumb, but do you simply create the new_page on the fly (with information from the dataset) and then destroy that when you're done? Is that a viable way to handle presenting details from the dataset?

Here's what I'm trying to do:

1. I'd like to present a list of thumbnails (similar to the the LZPIX demo or the Load Images sample app).

2. When user clicks on the thumbnail, a medium picture appears with details to the right of it (or on a 2nd tab behind it). I don't need anything fancy -- just the option to see the details and to go back to the list of thumbnails. My thought was to create the details View that could receive the proper data, fade in, etc. When the user clicks a new photo, the view gets recreated (or reloaded). Am I approaching this properly?


Much obliged,

Jim

Jim,
I do create pages on the fly because it saves on loading time. I do not destroy any views, just hide them. It sounds like you are on the right track of things. I would suggest to look at the code in that Laszlo LZPIX demo, and also the Amazon demo. I plan on posting all my code(maybe for a donation or something) so you can see what I did. I will post that link soon.

Josh

madtux666
05-06-2008, 02:28 AM
Hi,

I think I have found a bug. I have seen page for very short time period. After selecting few tabelements, proper content appeared, however progress bar was going in circle like mad ;-)



Regards,
Madtux

spawnthing
06-24-2008, 05:25 PM
very nice! at last I am allowed to comment. All the credits to the webmaster! :)

Well anyways, about the site, it really, is nice.

thank you for giving away your source code man.