Stage.scaleMode = StageScaleMode.EXACT_FIT

Hey all... first time posting here, long time lurker.  I have a problem with a personal project (home automation) that I have yet to figure out a solution.  In essence, I cannot get stageScaleMode EXACT_FIT to work as I would hope.  There is just something about the way the stage is handled in Flex that I'm missing.  I have searched for a solution to this issue for hours and hours around the web, with very little help being provided.  This project has just been in my free time and I have actually gotten so frustrated a number of times at this problem, that it has caused me to give up work on it for a while, however I'm motivated once again to try.
In a nutshell, I have developed a Flex application with a set width and height.  What I need is for the application to zoom (scale or whatever) to fit whatever container it is in, allowing distortion to occur, and scaling all components, fonts, images, etc accordingly.
I have tried a number of methods and the only method I have found that works the way I want is to use the Flash debug player, load a wrapper SWF (stub essentially) I created in Flash, which in turns loads the built Flex SWF.  Doing that, I can resize the flash player window or even go full screen and the flex app scales to always fit the container... buttons, fonts, everything scales.  Essentially, the application looks exactly the same at 640x480 and at 1024x768 (albeit smoother fonts, etc).  Understand that this is different that how one would probably develop a Flex app, where the actual UI components expand/contract... I want them to stay the same size, same number of rows, etc... just get bigger... fonts and all.
Loading just the Flex SWF in the debug player without the wrapper, however, doesn't work.  I can get it to stick to the defined width and height or sometimes get it to scale to an (unknown) stage size, where all that is visible is essentially the top left quarter of the app and resizing the window does cause the app to scale, however only pretty much that 1/4 of the app is visible in the window.  Loading the app directly in a browser (through a page) or even through the stub wrapper SWF provides the same screwy results.  It's almost as if the Flex app has no idea what the size of the actual container it is in, unless it is in the debug player.  Publishing it as an AIR app does the same thing.
Using the Flash debug player, along with the wrapper, actually gets the job somewhat done for my little project's purposes, however I am really at the point where I need to move this is into either a full on AIR install or be able to run this in the browser (either case scaled correctly), so that I may do other things (launch new windows, possibly interact with the desktop, etc).
I apologize I'm not a Flex/Flash developer for my day job, so I'm not using the correct terminology (however I am a programmer), but I hope my description of what is occurring will suffice.  I've seen others online with a similar problem and have heard mentions of using some form of scalex/scaley to accomplish a solution, but couldn't find any actual examples of working code.
Any help would sincerly be appreciated.  I would like to finally get past this, so I can go back to having fun working on the actual parts of the application (and not just getting it to fit the dang screen)... haha.
Thanks.

Thanks for that pointer.  I tried playing with finding the (what I would call) "natural" size of the app, as you describe.  When laying out the UI, I always set the viewer to 800x600.  I removed the app's width/height, added some trace statements and here was the output (stageWidth is stage.stageWidth & "width" is stage.width):
stageWidth = 500
stageHeight = 375
width = 548
height = 596
If I set the app's width/height to 548x596, this somewhat worked, however it caused proportions on individual components to be off (of course they would scale with these off proportions).
So that got me thinking.  The app has a viewStack as it's main "base", which was defined having width/height = 100%.  I changed that to an absolute width/height of 800x600.  Without setting an app width/height and running, I then got:
stageWidth = 500
stageHeight = 375
width = 800
height = 600
So, naturally then I changed the apps width/height to 800x600 and wholla!  Works/scales (all by itself with no wrapper) in both the debug player and the browser just fine and looks the way I intended.  Neato!  Trace gives me:
stageWidth = 800
stageHeight = 600
width = 800
height = 600
Now, getting the same job done in AIR is a different story.  I immediately went to my AIR project and tried, but it still suffers from the same (~1/4 corner of the app) showing up, albeit it tries to scale up with the window resize.  My guess is there is something different with the timing/order of the stage/display elements here, as the code itself (other than it's a windowedApplication") is exactly the same.  Without any app width/height (but setting the viewStack width/height to 800x600), the trace gives me:
stageWidth = 500
stageHeight = 375
width = 800.5
height = 600
Now, here is what is strange with the AIR app and what may lead someone that knows this better to tell me how to fix it.  I am setting the stage.scaleMode using the reference from that base viewstack I described earlier.  When I run the AIR App and resize the window smaller, what looks to be the actual app scales down to the point where it actually is smaller than the window it is contained in (albeit still only showing about 1/4 corner of the actual application).  There are borders (padding/blank space) on the right/bottom (I also set stageAlign top left).  Scaling the window larger and larger, just scales that corner that is visible larger and larger (similar to what the browser version was doing), but actually fulls the window with this 1/4 corner of the app.  I know I am missing a "gotcha" about AIR somewhere here.

Similar Messages

  • StageScaleMode.EXACT_FIT not supported in air 2.7 for ios?

    stage.scaleMode = StageScaleMode.EXACT_FIT;
    Does not work correctly air 2.7 for ios. It is all messed up.
    This is what my program looks like in air 2.6 for ios:
    http://literacysoft.com/uploads/2.6.PNG
    This is what it looks like when compiled with air 2.7:
    http://literacysoft.com/uploads/2.7.PNG
    Is there anything I can do to fix this?
    -Scott

    I think you are hitting the GPU fullscreen bug in AIR 2.7(http://forums.adobe.com/message/3747867). It suspect it is not related to the scale mode that you are setting. To confirm, you could set the renderMode to cpu in your application xml. You should not be able to reproduce the bug.
    -Sanika

  • Embed swf change Stage.scaleMode

    Is it possable To change the scale mode of a swf in the html embed code?
    my problem: I have the popular free flash game 'metal slug' as a swf, Its too large and wont resize as it was exported by who ever made it to preserve aspect ratio....
    Ive been trying all day to get it to resize but it wont:
    <div id="Nested" style="position:absolute; left:22px; top:32px; width:400px; height:300px; z-index:1;">
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="300">
        <param name="movie" value="metal_slug.swf">
    <param name="scale" value="exactFit">
        <param name="quality" value="high">
    <param name="flashvars" value="Stage.scaleMode=exactFit">
        <embed src="metal_slug.swf" scale="exactFit" flashvars="Stage.scaleMode=exactFit" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="400" height="300"></embed>
      </object>
    I have tryed lots of different things including trying to tell the swf through flashvars to be 400 by 300, Ive tryed to decompile it and re-export it with sothink but that didnt work as its no longer reconised any of the game sounds, text, and didnt load any more (tryed and tryed)
    I have searched and searched all through google but this swf still refuses every thing i try!
    please can some one show me how to resize this swf?

    Try publishing swf as width 100% and height 100% (File -> Publish Settings -> HTML -> Dimensions: Percent). Then you can bound it with div and set dimensions of div.
    Hope it solves your problem.

  • SWFLoader that unfortunately sets Stage.scaleMode

    In a Flex project I have been working on, I've received a new SWF asset to incorporate. No problem usually. However, this asset is setting the stage's scaleMode to showAll. OUCH. This has the effect of this: Flex app loads and looks fine, SWFLoader is later called and the asset is loaded as the SWFLoader's source. The entire stage is scaled up at least 3x the size. On the complete event for the loader I go ahead and set the scaleMode back to noScale, but then the application jumps back to looking correct. The problem is the jumping up then back again.
    I am not able to have the asset rebuilt, so I am stuck with what I have. How can I work around this from Flex. Since the stage is shared, this SWF keep dorking everything up.

    Depends on what the asset really is.  If you only need a symbol from it, you can try embedding just those symbols and that might skip the code that calls showAll.
    If you need the whole SWF because you want the timeline but don't care about what it actually does, you can deploy it on a different domain and then it won't have access to the stage.  It will throw a security error but only folks with debugger players will see it.
    Another option is to find out where code that changes scaleMode is.  If it is in a particular class in AS3 in then SWF, you can try creating a custom version of that class in your main app.  You version of the class will supercede the one in the SWF.
    Another option is to find out when the code changes scaleMode.  It might be that you can double-check on enterFrame or render events and set it back before the player actually draws it in the wrong scale mode.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Possible bug: Stage rotates during startup sequence

    Hi,
    I'm almost ready to submit an iPad app to Apple but have an issue with the stage rotating during startup. My app is configured to use landscape mode, fullscreen turned on, auto-orient turned off, selected device iPad.
    When yo launch the app it shows the default png correctly in landscape mode, then rotates it briefly to portrait before snapping back to lanscape again when the app has fully launched.
    I tried a suggested workaround using
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.EXACT_FIT;
    That didn't seem to make any difference. I also tried
    stage.addEventListener( StageOrientationEvent.ORIENTATION_CHANGING, onOrientationChanging );
    public function onOrientationChanging( event:StageOrientationEvent ):void { event.preventDefault(); }
    but again this made no difference.
    Any help appreciated. This problem is preventing me from submitting to Apple as I do not believe they would let this pass.
    An earlier app of mine for iPhone which was packaged using an earlier (a very early, as in before year's MAX early) version of the packager did not exhibit this behaviour.
    Stefan

    thanks again. The initial issue is now resolved by using the addtional Default images. For some reason I've never seen this mentioned before, maybe it's because the Adobe docs mainly focus on iPhone.
    I've still got one remaining issue which the user in another post also witnessed and that is one where the stage briefly seems to resize to a samller size, then flicking back to normal size. This happens at the exact same time where previously the rotation has shown up. It's not a huge issue but annoying nevertheless. I'm also concerned that Apple will pinpoint issues like this upon submission.
    Any advise?
    Stefan

  • Trouble using exact_fit with Gaia and as3

    I'm building a flash site (with Flash CS4 and AS3) inside of the Gaia framework.
    I want to let my visitors toggle between Exact_Fit and No_scale, and I've attached the following code to be triggered by the toggle button.
    function toggleExactFit(event:MouseEvent):void
                trace ("Here in toggleExactFit to change StageScaleMode");
                if (stage.scaleMode == StageScaleMode.NO_SCALE)
                       stage.scaleMode = StageScaleMode.EXACT_FIT;
                       this.stage.align=StageAlign.TOP_LEFT;
                else
                    stage.scaleMode = StageScaleMode.NO_SCALE;
                           //  stage.align=StageAlign.TOP_RIGHT;
                trace ("Here in toggleExactFit - stage.scaleMode now = " + stage.scaleMode);
    Here are my import statements:
        import flash.display.*;
        import flash.events.*;
        import com.greensock.TweenMax;
        // Imports used by Global Navigation
        import net.kaegi.navigation.NavigationManager2;
        import net.kaegi.navigation.NavigationButton2;
        import net.kaegi.events.NavigationEvent;
        import flash.text.StyleSheet;
        import flash.text.TextField;
        import com.greensock.easing.*;
        import gs.*;
        import flash.media.*;
        import flash.text.*;
        import flash.display.StageDisplayState;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        import flash.events.MouseEvent;
        import flash.ui.*;
        //import fl.video.MetadataEvent; - ONLY with flv playback component maybe
        import flash.media.SoundMixer;
    This partially works.  When the toggle button is clicked, the site does stretch out to try  to fill the whole screen, but everything is shifted down by about a  hundred pixels and to the right by a couple hundred, so I can't see the  right side or lower part of my website.  I have my stage set to 960 x  620 pixels, and I checked through my different FLAs to make sure content  wasn't spilling past that boundary.
    I was trying to get help on the Gaia forums, but one of theri moderators moved the post, saying this was an actionscript question, not a Gaia issue.
    So, before going back to the Gaia forums, I want to make sure I have my as3 right and haven't overlloked anythying.
    Any suggestions as to what I might have messed up or how to fix it?

    Thanks.  I ran the very test you suggested last night in a standalone fla and the code worked fine, and I sent a note to the moderator this morning (who'd originally pulled my thread as 'non-Gaia related').  The moderator steered me in a new direction (away from exact_fit and toward an onResize function included in Gaia) so trying to get that worked out right now.
    I left my post here because I often get a more nuanced understanding of things after asking questions in the Adobe forums and I don't have much experience with exact_fit, noscale and best practices for resizing and scaling content in accord with browser changes.
    Thanks for your help.

  • FLV Playback and Seekbar on different native windows in one Air application

    Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second screen and places a FLVPlayback instance on that new window.  Everything works just like it want it to except for one thing.  When the seekbar and FLVplayback instance are not located on the same window stage, the seekbar handle sticks to the mouse when trying to scrub through the video.
    I've added both the transport control and the FLVPlayback instance to the original native window as children and I have also added both of them to the new window as children and everything works just fine.  It's only when they are separated and located on different stages that the seekbar acts up.  When they are on the same stage, I can click on a point on the seekbar and the video jumps to that spot and continues to play and I can also scrub the seekbar, the video updates as I scrub, and when I release the mouse, the seekbar handle stays where I released the mouse.  When they on separate stages, the seekbar handle continues to follow the mouse movement without releasing it.  The video updates as the seekbar handle is moved due to it sticking to the mouse, but if I release the mouse, the handle is still moving with the mouse and the video is still being scrubbed.  Like I said, everything works great except for this and I have reached my limit with time spent on this issue.  Does anyone have any insight into this?
    Here's my code for the project.  This is my first AIR application, so I am coding it as I am learning, please be kind.
    import fl.video.*;
    import flash.display.*;
    import flash.desktop.*;
    import flash.events.*;
    import fl.video.MetadataEvent;
    import flash.geom.*;
    import flash.ui.Mouse;
    import flash.text.*;
    GLOBAL SETUP
    var flvControl:FLVPlayback;
    var MasterWindow = stage.nativeWindow;
    var screen1:Screen = Screen.screens[0];
    var screen2:Screen = Screen.screens[1];
    MASTER WINDOW SETUP
    this.loaderInfo.addEventListener(Event.COMPLETE,maximize);
    transControl.playPauseButt2.addEventListener(MouseEvent.CLICK, PlayButton);
    if (Screen.screens.length > 1){
              createVideoBKG();
              createVideoPlayer();
    GENERAL FUNCTIONS
    //Maximize the initial screen
    function maximize(e:Event) {
              MasterWindow.x = screen1.bounds.left
              MasterWindow.maximize();
              MasterWindow.stage.scaleMode = StageScaleMode.EXACT_FIT;
    //Hide Mouse Behind Video Window On Roll-Over
    function MouseRollOver(e:MouseEvent):void
              {          Mouse.hide()          }
    function MouseRollOut(e:MouseEvent):void
              {          Mouse.show()          }
    //Play-Pause Button Control
    function PlayButton(event:MouseEvent):void
                        if(transControl.playPauseButt2.currentFrame==1 ){
                                  transControl.playPauseButt2.gotoAndPlay(2);
                                  flvControl.play();
                        else {
                                  transControl.playPauseButt2.gotoAndPlay(1);
                                  flvControl.pause();
    function CloseWindow(e:MouseEvent):void
                        NativeApplication.nativeApplication.openedWindows[2].close();
    VIDEO BKG SETUP
    function createVideoBKG(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoBKG:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoBKG.x = screen2.bounds.left;
              videoBKG.maximize();
              chromeSetup(videoBKG);
              videoBKG.activate();
    //Video BKG Chrome Setup
    function chromeSetup(currentWindow):void {
              var vidBKG = new video_bkg();
              vidBKG.name = "video_bkg2";
              vidBKG.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              vidBKG.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              currentWindow.stage.addChild(vidBKG);
    VIDEO Player SETUP
    function createVideoPlayer(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoPlayer:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoPlayer.x = screen2.bounds.left;
                        videoPlayer.y = screen2.bounds.top;
                        videoPlayer.width = screen2.bounds.width;
                        videoPlayer.height = screen2.bounds.height;
                        videoPlayer.stage.scaleMode = StageScaleMode.NO_SCALE;
              videoPlayer.alwaysInFront = true;
              var DVR = new DVR_Player();
              DVR.name = "DVR";
              DVR.x = 0;
              DVR.y = 0;
              DVR.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              DVR.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              videoPlayer.stage.addChild(DVR);
                flvControl = DVR.display2;
              flvControl.width = 1280;
              flvControl.height = 720;
              flvControl.skin = null;
              flvControl.autoPlay=false;   
              flvControl.isLive=false;
              flvControl.fullScreenTakeOver = false;
              flvControl.align = VideoAlign.CENTER;
              flvControl.scaleMode = VideoScaleMode.NO_SCALE;
              flvControl.source = "olympics.f4v";
              flvControl.seekBar = transControl.seekbarContainer2.seeker;
              videoPlayer.activate();

    Does anyone have any ideas about this?

  • How can I get my movie clip to resize according to screen size?

    I have a movie clip (startMenu); inside it there are buttons, text, and graphics. This is a game I am making, and it will be played on different screen sizes of Android. This is the code I have so far:
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT
    startMenu.addEventListener(Event.RESIZE, resizeLayout);
    function resizeLayout(e:Event):void
        setPosition();
    function setPosition():void
         startMenu.x = (stage.stageWidth - startMenu.width) / 2;
            startMenu.y = (stage.stageHeight - startMenu.height) /2;
    When I run it on different phones using debugging, it locks on the left hand corner, but does stretch out to fit the whole screen. What should I do?

    try changing
    stage.scaleMode = StageScaleMode.NO_SCALE;
    to
    stage.scaleMode = StageScaleMode.EXACT_FIT;
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageScal eMode.html

  • Change the default colours in line chart

    hi everyone,
    I'am a new user in Flex, and I am facing my first barrier
    I am using a code to interact a table and a graph
    the defaults colours of the lines are orange and a kind of green
    I would like to change these colours to red and pure green if it's possible
    here is my code
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute" width="600" height="600"
    creationComplete="init()" applicationComplete="stage.scaleMode = StageScaleMode.EXACT_FIT;">
    <mx:Script>
    <![CDATA[
    [Bindable] private var chartData:XML;
    private function init():void
    //Inject the JavaScript functions we need to interface with the RMA
    //You can find the scripts below in the "acroJSFunctions" string object
    ExternalInterface.call("eval", acroJSFunctions);
    //set up callback for upadtes
    //the format script in each of the fields uses callAS to send the field name and it's value to the RMA
    //the function for this callback then modifies the XML that drives the chart.
    ExternalInterface.addCallback("changeData", changeData);
    //set up callbacks for commenting
    ExternalInterface.addCallback( "multimedia_getState", getState );
    ExternalInterface.addCallback("multimedia_setState", setState);
    loadDefaultXML();
    private function loadDefaultXML():void
      var req:URLRequest = new URLRequest("defaultChartData.xml");
    var loader:URLLoader = new URLLoader(req);
    loader.addEventListener("complete", xmlLoaded);
    private function xmlLoaded(event:Event):void
        chartData = new XML(event.target.data);
        loadDataFromAcroFields();
    private function loadDataFromAcroFields():void
        //get the values from the PDF
        var c:int;
        var r:int;
        for (c=0;c<2;c++)
       for (r=0;r<16;r++)
          var result:String = ExternalInterface.call("getFieldValue",r, c);
          chartData.children()[r].children()[c] = int(result);
    private function changeData(name:String, value:String):void
    //this function gets called when the field value in the PDF file changes
    //look in the format script for the field in the PDF.
    //the field name is in the form "table.r.c" where r is the row number and c is the column.
    //So the first field in the table would be called "table.0.0"
    //By splitting the string into an array, I can modify the corresponding element in the XML object that drives the chart.
    var fieldNameArray:Array = name.split(".");
    var row:int = int(fieldNameArray[1]);
    var column:int = int(fieldNameArray[2]);
    var val:int = int(value);
    chartData.children()[row].children()[column] = val
    private function getState():String
    //store the chart data XML
    return chartData.toString();
    private function setState(stateData:String):Boolean
    chartData = new XML(stateData);
    var c:int;
    var r:int;
        for (c=0;c<2;c++)
       for (r=0;r<16;r++)
          var fieldVal:String = chartData.children()[r].children()[c].toString();
          var result:String = ExternalInterface.call("setFieldValue",r, c, fieldVal);
    return true;
    ]]>
    </mx:Script>
    <mx:String id="acroJSFunctions">
    <![CDATA[
    function getFieldValue(row, column)
        fieldName="table."+row+"."+column;
        fieldValue = this.getField(fieldName).value;
        return fieldValue;
    function setFieldValue(row, column, value)
        fieldName="table."+row+"."+column;
        this.getField(fieldName).value = value;
    ]]>
    </mx:String>
    <mx:SeriesInterpolate id="interpolateIn" duration="1000"/>
    <mx:Canvas backgroundColor="#FFFFFF" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="solid" borderThickness="1" borderColor="#000000">
        <mx:LineChart id="chart" dataProvider="{chartData.totals}" showDataTips="true"
         left="10" top="10" right="10" bottom="10">
         <mx:horizontalAxis>
          <mx:CategoryAxis categoryField="Day"/>
      </mx:horizontalAxis>
      <mx:series>
       <mx:LineSeries yField="FY06" displayName="No. errors" showDataEffect="{interpolateIn}"/>
       <mx:LineSeries yField="FY07" displayName="No. lines" showDataEffect="{interpolateIn}"/>
      </mx:series>
    </mx:LineChart>
         <mx:Legend dataProvider="{chart}" right="25" bottom="25" borderStyle="outset"/>
    </mx:Canvas>    
    </mx:Application>
    I've tried to read this post: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7c5c.html#WS2d b454920e96a9e51e63e3d11c0bf6568f-7ff5
    then I've tried to understand how can I modify and insert the following code to mine, I've tried but doesn't work
    <mx:series>
               <mx:LineSeries yField="profit" displayName="Profit">
                <mx:lineStroke>
                    <mx:SolidColorStroke
                        color="0x0099FF"
                        weight="20"
                        alpha=".2"/>
                </mx:lineStroke>               
               </mx:LineSeries>
               <mx:LineSeries yField="expenses" displayName="Expenses">
                <mx:lineStroke>
                    <mx:SolidColorStroke
                        color="0x0044EB"
                        weight="20"
                        alpha=".8"/>
                </mx:lineStroke>               
               </mx:LineSeries>
            </mx:series>
    can you please help me?
    thanks a lot
    Win 7 64 bits
    Adobe Flash Builder 4.6 Premium

    Well, I'm getting closer.  I have resorted the legend according to the order of the lines on the chart, by doing the following:
    > chart expert
    > data tab
    > select field from "On change of" list
    > Top N button
    > For this group sort "All", based on the same field as I selected from the "On Change of" list, in descending order
    > click OK and OK again.
    Although this worked, I'm pretty sure it's sorting on the wrong year.  I would like the legend to be sorted descending, according to the values in 2010, not 2006, which it appears to be doing.  Any ideas?
    By the way, my apologies if I mislead anyone by saying I have grouped charts.  It's actually an advanced report that is grouped by one of my data fields.  This produces a new chart for each group automatically.
    Thanks again.  I appreciate all offers of help!

  • Cd-rom for Mac and Windows

    Hi there,
    I want to make an hybrid cd-rom for both, Mac and Windows, and I am using the fscommand code in the first frame of my actions:
    fscommand("fullscreen","false"); // returns the player to normal menu view.
    fscommand("allowscale","false"); //sets the player so that the SWF file is always drawn at its original size and never scaled.
    I want both commands with their properties, however the displayState property is new to me. Please, Could you help me to do the same with this?.
    Of course all in AS3.
    I also have a code for a button that closes the .app of the .exe:
    function cerrar(e:MouseEvent):void {
    fscommand("quit");
    cerrar_btn.addEventListener(MouseEvent.CLICK, cerrar);
    Thanks in advance.

    The stage displayState and scale properties are like so:
    // fullscreen
    stage.displayState = StageDisplayState.FULL_SCREEN;
    // fullscreen with keyboard active
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    // non-fullscreen
    stage.displayState = StageDisplayState.NORMAL;
    Note that changing the displayState is usually done after the first frame is rendered so adding in a listener for that before changing it is a good idea. The scale and align don't require this.
    e.g.
    addEventListener(Event.ENTER_FRAME, _onEF);
    function _onEF(e:Event):void
         // frame has rendered, remove listener
         removeEventListener(Event.ENTER_FRAME, _onEF);
         // change display state
         stage.displayStage = StageDisplayState.FULL_SCREEN;
    Speaking of align, if you use NO_SCALE and expect to resize, you'll probably want to anchor the resizing from the upper left, like so:
    // top left registration
    stage.align = StageAlign.TOP_LEFT;
    Otherwise upon resize the upper left pixel will actually go into negative numbers.
    Scaling is:
    // no scale
    stage.scaleMode = StageScaleMode.NO_SCALE;
    // scale to fit exactly (aspect not maintained)
    stage.scaleMode = StageScaleMode.EXACT_FIT;
    // scale but maintain aspect:
    stage.scaleMode = StageScaleMode.NO_BORDER;
    Exiting a projector, still the same..
    import flash.system.fscommand;
    cerrar_btn.addEventListener(MouseEvent.CLICK, cerrar);
    function cerrar(e:MouseEvent):void
         fscommand("quit");

  • HELP PLEASE - loading external swf scale problem

    I have a Flex 3 Actionscript Project. Basically all it does it take some flash vars, set the sound volume,  and load an external swf using a loader and add the loader as a child. The problem is I want the loaded external swf to be scaled to fill the entire stage, even if it distorts it, and that doesn't seem to be happening.
    I really need to resolve this. ANY HELP APPRECIATED.
    Marcus

    Thanks for the reply!
    Here's basically what my code looks like (note: I cut some stuff out that wasn't relevant for the sake of clarity).
    private var swfLoader:Loader = null;
    public function MySwfContainer()  
        stage.scaleMode = StageScaleMode.EXACT_FIT;
        stage.align = StageAlign.TOP_LEFT;
        var request:URLRequest = new URLRequest(swfUrl);
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,SWFLoader_Complete);
        swfLoader.load(request);       
    private function SWFLoader_Complete(event:Event):void
        addChild(swfLoader);
    What I am observing is that if a swf larger than the stage area is loaded it clips it rather than scale it down and make it fit.
    Marcus

  • Batch operation in function

    hey folks,
    I have a number of mcs labelled h 1-15. I want to have a function that if someone places an mc on it, it'll lock to the h mc centered. So I'm thinking I'll have a function similar to this (see below). Is there a way to run this without having to do 15 of the else ifs?
    function dragchange(e:DisplayObject):void{ 
    if(h1.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.2,rotation:0});
    } else if (h2.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    } else if (h3.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
    } else {
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    me.x =500
    me.y=500

    hey voodoo, pretty simple coder here. The dragchange function name is just a place holder. Really this function will serve as a lock in place function. So when the user grabs a card and drags it to the specified area, there are "pockets", I want the card they choose to lock into the center of the pocket. So I have 15 pockets designated h1-15. The "me" is the dragged object that is currently active. so my whole code currently looks like this. The lockinplace function is actually the one I meant. Would the code you provided still work?
    // listeners
    helpmenu.xbutton.addEventListener(MouseEvent.CLICK, xbuttonclick);
    answermenu.xanswerbutton.addEventListener(MouseEvent.CLICK, xanswerbuttonclick);
    backbutton.addEventListener(MouseEvent.CLICK, backclick);
    helpbutton.addEventListener(MouseEvent.CLICK, helpclick);
    answerbutton.addEventListener(MouseEvent.CLICK, answerclick);
    stage.addEventListener(Event.ENTER_FRAME,_fullScreen);
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import com.greensock.*;
    import flash.media.Sound;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.display.StageDisplayState;
    helpmenu.visible=false;
    answermenu.visible=false;
    //cdcasetop.mouseEnabled = false;
    //variable declarations
    //var dvdpickupsound:dvdpickup=new dvdpickup
    //var dvdputdownsound:dvdputdown=new dvdputdown
    for(var i:int=1;i<=15;i++){
    this["pc"+i].addEventListener(MouseEvent.MOUSE_DOWN, grabMe);
    var me:Object;
    function grabMe(e:MouseEvent):void{
              me = e.currentTarget;
              me.removeEventListener(MouseEvent.MOUSE_DOWN, grabMe);
              me.startDrag(true);
              //TweenMax.to(me,0.2,{scaleX:1.2,scaleY:1.2,rotation:0});
              addChild(e.currentTarget as DisplayObject);
              //dvdpickupsoundplay();
              stage.addEventListener(MouseEvent.MOUSE_MOVE, dragMe);
              stage.addEventListener(MouseEvent.MOUSE_UP, dropMe);
    function dropMe(e:MouseEvent):void {
              stage.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
              stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragMe);
              me.stopDrag();
              //TweenMax.to(me,0.2,{scaleX:0.63,scaleY:0.63,rotation:0});
              me.addEventListener(MouseEvent.MOUSE_DOWN, grabMe)
              //dvdputdownsoundplay();
    function dragMe(e:MouseEvent):void {
              e.updateAfterEvent();
              dragchange(DisplayObject(e.currentTarget))
    function dragchange(e:DisplayObject):void{ 
    if(table.hitTestPoint(mouseX, mouseY, true)){
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.2,rotation:0});
    } else if (h1.hitTestPoint(mouseX, mouseY, true)){
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    } else if (clockbottom.hitTestPoint(mouseX, mouseY, true)){
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
    } else if (clockbottom1.hitTestPoint(mouseX, mouseY, true)){
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
    } else if (clockbottom2.hitTestPoint(mouseX, mouseY, true)){
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
    } else {
              setChildIndex(leftclocktop,numChildren - 1);
              setChildIndex(rightclocktop,numChildren - 1);
              setChildIndex(middleclocktop,numChildren - 1);
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    function lockinplace(e:DisplayObject):void{     
    function dragchange(e:DisplayObject):void{
    if(h1.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.2,rotation:0});
    } else if (h2.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    } else if (h3.hitTestPoint(mouseX, mouseY, true)){
              TweenMax.to(me,1,{scaleX:0.2,scaleY:0.1,rotation:0});
    } else {
              TweenMax.to(me,1,{scaleX:0.4,scaleY:0.4,rotation:0});
    me.x =500
    me.y=500
    function _fullScreen(e:Event):void
       stage.removeEventListener(Event.ENTER_FRAME,_fullScreen);
       stage.scaleMode = StageScaleMode.EXACT_FIT;
       stage.displayState = StageDisplayState.FULL_SCREEN;
    //nav bar items
    function backclick(event:MouseEvent):void{
              answermenu.visible=false;
              helpmenu.visible=false;
    function helpclick(event:MouseEvent):void{
              helpmenu.visible=true;
              answermenu.visible=false;
              setChildIndex(helpmenu,numChildren - 1)
              TweenMax.to(helpmenu, 3, {y:350, startAt:{y:600}, ease:Elastic.easeOut});
    function xbuttonclick(event:MouseEvent):void{
              helpmenu.visible=false;
    function answerclick(event:MouseEvent):void{
              answermenu.visible=true;
              helpmenu.visible=false;
              setChildIndex(answermenu,numChildren - 1)
              TweenMax.to(answermenu, 3, {y:350, startAt:{y:600}, ease:Elastic.easeOut});
    function xanswerbuttonclick(event:MouseEvent):void{
              answermenu.visible=false;
              helpmenu.visible=false;
    //sound items
    //function mainclicksoundplay():void{
    //mainclicksound.play();

  • AS3 Loading problem

    Hello All,
                 I have written a simple AS3 Code to load a SWF File on he Stage. The file is loading properly but the Within the stage. The Width and height of the SWF file change. Like LoaderInfo return file size 200X200 , but after adding child the Width and height changes to 150.23 X150.23. I'm accessing the length of the loader.content property. At what ratio the change is a happening? I have attached the code...  Document property show content radio button clicked.
    stage.scaleMode=StageScaleMode.EXACT_FIT;
    //stage.scaleMode=StageScaleMode.NO_SCALE;
    //stage.scaleMode=StageScaleMode.SHOW_ALL;
    var Clip:Loader = new Loader();
    var req:URLRequest=new URLRequest("1.swf");
    Clip.contentLoaderInfo.addEventListener(Event.INIT,initListener);
    Clip.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadingDone);
    Clip.load(req);
    var info:LoaderInfo;
    function initListener(event:Event):void {
         var SwfClip:Loader=Loader(event.target.loader);
         info=LoaderInfo(SwfClip.contentLoaderInfo);
         trace("File properties :- \n" + "width :- " + info.width + "\nHeight :- " + info.height);
    function LoadingDone(event:Event):void {     
         this.addChild(Clip);          
         trace(Clip.width + "  " + Clip.height + " " + (event.target.content).width + "  " +(event.target.content).height);

    You have stage.scaleMode set to EXACT_FIT which is causing the container to scale... and causing the loaded swf to scale as well. Remove that, or use No_SCALE and it will return the proper size.

  • AIR window mode bug? How to use the mouse when transparent?

    Hey there,
    I'm trying to build a transparent desktop application in AIR and have set the window mode to transparent.
    The mouseposition and mouseevents only work when the mouse hovers over a visible movieclip but not on the background.
    How can I fix that? Or is it an bug like some people say?
    Also in fullscreen mode the stage is a LOT bigger than the actual screen.. i already set:
    stage.scaleMode= StageScaleMode.EXACT_FIT;
    stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    but it doesn't help at all.
    thanks for helping

    Are you attaching your mouse handlers to the stage? If not, try it -- that's the typical way to capture mouse events within the entire flash player window. I'm not 100% it works with a NativeWindow set to transparent, though, since the main purpose of transparent window background is to simulate a non-rectangle window. If you want to have a transparent background but still act like a rectangular window you can probably just add a transparent rectangle (alpha=0, visible=true) to capture mouse events.
    Hope that helps.
    -Aaron

  • Flex Spark Datagrid - Scalable (font size) with No scroll Bars

    I was wondering what would be the most optimized way to scale (increase/decrease) the fonts size in a Spark DataGrid with NO Scroller, so as to make it when the User Resizes the DataGrid, the Fonts inside the Grid would increase/decrease. 
    Is there a way to listen for the size change of the DataGrid? 
    I would probably need to change the font size to increase/decrease as the event gets fired on Datagrid Resize. 
    Any suggestions?

    I've pasted as much code as I can legally can.  What i would like to achieve is that when the the window resizes, the Content & the DataGrid Scales. I am also aware of scalemode on the VBox, though it scale oddly with width more than height (this is internal).
    Else, I tried:
    protected function vgroup1_addedToStageHandler(event:Event):void
                //stage.scaleMode = StageScaleMode.EXACT_FIT;
                stage.scaleMode = StageScaleMode.SHOW_ALL;
                stage.align = StageAlign.TOP_LEFT;
                scaleX = .5;
                scaleY = .5; 
                /* if(stage.stageWidth != (event.currentTarget as VGroup).width || stage.stageHeight != (event.currentTarget as VGroup).height)
                    var scaling:Number = 1;
                    if(width>height)
                        scaling = stage.stageWidth / (event.currentTarget as VGroup).width;
                    else
                        scaling = stage.stageHeight / (event.currentTarget as VGroup).height;
                    scaleX = scaleY = scaling;
    == THIS IS All I can Post ==
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:components="components.*"
         viewSourceURL="srcview/index.html">
        <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import mx.events.ResizeEvent;
            import mx.rpc.events.ResultEvent;
            import mx.rpc.xml.SimpleXMLDecoder;
            import mx.utils.ArrayUtil;
            import mx.utils.ObjectUtil;
            import spark.components.ResizeMode;
            import spark.effects.Resize;
            // Skin Colors
            private const ALTERNATING_GRID_COLOR:Array = [ 0xF5F5F0 , 0xE7E4E9 ];
            private const ROLL_OVER_COLOR:int = 0x6D9960;
            private const SELECTION_COLOR:int = 0x668F59;
            private const TEXT_FONT_SIZE:int = 11;
            private const TEXT_COLOR:int = 0x080808;
            private const SUMMARY_TEXT_COLOR:int = 0xFAAFFF;
            // First column width
            private var collectiveFirstColumnWidth:int = 160;
            private var collectiveValuesColumnWidth:int = 50;
            // XML data
            [Bindable] private var portfolioSummary1:XMLList;
            [Bindable] private var reconstructedAC:ArrayCollection;
            private function convertXmlToArrayCollection(file:String):ArrayCollection {
                var xml:XMLDocument = new XMLDocument(file);
                var decoder:SimpleXMLDecoder = new SimpleXMLDecoder();
                var data:Object = decoder.decodeXML(xml);
                var array:Array = ArrayUtil.toArray(data);
                return new ArrayCollection(array);
            private function convertToAC():void {
                var ac1:ArrayCollection = convertXmlToArrayCollection(psr1)
                trace(ObjectUtil.toString(ac1));
                //reStructureAC(ac1);
            private function restructureXMLIntoHierarchicalAC():void {
            private function addProperty(obj:Object, attribute:String, value:String):Object {
                var o:Object = obj;
                o[attribute] = value;
                return o;
            protected function httpservice1_resultHandler(event:ResultEvent):void
                portfolioSummary1 = event.result.Analytics.Side.Analytic as XMLList;
                trace('-----\nSide: Sell' + ObjectUtil.toString(event.result.Analytics.Side.(@name=='Sell')));
                trace('-----\nSide: Buy: Analytic Values : \n' + ObjectUtil.toString(event.result.Analytics.Side.(@name=='Buy').Analytic.@value));
                //dg.dataProvider = new XMLListCollection(portfolioSummary1);
                //dg.requestedRowCount = dg.dataProviderLength;
            protected function vgroup1_addedToStageHandler(event:Event):void
                //stage.scaleMode = StageScaleMode.EXACT_FIT;
                stage.scaleMode = StageScaleMode.SHOW_ALL;
                stage.align = StageAlign.TOP_LEFT;
                scaleX = .5;
                scaleY = .5; 
                /* if(stage.stageWidth != (event.currentTarget as VGroup).width || stage.stageHeight != (event.currentTarget as VGroup).height)
                    var scaling:Number = 1;
                    if(width>height)
                        scaling = stage.stageWidth / (event.currentTarget as VGroup).width;
                    else
                        scaling = stage.stageHeight / (event.currentTarget as VGroup).height;
                    scaleX = scaleY = scaling;
            protected function vgroup1_resizeHandler(event:ResizeEvent):void
                (event.currentTarget as VGroup).resizeMode = ResizeMode.SCALE;
        ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="psr1" source="data/PortfolioSummaryResponse1.xml" />
            <fx:XML id="psr2" source="data/PortfolioSummaryResponse2.xml" />
            <fx:XML id="psr3" source="data/PortfolioSummaryResponse3.xml" />
            <s:XMLListCollection id="headXMLListCol"
                source="{psr1.children()}" />
            <s:HTTPService id="portfolio_HS" result="httpservice1_resultHandler(event)"
                resultFormat="e4x" url="data/PortfolioSummaryResponse1.xml" />
        </fx:Declarations>
        <s:VGroup id="vbox" width="100%" height="100%" top="0" left="0" bottom="0" gap="0" addedToStage="vgroup1_addedToStageHandler(event)">
            <!-- First DataGrid -->
            <components:ExpandableDataGrid5 id="dg"
                color="{TEXT_COLOR}"
                rollOverColor="{ROLL_OVER_COLOR}"
                alternatingRowColors="{ALTERNATING_GRID_COLOR}"
                selectionColor="{SELECTION_COLOR}"
                skinClass="skins.ResizableDataGridSkin"
                >
                <components:columns>
                    <s:ArrayList>
                        <s:GridColumn id="field1" dataField="dataField1" headerText="Portfolio Summary"
                            itemRenderer="itemRenderers.LeftAlignGridItemRenderer"
                            headerRenderer="itemRenderers.HeaderGridItemRenderer"
                            />
                        <s:GridColumn id="field2" dataField="dataField2" headerText="Buy"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            headerRenderer="itemRenderers.RightAlignHeaderGridItemRenderer"
                            />
                        <s:GridColumn id="field3" dataField="dataField3" headerText="Sell"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            headerRenderer="itemRenderers.RightAlignHeaderGridItemRenderer"
                            />
                        <s:GridColumn id="field4" dataField="dataField4" headerText="Total"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            headerRenderer="itemRenderers.RightAlignHeaderGridItemRenderer"
                            />
                    </s:ArrayList>
                </components:columns>
                <components:dataProvider>
                    <s:ArrayCollection>
                        <fx:Object dataField1="data1" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data2" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data3" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data4" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data5" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data6" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data7" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data8" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data9" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data10" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data11" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                        <fx:Object dataField1="data12" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data13" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data14" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                        <fx:Object dataField1="data15" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                    </s:ArrayCollection>
                </components:dataProvider>
            </components:ExpandableDataGrid5>
            <!-- Summary Totals -->
            <components:SummaryRow >
                <s:Label text="Summary Totals" fontWeight="bold" color="{SUMMARY_TEXT_COLOR}"/>
                <s:Spacer width="100%" />
                <s:ButtonBar click="convertToAC()"> 
                    <mx:ArrayCollection>
                        <fx:String>Convert to AC</fx:String>
                        <fx:String>CPS</fx:String>
                    </mx:ArrayCollection>
                </s:ButtonBar>
                <s:ButtonBar click="restructureXMLIntoHierarchicalAC()"> 
                    <mx:ArrayCollection>
                        <fx:String>Parse XML</fx:String>
                        <fx:String>15% POV</fx:String>
                    </mx:ArrayCollection>
                </s:ButtonBar>
            </components:SummaryRow>
            <!-- Second Datagrid -->
            <components:ExpandableDataGrid5 id="dg2"
                color="{TEXT_COLOR}"
                rollOverColor="{ROLL_OVER_COLOR}"
                selectionColor="{SELECTION_COLOR}"
                alternatingRowColors="{ALTERNATING_GRID_COLOR}"
                skinClass="skins.HeadlessDataGridSkin"
                >
                <components:columns>
                    <s:ArrayList>
                        <s:GridColumn dataField="dataField1"
                            itemRenderer="itemRenderers.LeftAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField2"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField3"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField4"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                    </s:ArrayList>
                </components:columns>
                <s:ArrayList>
                    <fx:Object dataField1="data16" dataField2="data2" dataField3="data2"  dataField4="data16"></fx:Object>
                    <fx:Object dataField1="data17" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                </s:ArrayList>
            </components:ExpandableDataGrid5>
            <!-- Summary Totals - values -->
            <components:SummaryRow>
                <s:Label text="Summary Totals - Values" width="100%" fontWeight="bold" color="{SUMMARY_TEXT_COLOR}"/>
            </components:SummaryRow>
            <!-- Third Datagrid -->
            <components:ExpandableDataGrid5 id="dg3"
                color="{TEXT_COLOR}"
                rollOverColor="{ROLL_OVER_COLOR}"
                selectionColor="{SELECTION_COLOR}"
                alternatingRowColors="{ALTERNATING_GRID_COLOR}"
                skinClass="skins.HeadlessDataGridSkin"
                >
                <components:columns>
                    <s:ArrayList>
                        <s:GridColumn dataField="dataField1"
                            itemRenderer="itemRenderers.LeftAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField2"
                            itemRenderer="itemRenderers.ToolTipItemRenderer"
                            />
                        <s:GridColumn dataField="dataField3"
                            itemRenderer="itemRenderers.ToolTipItemRenderer"
                            />
                        <s:GridColumn dataField="dataField4"
                            itemRenderer="itemRenderers.ToolTipItemRenderer"
                            />
                    </s:ArrayList>
                </components:columns>
                <s:ArrayList>
                    <fx:Object dataField1="data18" dataField2="data2" dataField3="data3"  dataField4="data16"></fx:Object>
                    <fx:Object dataField1="data19" dataField2="data3" dataField3="data3" dataField4="data17"></fx:Object>
                </s:ArrayList>
            </components:ExpandableDataGrid5>
            <!-- Percent of Tops -->
            <components:SummaryRow>
                <s:Label text="Percent of Tops" color="{SUMMARY_TEXT_COLOR}" width="100%" fontWeight="bold"/>
            </components:SummaryRow>
            <!-- Fourth DataGrid -->
            <components:ExpandableDataGrid5 id="dg4"
                color="{TEXT_COLOR}"
                rollOverColor="{ROLL_OVER_COLOR}"
                selectionColor="{SELECTION_COLOR}"
                alternatingRowColors="{ALTERNATING_GRID_COLOR}"
                skinClass="skins.HeadlessDataGridSkin"
                >
                <components:columns>
                    <s:ArrayList>
                        <s:GridColumn dataField="dataField1"
                            itemRenderer="itemRenderers.LeftAlignGridItemRenderer"  />
                        <s:GridColumn dataField="dataField2"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField3"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                        <s:GridColumn dataField="dataField4"
                            itemRenderer="itemRenderers.RightAlignGridItemRenderer"
                            />
                    </s:ArrayList>
                </components:columns>
                <s:ArrayList>
                    <fx:Object dataField1="data20" dataField2="data1" dataField3="data1" dataField4="data20"></fx:Object>
                    <fx:Object dataField1="data21" dataField2="data2" dataField3="data2" dataField4="data21"></fx:Object>
                    <fx:Object dataField1="data22" dataField2="data3" dataField3="data3" dataField4="data22"></fx:Object>
                </s:ArrayList>
            </components:ExpandableDataGrid5>
        </s:VGroup>
    </s:Application>
    ExpandableDataGrid5.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:DataGrid xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                horizontalScrollPolicy="off"
                verticalScrollPolicy="off"
                selectionMode="singleCell"
                variableRowHeight="true"
                requestedColumnCount="4"
                width="100%"
                resizableColumns="false"
                creationComplete="thisDatagrid_creationCompleteHandler(event)"
                >
        <fx:Script>
            <![CDATA[
                 import mx.events.FlexEvent;
                /*import mx.events.ResizeEvent;
                [Bindable] private var oldWidth:int;
                [Bindable] private var oldHeight:int;
                protected function thisDatagrid_resizeHandler(event:ResizeEvent):void
                    oldWidth = event.oldWidth;
                    oldHeight = event.oldHeight;
                    this.invalidateDisplayList();
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                    if (oldWidth < width) {
                        setStyle('fontSize', getStyle('fontSize') + 0.5); // might wanna~ width % height to increase by a certain pt
                        //this.scaleX += .1;
                    } else if (oldWidth > width) {
                        setStyle('fontSize', getStyle('fontSize') - 0.5);
                        //this.scaleX -= .1;
                    trace('unscaledWidth: ' + unscaledWidth);
                    trace('unscaledHeight: ' + unscaledHeight);
                    trace('explicitMinHeight: ' + explicitMinHeight);
                    trace('explicitMinWidth: ' + explicitMinWidth);
                    minHeight = measuredMinHeight;
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
                protected function thisDatagrid_creationCompleteHandler(event:FlexEvent):void
                    requestedRowCount = dataProviderLength;
                    requestedMaxRowCount = dataProviderLength;
                    requestedMinRowCount = dataProviderLength;
                    minHeight = measuredHeight;
                /* protected function datagrid1_addedToStageHandler(event:Event):void
                    stage.scaleMode = StageScaleMode.SHOW_ALL;
                    /*                stage.align = StageAlign.TOP;
                     this.width = stage.stageWidth;
                    this.height = stage.stageHeight;
            ]]>
        </fx:Script>
    </s:DataGrid>
    You can Check other ExpandableDataGrids:
    <?xml version="1.0" encoding="utf-8"?>
    <s:DataGrid xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                resize="thisDatagrid_resizeHandler(event)"
                creationComplete="thisDatagrid_creationCompleteHandler(event)"
                horizontalScrollPolicy="off" verticalScrollPolicy="off"
                selectionMode="singleCell"
                variableRowHeight="true"
                requestedColumnCount="4"
                editable="false"
                width="100%"
                >
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                import mx.events.ResizeEvent;
                protected function thisDatagrid_resizeHandler(event:ResizeEvent):void
                    //event.stopImmediatePropagation();
                    if (event.oldWidth < width) {
                        setStyle('fontSize', getStyle('fontSize') + 0.5); // might wanna~ width % height to increase by a certain pt
                        //this.scaleX += .1;
                    } else if (event.oldWidth > width) {
                        setStyle('fontSize', getStyle('fontSize') - 0.5);
                        //this.scaleX -= .1;
                    minWidth = measuredMinWidth;
                protected function thisDatagrid_creationCompleteHandler(event:FlexEvent):void
                    requestedRowCount = dataProviderLength;
                    requestedMaxRowCount = dataProviderLength;
                    requestedMinRowCount = dataProviderLength;
                    minHeight = measuredMinHeight;
            ]]>
        </fx:Script>
    </s:DataGrid>
    OR
    <?xml version="1.0" encoding="utf-8"?>
    <s:DataGrid xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                horizontalScrollPolicy="off"
                verticalScrollPolicy="off"
                selectionMode="singleCell"
                variableRowHeight="true"
                requestedColumnCount="4"
                width="100%"
                resize="thisDatagrid_resizeHandler(event)"
                creationComplete="thisDatagrid_creationCompleteHandler(event)"
                >
        <fx:Script>
            <![CDATA[
                 import mx.events.FlexEvent;
                 import mx.events.ResizeEvent;
                [Bindable] private var oldWidth:int;
                [Bindable] private var oldHeight:int;
                protected function thisDatagrid_resizeHandler(event:ResizeEvent):void
                    oldWidth = event.oldWidth;
                    oldHeight = event.oldHeight;
                    this.invalidateDisplayList();
                override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                    if (oldWidth < width) {
                        setStyle('fontSize', getStyle('fontSize') + 0.5); // might wanna~ width % height to increase by a certain pt
                        //this.scaleX += .1;
                    } else if (oldWidth > width) {
                        setStyle('fontSize', getStyle('fontSize') - 0.5);
                        //this.scaleX -= .1;
                    trace('unscaledWidth: ' + unscaledWidth);
                    trace('unscaledHeight: ' + unscaledHeight);
                    trace('explicitMinHeight: ' + explicitMinHeight);
                    trace('explicitMinWidth: ' + explicitMinWidth);
                    minHeight = measuredMinHeight;
                    super.updateDisplayList(unscaledWidth, unscaledHeight);
                protected function thisDatagrid_creationCompleteHandler(event:FlexEvent):void
                    requestedRowCount = dataProviderLength;
                    requestedMaxRowCount = dataProviderLength;
                    requestedMinRowCount = dataProviderLength;
                    minHeight = measuredHeight;
            ]]>
        </fx:Script>
    </s:DataGrid>

Maybe you are looking for

  • Include JSP in JSP - Error:  cannot be resolved to a type

    Hello, Several of my jsp pages include other jsp pages. The project has many errors: "x cannot be resolved to a type". Is there a way to resolve these errors? Below is a small example of the issue: JSP #1: <%@ page import="com.testing.Introduction" %

  • Corrupt communication channel (FILE/JDBC) still polling "without success"

    Hi all here are a lot of questions with high priority: We have problems with adapter engine XI7.0SPS11. It looks that if there is a short connection error some of our channels are still polling (status green) but they do not get the data. After resta

  • Balancing out the audio?

    I recently did a shoot for work out in a field on a windy day...editing the footage, the sound between clips isn't as even as i'd like it to be - are there any filters that can help me correct this? Thanks!

  • AF100 clip names not showing up in PP.  Still just numbers.

    Okay, so I copies the metadata to the camera and what not. Check. Record some clips. Check. When I view the clips in the Mac finder window, the name I gave the clips pre the metadata show up just fine (test0001, test 0002), but when I import those sa

  • Wildcard matching for a single uid/email address

    I need to create an account which will receive all mail who's "To:" field matches a string. Specifically, I wish to create a UID=mailproxy which will receive all mail addressed to *[email protected]  If it matters, mail addressed to this account will