Flex 4: How 2 Set Application Height/Width with Script?

I am new to Flex 4 and going through the 3 to 4 migration pain.
I need to set the size of my application programmatically. In Flex 3, I did it this way:
mx.core.Application.application.width  = theWidth; (equivalent for height).
I can not figure out how to do this with Flex 4. Searched high and low.
Help, please! TIA
Bruce

You can use this.height and this.width properties.

Similar Messages

  • [ASK] Set Network Address Restriction With Script

    Hi all, i have a question about set network address restriction.. if i post in wrong category i'm very sorry about it because i don't know where i supposed to post this..
    i need to set network address restriction to every user in my tree..
    the problem is there is hundreds of user that i need to set the restriction.. i think it will take a lot of time if i do it one by one..
    i created the user with script, and i want to ask whether there is a command to set network address restriction with script or maybe there is another simple way to set network address restriction..
    thanks..

    Is the restriction going to be the same for all users? Depending on what
    "script" you use, you should be able to also set the restriction at the
    same time - its just another attribute value to set.
    Peter
    eDirectory Rules!
    http://www.DreamLAN.com

  • Wpf/webbrowser:-how to get height,width,scroll height and scroll width of render html/xhtml/xml pages.

    hi I am using to web browser control to get  height,width,scroll height and scroll width in wpf c#.
    Could You please tell me how to achive this information if .pages contain this css on body.
     style="-webkit-column-width:800px;  margin-right:800px; -moz-column-width: 800px; column-width: 800px; -webkit-column-gap: 0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule:
    0px solid #000; height:800px; overflow:visible !important; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;"
    I have to get height,width,scroll height and scroll width  on on complete event.
    this is MainWindow.xaml page
    <Window x:Class="WPFWebBrowserInvokeScript.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="820" Width="820" Loaded="Window_Loaded">
        <Grid>
            <WebBrowser HorizontalAlignment="Left"
       Height="800"
       Margin="10,10,0,0"
       VerticalAlignment="Top"
       Width="800"
       Name="MainBrowser"/>
            <!--<Grid x:Name="grid1"></Grid>-->
        </Grid>
    </Window>
    this  MainWindow.xaml.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.IO;
    namespace WPFWebBrowserInvokeScript
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            public MainWindow()
                InitializeComponent();
            private void Window_Loaded(object sender, RoutedEventArgs e)
                string strHtml = "";
                using (StreamReader sr = new StreamReader("D:/epubunzip/ePub2_Sample03a_USgovernment_SE_Gr9-12_EN_U1/OPS/9780547451381_c01.html"))
                    strHtml = sr.ReadToEnd();
                    strHtml = strHtml.Replace("<body>", "<body  style=\"-webkit-column-width:800px; overflow:visible !important;  -moz-column-width: 800px; column-width: 800px; -webkit-column-gap:
    0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule: 0px solid #000; height:800px; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;\">");
                    string str = "<script> function execScript(){return document.body.scrollWidth;}</script></head>";
                    strHtml = strHtml.Replace("</head>", str);
                    byte[] bytes = Encoding.UTF8.GetBytes(strHtml);
                    MemoryStream ms = new MemoryStream();
                    ms.Write(bytes, 0, bytes.Length);
                    ms.Position = 0;
                    MainBrowser.NavigateToStream(ms);
                    //MainBrowser.NavigateToString(strHtml);
                    MainBrowser.LoadCompleted += new LoadCompletedEventHandler(MainBrowser_LoadCompleted);
            void MainBrowser_LoadCompleted(object sender, NavigationEventArgs e)
    //here I am trying to get  height,width,scroll height and scroll width
    //It's gtting wrong info
              WebBrowser webBrowser = (WebBrowser)sender;
                //mshtml.htmld webDocument = (mshtml.HTMLDDElement)webBrowser.Document;
                //mshtml.HTMLBody webBody = (mshtml.HTMLBody)webDocument;
                //    var dd = webDocument.InvokeScript("execScript");
                //    //  string script = "document.body.style.overflow ='hidden'";         
                //    // var dd = webDocument.InvokeScript("execScript", new Object[] { script, "JavaScript" });
                //    var elems = webBrowser.Document.GetElementsByTagName("body");
                //    System.Windows.Forms.HtmlElement webBody = (System.Windows.Forms.HtmlElement)webDocument.Body;
           

    >>if i am rendering html from MemoryStreamor string in webbrowser control in wpf It's not applying this css
    Yes it does. If you for example add background-color: yellow; to the stlyle you will see that the page turn yellow:
    strHtml = strHtml.Replace("<body>", "<body style=\"-webkit-column-width:800px; background-color: yellow; overflow:visible !important; -moz-column-width: 800px; column-width: 800px; -webkit-column-gap: 0px; -moz-column-gap: 0px; column-gap: 0px; -webkit-column-rule: 0px solid #000;-moz-column-rule: 0px solid #000;column-rule: 0px solid #000; height:800px; ; margin:0px; -moz-margin:0px;-webkit-margin:0px;display:block;\">");
    If the styles doen't get applied as expected it is a browser issue. The WebBrowser control emulates Internet Explorer in IE7 rendering mode by default.  You will have to change some registry settings to change this behaviour. Please refer to the following
    links for more information:
    http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/cf66e0cd-ab6f-45b8-b230-1d78f26670d2/opening-links-from-wpf-webbrowser-control-in-default-browser-instead-of-ie?forum=wpf
    -moz-column-width only works in FireFox for example.
    You may also navigate to an actual page and inject some javascript function that for example adds the styles to the body element dynamically or set the style properties of the body element directly:
    private void Window_Loaded(object sender, RoutedEventArgs e)
    MainBrowser.Navigate(@"E:/Epubs/ePub2_Sample05_Biology_SampleChapter_EN/OPS/ch01.xhtml");
    MainBrowser.LoadCompleted += new LoadCompletedEventHandler(webb_DocumentCompleted);
    private void webb_DocumentCompleted(object sender, NavigationEventArgs e)
    WebBrowser webBrowser = (WebBrowser)sender;
    dynamic doc = webBrowser.Document;
    //int _scrollWidth = (int)webBrowser.InvokeScript("execScript");
    //mshtml.HTMLDocument webDocument = (mshtml.HTMLDocument)webBrowser.Document;
    mshtml.HTMLScriptElement script = (mshtml.HTMLScriptElement)doc.createElement("script");
    script.setAttribute("type", "text/javascript");
    script.innerHTML = "function doSomething(){ /* do something here... */ }";
    //add script to the head
    dynamic head = doc.getElementsByTagName("head")[0];
    head.appendChild(script);
    mshtml.HTMLBody body = (mshtml.HTMLBody)doc.getElementsByTagName("body")[0];
    body.style.background = "yellow";
    //set any body.style property here...
    webBrowser.InvokeScript("doSomething");
    That's about it as far as WPF is concerned.
    Please remember to mark helpful posts as answer and/or helpful.

  • Flex charts: How to hide axis lines with CSS?

    Hello!
    How do I hide my axis lines with CSS? Shouldn't this work?
    <mx:Style>
      @namespace mx "library://ns.adobe.com/flex/mx";
      mx|ColumnChart {
        horizontalAxisStyleName: myAxisStyles;
        verticalAxisStyleName: myAxisStyles;
      .myAxisStyles { showLine: false; }
    </mx:Style>
    I also tried display: none.
    Prior to this I used:
    <mx:horizontalAxisRenderers>
      <mx:AxisRenderer showLine="false" axis="{someName.horizontalAxis}" />
    </mx:horizontalAxisRenderers>
    <mx:verticalAxisRenderers>
      <mx:AxisRenderer showLine="false" axis="{someName.verticalAxis}" />
    </mx:verticalAxisRenderers>
    But it produced some annoying warnings:
    Data binding will not be able to detect assignments to "horizontalAxis".
    Data binding will not be able to detect assignments to "verticalAxis".
    Thanks!
    --Dwayne

    Regarding the data binding warnings, see if you can get away without specifying the axis. Not sure if that will work. Otherwise, give the axis an id like the example at the bottom of http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/charts/AxisRenderer. html#axis.
    The doco for showLine says "Specifies whether to display the axis. The default value is true." I think it's referring to the line at the bottom of the axis, next to the numbers. It's nothing to do with the grid lines. Which explains why your code doesn't work.
    If you are not using gridlines at all (= not using the lines, not using horizontal-fill and horizontal-alternate-fill etc), then I think you can just get rid of them by specifying an empty array. Either in actionscript or in your chart tag (<mx:ColumnChart id="highlights" dataProvider="{results.result}" showDataTips="true">) add the argument: backgroundElements = "[]".
    If this is not desireable, go to plan b:
    You can control gridlines via css like this:
    mx|GridLines {
        gridDirection: both; // horizontal or vertical also accepted, but not "none".
    If you want none... well I've got some code where I do this:
    (backgroundElements[0] as GridLines).setStyle("gridDirection", "horizontal");
    // One of the arguments is the alpha, i.e. alpha=0 (translucent)
    var stroke:SolidColorStroke = new SolidColorStroke(0, 0, 0);
    (backgroundElements[0] as GridLines).setStyle("horizontalStroke", stroke);
    ... and that definitely works.

  • How set up alert Monitor with available to promise profile?!

    Gurus,
    I read a lot of notes about alert profile but I ´ve been in doubt.
    I set the monitor alert in /sapapo/amon1:
    - Selected alert type
    - Selected some products and my allocation
    - Assigned alert profile - defined the bucket
    Check instruction:
    - Activated "ATP Alert Act."
    I vent seen any place to assign my alert profile in /sapapo/bop. Is it possible or necessary?
    When I redetermine the alerts for my profile in /sapapo/amon1 any alerts are showed.
    I don´t want to use macros to create alert.
    I created a scenary to see an alert:
    My scenary
    Availability: 100
    Order confirmed: 100
    I changed my orders to 50.
    Availability: 50
    Order confirmed: 100
    Execute alert monitor
    Result: No warning
    I´m glad for your attention...
    Best Regards!

    Thiago,
    http://help.sap.com/bp_scmv250/BBLibrary/HTML/S21_EN_DE.htm
    Best Regards,
    DB49

  • How to get  textItem width with effects by using photoshop script

    HI,guys
    Is there any one met the same problem? I want to write a script can generate pics according the text content size dynamically, but I cant get the actual size of textItem with effects.

    #target photoshop-70.032
    var bounds = activeDocument.activeLayer.bounds;
    alert (bounds[2]-bounds[0]);
    seems to include Layer Styles like Outer Glow.

  • How to change a parameter with script

    Hi to All,
    Is it possible change to TRUE the Parameter "07_DICTIONARY_ACCESSIBILITY" with a script ?
    If Yes, how can perform this ?
    Thank You and Best Regards.
    Gaetano

    About 07_DICTIONARY_ACCESSIBILITY

  • How can I load data with Scripts on *FDM* to a HFM target System????

    Hi all!
    I need help because I can´t find a good guide about scripting on FDM. The problem I have is the next one.
    I have on mind to load my data with data load file in FDM to a HFM target system, but I would like to load an additional data using an event script, ie after validate. I would need any way to access to HFM system though FDM Scripts, is it possible??
    If so, It would be wonderful to get a data from HFM with any Point of View, reachable from FDM Scripts in order to load or getting any data.
    I´ve looking for a good guide about scripting in FDM but I couldn´t find any information about accessing data on HFM target system, does it really exist?
    Thanks for help

    Hi,
    Take a look at the LOAD Action scripts of your adapter. This might give you an idea.
    Theoretically it should be possible to load data in an additional load, but you need to be very careful. You don't want to corrupt any of the log and status information that is being stored during the load process. The audit trail is an important feature in many implementations. In this context it might not be a good idea to improve automation and risk compliance of your system.
    Regards,
    Matt

  • Charting using ActionScript and chart height,width and axis labels

    hello, i am creating charts using action script but can't
    seem to do 2 things right now. 1. put labels on the axisis. 2. i
    can't set the height/width to 100%. does anyone know how?...below
    is the function i use to create the charts
    public var myChart:BarChart;
    public var series1:BarSeries;
    public var legend1:Legend;
    private function addGraph():void {
    // Create the chart object and set some
    // basic properties.
    myChart = new BarChart();
    myChart.showDataTips = true;
    myChart.dataProvider = feedRequest.lastResult.root.data;
    // Define the category axis.
    var vAxis:CategoryAxis = new CategoryAxis();
    vAxis.categoryField = yAxis;
    vAxis.dataProvider = feedRequest.lastResult.root.data;
    myChart.verticalAxis = vAxis;
    myChart.width=100;
    myChart.height=100;
    var la = new LinearAxis;
    // Add the series.
    var mySeries:Array=new Array();
    series1 = new BarSeries();
    series1.xField=xAxis;
    series1.yField=yAxis;
    series1.displayName = xAxis;
    mySeries.push(series1);
    myChart.series = mySeries;
    // Create a legend.
    legend1 = new Legend();
    legend1.dataProvider = myChart;
    // Attach chart and legend to the display list.
    chartWindow.addChild(myChart);
    chartWindow.visible=true;
    }

    use the percentWidth and percentHeight properties.

  • WPF application should communicate with endpoints

    How   WPF application should communicate with endpoints?

    Hi ,
    Thanks for posing!
    Do you want to using WPF call endpoint in azure service? I suggest you could create a WCF service as web role or a worker role on azure project, and use your WPF application call WCF service. You could set the endpoint in WCF configuration and WPF configuration.
    You could refer to this sample code:
    http://www.codeproject.com/Articles/188464/Host-WCF-Services-in-an-Azure-Worker-Role
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I Reconcile all tables on multiples mappings with scripting????

    I have OWB 9.2.0.2.8
    I have to reconcile all tables and external tables on multiple mappings.
    How can I do it with scripting language, please?
    Thanks very much in advance!!!!

    Good afternoon Claudio,
    Should be something like this:
    foreach mapName [OMBLIST MAPPINGS] {
      puts "Checking $mapName"
      foreach tabName [OMBRETRIEVE MAPPING '$mapName' GET TABLE OPERATORS] {
        puts "Reconciling $tabName"
        OMBRECONCILE TABLE '$tabName' \
          TO MAPPING '$mapName' \
          OPERATOR '$tabName' \
          USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_ID');
    }If you want to alter reconcile and/or matching strategy, check documentation on OMBRECONCILE in the OWB Scripting Reference.
    Good luck, Patrick

  • Problem Running App with Scripting Bridge on MAC OS X TIger

    Hi,
    I have an application which link with Scripting Bridge Frame work, use XCODE 3.0 and SDK 10.5. I use Scripting Bridge, to control some functionality of ITune from Objective-C. This Application run fine on Leopard and behave as expected. When I Run this application on Tiger this does not load.
    Considering that scripting Bridge was first released om Leopard.
    Can my Above Application Run on Tiger. If not how do I interface ITune from Objective-C, on both Tiger and Leopard? IS there update which suppose to fix this?
    Thanks
    Akhilesh

    webdevcda wrote:
    Considering that scripting Bridge was first released om Leopard.
    Can my Above Application Run on Tiger.
    No.
    If not how do I interface ITune from Objective-C, on both Tiger and Leopard? IS there update which suppose to fix this?
    There will be no update for old products like Tiger. What there is is all you will ever get. For Tiger, you will have to dig into sending Apple Events to iTunes manually. Or it might be easier to define your Apple Scripts as string resources in your application an execute them via a system() call.

  • How to sign a profile via Script

    Hi,
    i have managed an internal Website on which a User can log in with his Active Directory Account. The Site is looking for his phone number in the AD and an additional "AirTerminal" account for his phone number. If everything is ok, the User has the choice to select iPhone or Windows Mobile. After the choice he can push a button "Send Configuration".
    The Configuration will be sent out to his phone with a SMS which includes a One-Time-URL. This One-Time-URL can, of course, be used only once, after that the URL will not work anymore.
    The URL contains a File, specially for this particullary user, preconfigured with his E-Mail, Domain and Username. After the Profile is installed, the User is only be prompted to supply his Windows Password for Exchange.
    This is working fine!!! We do not have any problems with this kind of deployment and the Users like it.
    The only thing disturbing is the "Unsigned" showing up in the Profile. We would like to sign this Profile and really do not want to use the ICU or SCEP and so on. Our solution is completely independent of infrastructure. The solution can be used with any kind of LDAP. So no need fpr Microsoft AD and so on...
    How can this be resolved with scripting like shell, bash, php or whatever...
    Could be that there is one time, and we will be kick off Microsoft, or whatever...
    Kind regards
    Stefan

    setPageBoxes() :
    But the contents do not fit to the page size.
    How to resize the contents to fit to the page size?

  • How to set a minimum width and height for a stage or scene?

    Hello,
    Does anyone how to set a minimum width and height for a stage or scene?
    I tried listening for width/height property value changes and then adjust the width/height if necessary, but that causes unpleasant flickering of the window.
    In JavaFX 2.1 beta SDK for Mac OS, the Stage class has setMinWidth() and setMinHeight() functions which work very well.
    I'm wondering what's the equivalent way to do that when using the FX SDK for Windows.
    Any help is appreciated!
    Thanks.

    I was wondering how to enforce a minimum stage size with JavaFX 2.0.3.The same flickering way you are currently doing it. See: http://javafx-jira.kenai.com/browse/RT-15200 "Need a way to set the minimum size of a window"

  • How to set specific height in JLabel but vary in width ...

    Hi,
    I want to set the height of JLabel to fix height but vary the width according to the content of the label...
    How does I do that ??
    JLabel lbl = new JLabel("Hello this is aman");
    lbl.setPreferredSize(100,30);
    If the the text is changed, the width will be truncated at 100 pixels... how do I change
    that to height 30, but width change according to text ?
    thank

    Hi..
    may be this works for you ---
    since u want to adjust the width with the text size.. means that you will be taking an input from the user and then set it on the label.. so before setting the text on the label & width of label .. get the length of the text and set this length as the width parameter to method setPrefferedSize()..
    ex:
    // get the text from textbox
    String userinp = textbox.getext();
    JLabel lbl = new JLabel();
    lbl.setPreferredSize(userinp.length,30);
    lbl.setText(userinp);

Maybe you are looking for

  • Remote Desktop Connection stop working after upgrade from 10.5.8 to 10.6.1

    I too could not connect to a W2K3 server with RDC 2.0.1 after upgrading from Mac OS X, 10.5.8 to 10.6/10.6.1. I have another Mac which is on 10.5.8 and connect fine with the same version of RDC 2.0.1 as well as other PC with Terminal Service Clients.

  • Apple Symbols font not working with Photoshop CS2...

    This seems rather strange to me, but only a few characters will type....I've tried 'option+key' - 'control+key' - shift+key and 'apple+key' ....and the ones that show up, I do not even see in the font book display of this font. I have done a search a

  • When is the ipad mini 2 coming out in the uk

    is the ipad mini 2 coming out after the 24th of april can i at least be told that info

  • Looks like final cut pro does run and "runs well" on macbook

    http://www.creativemac.com/articles/viewarticle.jsp?id=43717 "Contrary to the bizarre rumor, the MacBook can indeed run Final Cut Pro, and it can run it quite well, if these tests are any indication. For Final Cut Pro, we ran four individual tests to

  • The best AP for large warehouse deployment ?

    Hi, Hope you peeps can assist. New design / installation at a warehouse.... What is the best / recommended AP for a warehouse with shelving 10m high and 1.8m appart  and a ceiling at about 11.5m? Warehouse is 129m x 97m, about  60% of the floor will