Hi Angelo, the function goes in the app xml, the ini fuction. import mx.core.FlexGlobals;
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.videoView" backgroundColor="#000000" width="1280" height="800" xmlns:myClasses="myClasses.*" initialize="ini()" > then my interface (views.videoView") looks like <s:VideoDisplay id="v" left="0" top="0" width="1280" height="800" currentTimeChange="v_currentTimeChangeHandler(event)" depth="0" enabled="true" opaqueBackground="#000000" touchBegin="activarSubNativo()"/> <s:HGroup id="hbNat" x="100" y="20" width="1080" height="208" horizontalAlign="center"> <s:RichText id="txSubNativo" left="25" right="25" top="15" width="700" height="196" color="#F7FC6E" depth="3" fontSize="20" paddingTop="10" text="Subtitulo Nativo" textAlign="center" verticalAlign="top" click="goFullScreen(event)"/> </s:HGroup> all sizes in pixels. I used photoshop to draw an d position elements and measure distances in pixels. Good luck 2013/4/12 Angelo Lazzari <lazzari.ang...@gmail.com> > Hi all, > david, one question, did you do a jpg? And where did you put the code you > wrote? > > Thx? > > Sent from my > > On Apr 12, 2013, at 20:18, atauri <david.ata...@gmail.com> wrote: > > > Hi, I am using the following function, and it works like a charm to me. > > First I designed the interface for 1280*800 (using phtoshop) and then > > positioned the elements in pixels (no anchors, or relative position). It > > scales great to any phone, tablet even desktop. Hope it helps. > > > > //escalar al dispositivo (se diseñó para 1280*800) > > xScaleFactor=this.width/1280; > > yScaleFactor=this.height/800; > > ScaleFactor=Math.min(xScaleFactor,yScaleFactor); > > > > trace("ancho del dispositivo: > > "+FlexGlobals.topLevelApplication.width); > > trace("dpi del dispositivo: > > "+FlexGlobals.topLevelApplication.applicationDPI); > > trace("scalar por "+ ScaleFactor); > > > > //scalar para el dispositivo > > FlexGlobals.topLevelApplication.scaleX=ScaleFactor > > FlexGlobals.topLevelApplication.scaleY=ScaleFactor; > > > > > > 2013/4/12 Alex Harui <aha...@adobe.com> > > > >> > >> > >> > >> On 4/12/13 10:07 AM, "Scott Matheson" <smathe...@intralinks.com> wrote: > >> > >>> Hi > >>> Some good points, we are developing for 1024 x 768, as most screen > >> are > >>> larger than this, however with the browser URL etc on some devices you > >> end > >>> up with score bars, all graphics are vectors so we think these will > scale > >>> well, that¹s what our limited testing has shown, the screen are very > >>> simple with lost of space, so we could scale the design down > >> If you scale too far, fonts will get too small to read. But in general, > >> scaling causes lines/edges that were on pixel boundaries to no longer > be on > >> pixel boundaries and then anti-aliasing kicks in and the colors change > or > >> edges look fuzzy. Quite frankly, I never notice unless told to look, > but > >> some folks have a sensitivity to this sort of thing. > >>> > >>> This was a v3 app we upgraded, to V4 I also implemented a Main and > >> AppBase > >>> class, looks like I may not have updated all mx: to S; > >>> > >>> Should is change the base imports ? > >> I think Flex 4 has different scaling behavior than Flex 3, and Spark > does > >> not show scrollbars by default, so probably worth trying. > >> > =========================================================================== > >>> = > >>> > >>> AppBase.AS > >>> > >>> > >>> package baseclasses > >>> { > >>> import com.peach.uofs.services.LoadCenters; > >>> > >>> > >>> import flash.events.IEventDispatcher; > >>> > >>> > >>> import mx.core.Application; > >>> import mx.core.FlexGlobals; > >>> import mx.events.FlexEvent; > >>> import mx.events.StyleEvent; > >>> import mx.styles.IStyleManager2; > >>> > >>> > >>> > >>> public class AppBase extends Application > >> > =========================================================================== > >>> == > >>> > >>> Main.mxml > >>> <?xml version="1.0" encoding="utf-8"?> > >>> <baseclasses:AppBase > >>> layout="absolute" > >>> xmlns:fx="http://ns.adobe.com/mxml/2009" > >>> xmlns:mx="library://ns.adobe.com/flex/mx" > >>> xmlns:s="library://ns.adobe.com/flex/spark" > >>> xmlns:baseclasses="baseclasses.*" > >>> xmlns:components="com.peach.uofs.components.*" > >>> xmlns:skins="skins.*" > >>> creationComplete="init()" > > >>> > >>> > >>> <fx:Style source="main.css"/> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> On 4/12/13 5:12 PM, "Alex Harui" <aha...@adobe.com> wrote: > >>> > >>>> Is this mx:Application or s:Application? > >>>> > >>>> Why are you trying to adjust the scale? I would think that would make > >>>> your > >>>> app look a bit "fuzzy" as things won't be on pixel boundaries. You > >> might > >>>> be > >>>> better off with a main container offset within the application. > >>>> > >>>> If the main container isn't also "shrinkable", that might be what > causes > >>>> the > >>>> scroll bars. > >>>> > >>>> > >>>> On 4/12/13 8:10 AM, "Scott Matheson" <smathe...@intralinks.com> > wrote: > >>>> > >>>>> Hi > >>>>> Not sure if this is the correct place, I will ask anyway > >>>>> > >>>>> In my Main.mxml I have a simple code > >>>>> > >>>>> this.scaleX = this.scaleX 0.1 > >>>>> this.scaleY = this,scaleY 0.1 > >>>>> > >>>>> This works fine for the main container, but not the Application, so I > >>>>> end up > >>>>> with scroll bars > >>>>> > >>>>> How do I scale the application not the first container > >>>>> > >>>>> Scott > >>>>> > >>>>> > >>>>> ________________________________ > >>>>> > >>>>> Disclaimer: This electronic mail and any attachments are confidential > >>>>> and may > >>>>> be privileged. If you are not the intended recipient, please notify > the > >>>>> sender > >>>>> immediately by replying to this email, and destroy all copies of this > >>>>> email > >>>>> and any attachments. Thank you. > >>>> > >>>> -- > >>>> Alex Harui > >>>> Flex SDK Team > >>>> Adobe Systems, Inc. > >>>> http://blogs.adobe.com/aharui > >>> > >>> > >>> ________________________________ > >>> > >>> Disclaimer: This electronic mail and any attachments are confidential > >> and may > >>> be privileged. If you are not the intended recipient, please notify the > >> sender > >>> immediately by replying to this email, and destroy all copies of this > >> email > >>> and any attachments. Thank you. > >> > >> -- > >> Alex Harui > >> Flex SDK Team > >> Adobe Systems, Inc. > >> http://blogs.adobe.com/aharui > > > > > > -- > > ¿ Te gustan las *Abejas* y la *Tecnología* ? Sígueme en > > Twitter<http://twitter.com/apilink><http://twitter.com/apilink> > > > > (\__/) > > (='.'=) This is Bunny. Copy and paste bunny into your > > (")_(") signature to help him gain world domination. > -- ¿ Te gustan las *Abejas* y la *Tecnología* ? Sígueme en Twitter<http://twitter.com/apilink><http://twitter.com/apilink> (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination.