[Laszlo-dev] SOLO Swf Resize while Preserving Aspect Ratio

Henry Minsky henry.minsky at gmail.com
Thu Jan 26 21:04:06 PST 2006


I remember there was some issue where this came up , or something related,
and it had to do with the LFC library setting the scale parameters or
something.

In the file

WEB-INF/lps/lfc/view/LaszloCanvas.as

There is this line

// necessary for consistent behavior - in netscape browsers HTML is ignored
Stage.align = global.canvassalign != null ? global.canvassalign : "LT";
Stage.scaleMode = global.canvasscale != null ? global.canvasscale :
"noScale";
//_root.Debug.write('Canvas scale', global.scale, Stage, Stage.scaleMode);


Maybe that has something to do with it?


On 1/26/06, Aaron Shepherd <aaron.shepherd at guestclick.com> wrote:
>
> The problem isn't with the embed.js, since I'm not actually using that.
>
> The problem is with the SWF file that is generated through the Laszlo
> compiler.  It must contain a setting for the scale option that is not
> allowing for scaling while preserving the aspect ratio.
>
> If I set the scale=showingall in the embed tag, set the width and height
> on the embed tag to 100%, then I want the app to scale to the browser
> width/height with aspect.  If you do this with a "normal" flash file,
> like any of the example "working" swf files in the demos, it works the
> way I want the Laszlo outputted swf files to work.
>
> I'm sure there is a setting somewhere in the SWF writing classes (or
> perhaps in the compiler source), that controls this functionality.
>
> I just need to find the right 2 lines of code :)
>
> Thanks,
>
> Aaron
>
>
> -----Original Message-----
> From: P T Withington [mailto:ptw at pobox.com]
> Sent: Thursday, January 26, 2006 7:05 PM
> To: Aaron Shepherd
> Cc: laszlo-dev at openlaszlo.org
> Subject: Re: [Laszlo-dev] SOLO Swf Resize while Preserving Aspect Ratio
>
> embed.js is very tricky to work with.  You could try ?lzt=html-object
> and look at the source to play with the plug-in options; or, maybe
> you just want to set the canvas width/height to 100%, which will
> cause it to size to the plug-in?
>
> On 26 Jan 2006, at 18:17, Aaron Shepherd wrote:
>
> > I have a rather complex application that we are deploying in SOLO
> > mode that I would like to automatically resize with preserving the
> > aspect ratio.  I don't want to use constraints as not all
> > components (like tabs, tabsliders, etc) auto-constrain font sizes,
> > etc.
> >
> > I would like to set the sizes manually (at least of the canvas and
> > outer most views), and have the flash player take care of the
> > scaling as it supports scaling with aspect preservation. This
> > allows complete control of the application look/feel and allows me
> > to develop at a higher resolution (like 1280x1024 to get the ratios
> > correct), but still deploy at any size client's browser is
> > configured.  (With special note to the 640x480 screens, which make
> > most modern applications look terrible).
> >
> > I also need the application to look good with any size or aspect of
> > window. So... Why is it that the SWF files generated from Laszlo do
> > not respect the aspect scale defaults of the flash player? Other
> > applications/swf files that are pure flash do so.
> >
> > Is there a way to have the generated solo swf file respect the
> > scale attribute of the flash player?
> >
> > Do I need to modify the Java sources used to compile the swf files?
> >
> > I'm not shy about changing the underlying laszlo source or swf
> > generation pieces, and would be happy to repost the mods to support
> > this functionality.
> >
> > A very simple example is:
> >
> > [canvas width="1024" height="768" proxied="false"]
> > [view width="${parent.width}" height="${parent.height}"]
> > [text]Here is some text[/text]
> > [/view][/canvas]
> >
> > When run as an embedded swf, or even a standalone swf, the aspect
> > ratio specified is not respected.
> >
> > Things I have tried with no effect:
> > -         Modified the embed tags in my deployment HTML to have
> > scale=showall.
> >
> > -         Modified the base xslt stylesheets provided in the distro
> > from scale=noscale to scale=showall
> >
> > -         Modified all the html/js files with respect to any and
> > all scale= tags
> >
> >
> > I know that most applications would dynamically stretch to fit a
> > page and utilize more real estate for functional areas, and in fact
> > we have other applications that work in that manner.  But since
> > this an end-user consumer oriented application (think TIVOish), I
> > need the application to look/act/feel the same regardless of the
> > deployment environment.
> >
> > Thanks in advance for any insight into this question.
> >
> > -Aaron
> >
> >
> >
> >
> > _______________________________________________
> > Laszlo-dev mailing list
> > Laszlo-dev at openlaszlo.org
> > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>
>
>
>
>
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>



--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openlaszlo.org/pipermail/laszlo-dev/attachments/20060127/db1ff900/attachment.html


More information about the Laszlo-dev mailing list