Stage height width problem

Hi Everyone ,
I am quite new to Flash ,
I have made one flash swf in flash cs3 using action script 2
My requirment is like this -
if client's resolution is less than or equal to 1024*768 i
have to show scroll pane of size 410 and when resoution is higher
than this i have to show scroll pane of size 540 . _x and _y
of scroll pane is 0,0 all other things on flash is relative to this
scroll pane so they take their _x and _y accordingly .(By the way i
have only more movie clip on stage that is of height 160)
I have used System.capabilities.screenResolutionX and
System.capabilities.screenResolutionY to detect resolutions
and have made scroll pane and movie clip to render
accordingly .
Now my problem is that there is no way i can change the size
of stage dynamically as height and width of stage is read only
(correct me if m wrng ) , so if i take my stage size ,according to
hight resolution ie scroll size(540) + moviecilp size(160) , 700
and when it is displayed on low resolutions it has white space of
around 130 pixels and html content which is just below where my SWF
ends looks far below where it is required .
and if i do viceversa ie i make stage 410+160 than it
truncates my SWF on high reolution .
Is there any workaround for settings stage height and width
dynamically or something to do with PUBLISH settings .
Kindly help , my project deadlines are very near .
Please help
Thanks in advance

Hi Everyone ,
I am quite new to Flash ,
I have made one flash swf in flash cs3 using action script 2
My requirment is like this -
if client's resolution is less than or equal to 1024*768 i
have to show scroll pane of size 410 and when resoution is higher
than this i have to show scroll pane of size 540 . _x and _y
of scroll pane is 0,0 all other things on flash is relative to this
scroll pane so they take their _x and _y accordingly .(By the way i
have only more movie clip on stage that is of height 160)
I have used System.capabilities.screenResolutionX and
System.capabilities.screenResolutionY to detect resolutions
and have made scroll pane and movie clip to render
accordingly .
Now my problem is that there is no way i can change the size
of stage dynamically as height and width of stage is read only
(correct me if m wrng ) , so if i take my stage size ,according to
hight resolution ie scroll size(540) + moviecilp size(160) , 700
and when it is displayed on low resolutions it has white space of
around 130 pixels and html content which is just below where my SWF
ends looks far below where it is required .
and if i do viceversa ie i make stage 410+160 than it
truncates my SWF on high reolution .
Is there any workaround for settings stage height and width
dynamically or something to do with PUBLISH settings .
Kindly help , my project deadlines are very near .
Please help
Thanks in advance

Similar Messages

  • CS5 Device Central Stage.width/Stage.height update problem when change the device profile.

    When creating FL 3.0/3.1 app   and testing it at the CS5 Device Central if you change the profile of the active device(select different phone with different screen size) Stage.width/Stage.height could't change. Always stays the same as the first device's Stage.width and height. Even if you add addListener with Delegate nothing happends. Also it effects to Screen Oriantation. It looks like a problem or is this a bug?

    Having the same problem, though I can't get it to connect even once. I just started researching the problem tonight - no solution yet...
    I'm on Windows 7 Pro 64-bit, Production Premium CS 5.5.
    I've got no other internet issues, Adobe update works fine.
    Please - Anybody have an idea how to troubleshoot this problem?
    Thank you.

  • Stage Height/Width Issue

    I am writing a piece of code that basically says if a certain MC reaches a ypos of -50 to perform a set of actions:
    EXAMPLE CODE
    if(balloon.clip.y <= topBounds)
                    //actions here
    But for some reason it wasn't recognizing when the MC would reach the specified ypos. I did a simple trace statement of the stage height and width because I suspected something was off with the script reading x and y positions. And sure enough the output of the trace did not correctly match what my actual stage size was set to in my fla.
    trace(stage.stageHeight); This traced 798
    trace(stage.stageWidth); This traced 1440
    While my actual stage is set to 550x400.
    Am I missing something here? I also traced the ypos of the moving MC and the trace output positions that were nowhere near the actual y positions of the MC as it moved. Ironically though, the external class file to this object recognizes the correct x and y positions when I call the function from the .as file. Only when I try to call the function from the fla file do I run into this issue of incorrect x and y positions.
    Any help? Thanks

    Below is my code for my as class file and the code being called from the stage within the fla file. The issue I am having is with the conditional statement in the fla code, I have highlighted it in bold and italics. The ypos of the MC is not registering at -50 when clearly the object has a y position of -50. Something seems messed up with the x and y positions of the clip on the stage because the y position traced to teh output panel is nowhere close to the actual y position of the clip on the stage as it moves.
    .as file code
    package
        import flash.display.Stage;
        import flash.display.*;
        import flash.display.DisplayObjectContainer;
         import flash.display.MovieClip;   
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        import flash.events.Event;
            public class Balloon
                    public var clip: MovieClip;
                    public var xVel: Number = 0;
                    public var yVel: Number = 0;
                    public var upwardForce:    Number = 0; // applies to y value
                    public var shrink: Number = 1;
                    public var fade: Number = 0;
                    public var topBounds: Number = -50
                    public function Balloon(symbol:Class, target:DisplayObjectContainer, xpos:Number, ypos:Number, size:Number)
                            clip=new symbol();
                            target.addChild(clip);
                            clip.x = xpos;
                            clip.y = ypos;
                            clip.scaleX=clip.scaleY=size;
                        } // end Balloon constructor function
                    public function moveObject():void
                            clip.x += xVel;
                            clip.y += yVel;
                            yVel -= upwardForce;
                            clip.scaleX *= shrink;
                            clip.scaleY *= shrink;
                            clip.alpha -= fade;
                      }//end moveObject function
                    public function removeObject():void
                            clip.parent.removeChild(clip);
                        }// remove balloon from the stage
                } // end Balloon class
    }// end package
    code inside fla
    var balloonArray:Array = new Array();
    stage.addEventListener(Event.ENTER_FRAME, startBalloons)
    function startBalloons(evt:Event):void
            var balloon: Balloon; // referencing our Balloon Class
            for(var i:int=0; i<balloonArray.length; i++)
                    balloonArray[i].moveObject(); // calls moveObject function thats in the class file
            balloon = new Balloon(hotAirBalloon, this, randomRange(200, 400), randomRange(400, 550), randomRange(0.3, 1));
            balloon.xVel = -3; 
            balloon.yVel = -4;
            balloon.shrink = 0.9999;
            balloon.fade = 0.000011;
            balloon.upwardForce = .005
            balloonArray.push(balloon);
            if(balloonArray.length>randomRange(1, 5))//creates only 3 balloons and removes all others created from th array
                   balloon.removeObject();
        if(balloon.clip.y <= -50)
           trace("balloon has reached the top"
            var balloonTimer:Timer = new Timer(randomRange(25,45)*1000, 1);
            balloonTimer.addEventListener(TimerEvent.TIMER,timerFinished);
            balloonTimer.start();
            function timerFinished(event:TimerEvent):void
                        trace("time's up")
                        balloonTimer.stop();
                        balloon.clip.x = Math.random() * (400-200) + 200; // give random x pos to start from
                        balloon.clip.y = Math.random() * (1000-400) + 400; // give random y pos to start from
                        balloon.clip.scaleX = balloon.clip.scaleY = Math.random() * (1-0.3) + 0.3;
                        balloon.clip.alpha=1;
            } // end startBalloons function
        function randomRange(offset:Number, maxValue:Number) // generic function for randomizing object properties
                return Math.random() * (maxValue-offset) + offset

  • Problem with automated height/width after applying effect

    Hey guys,
    I have a panel that automatically resizes after some other contents is being added. All the time there is a scale-effect. Whenever I move the mouse over any of those children they zoom in and there the height & width of the parent container automatically resizes.
    However I have a minimize button for that one along with a resize effect. I can resize the complete container to a minimize size (e.g. 40x40), but when I resize back with the same effect, the panel does not automatically resizes with added children anymore.
    I did not set any special properties on the panel from the beginning, but some property must be different now. It is not "autoLayout" and also the "percentageWidth/Height" does not work properly as that command will cause the panel to stretch over the complete stage. Any suggestions here?

    Mmmh...that does not seem to solve the issue for me. Even when setting the width and height to NaN before the effect is played, it will still lead to a fixed height and width of the parent panel container. When I add new children the parent container is not properly resized, means that the chiildren just go beyond the parent container's border.
    Setting these parameters after the effect is done leads to the following crash: ArgumentError: Error #2004: One of the parameters is invalid.
    at flash.display::Graphics/drawRect()
    at spark.accessibility::PanelAccImpl/eventHandler()[E:\dev\4.0.0\frameworks\projects\spark\s rc\spark\accessibility\PanelAccImpl.as:361]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:12266]
    at mx.core::UIComponent/dispatchResizeEvent()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9641]
    at mx.core::UIComponent/commitProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx \core\UIComponent.as:7866]
    at spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\4.0.0\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:414]
    at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
    at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    Here is my code...anything wrong here.
    private function recreateWindow(e:MouseEvent)//thrown once the user moves his mouse over the minimized panel
         myResizeEffect.heightFrom = 40;
         myResizeEffect.heightFrom = 40;
         myResizeEffect.heightFrom = lastHeight;
         myResizeEffect.heightFrom = lastWidth;
         myResizeEffect.play();
         myResizeEffect.addEventListener(EffectEvent.EFFECT_END,resetMinimizeValues);
    private function resetMinimizeValues(event:EffectEvent):void
         myResizeEffect.removeEventListener(EffectEvent.EFFECT_END,resetMinimizeValues);
         //adding the old listeners before the panel was minimized
         this.width = NaN;//crash
         this.height = NaN;//crash
    Any suggestions?
    ...and how can I remove the "Question answered"-tag...?

  • [svn:fx-trunk] 12007: When the Internet Explorer browser window is obscured Stage. width and Stage.height never return the proper sizes until/ unless the IE window is unobscured long enough for the player to feel it needs to render initially .

    Revision: 12007
    Revision: 12007
    Author:   [email protected]
    Date:     2009-11-19 12:45:27 -0800 (Thu, 19 Nov 2009)
    Log Message:
    When the Internet Explorer browser window is obscured Stage.width and Stage.height never return the proper sizes until/unless the IE window is unobscured long enough for the player to feel it needs to render initially.  This was preventing our preloader from completing, since we were waiting for a non-0 Stage size.  Took a slightly different approach to solving the bug for which the original logic was added to work around.
    QE notes: None
    Doc notes: None
    Bugs: SDK-24191
    Reviewer: Alex, Evtim
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/non-0
        http://bugs.adobe.com/jira/browse/SDK-24191
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as

    Revision: 12007
    Revision: 12007
    Author:   [email protected]
    Date:     2009-11-19 12:45:27 -0800 (Thu, 19 Nov 2009)
    Log Message:
    When the Internet Explorer browser window is obscured Stage.width and Stage.height never return the proper sizes until/unless the IE window is unobscured long enough for the player to feel it needs to render initially.  This was preventing our preloader from completing, since we were waiting for a non-0 Stage size.  Took a slightly different approach to solving the bug for which the original logic was added to work around.
    QE notes: None
    Doc notes: None
    Bugs: SDK-24191
    Reviewer: Alex, Evtim
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/non-0
        http://bugs.adobe.com/jira/browse/SDK-24191
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/Preloader.as

  • Help me Please..? How to change X & Y co-ordinate and height & width selected content...?

    Hi Everyone!
              This is Vijay.I'm new baby to Indesign Script.In my office i took one task for indesign, that's i link one image to picture box that image jump from original position.so i copy that picture box and paste in place to new layer and now link the Eps to that box. againg jump that image. actually (manualy) i copy height,width , center  X and Y coordinates from old picture box image and Paste in to newly link image. then link image was perfectly sit in position. any one do for Script or any one help me how to do this..Script.
    Thanks in Advance
    -yajiv
    Sample for ur clarification....

    hi Dave!
                   Thanks for Quick Reply. Actually i know very well in Java script. may be i finish that script with in 2 weeks. i try to work but i can't that why i post..!
    can you tell any idea to solve that problem.now the problem is i can't change height and width. thanks in Advance.
    -yajiv
    my script is..
        var i,j;
        var mysel=app.activeDocument.selection;   
        var myDoc = app.activeDocument;
        if (app.documents.length > 0){
            if (mysel.length > 0) {
                //app.copy();
                var myObj1 = app.selection[0];
                var myObj2 = app.selection[1];
                var vb = myObj1.visibleBounds;
                var vb1 = myObj2.visibleBounds;
                var myWidth = vb[3]-vb[1];
                var myHeight = vb[2]-vb[0];
                var myWidth1 = vb1[3]-vb1[1];
                var myHeight1 = vb1[2]-vb1[0];
                var X=(vb[3]+vb[1])/2;
                var Y=(vb[2]+vb[0])/2;
                //myObj1.deselect();
                myObj.visibleBounds=myObj1.visibleBounds;
                alert(myObj.visibleBounds);
                alert("MyObjWidth = "+myWidth+"\n"+"MyObjHeight = "+ myHeight);
                 alert("MyObjWidth1 = "+myWidth1+"\n"+"MyObjHeight1="+ myHeight1);
                 alert(myObj.visibleBounds);        
            else {
                alert("Nothing is selected. Please select an object and try again.");
        else {
            alert("No InDesign documents are open. Please open a document and try again.");

  • Finding project height/width Flash Builder

    Hey,
    How do you find the project height/width as a integer to use in code. I've found stage.stageWidth but that doesnt display anything when i try and use it
    Thanks
    Chris

    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"  creationComplete="view1_creationCompleteHandler(event)">
    <fx:Script>
    <![CDATA[
    import mx.events.FlexEvent;
    import flash.display.*
    protected function view1_creationCompleteHandler(event:FlexEvent):void
    trace("Stage Width" + stage.stageWidth);
    trace("Stage Height" + stage.stageHeight);
    ]]>
    </fx:Script>
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    </s:View>

  • Overriding UIComponent's height, width setters..

    I'm writing a custom UIComponent, and would like to perform some custom actions when the height/width are set in mxml.
    e.g. the mxml will have something like
    <custom:MyComp id="mcid" width="30" height="40".......></custom:MyComp>
    and I'd like to write something such as this in  MyComp.as
    public override function set width (x:Number):void {
           super.width = x;
           // ... followed by my custom actions
    This is probably not the correct direction. The code written in this way results in a problem whereby the setter get called twice (the second time, it is called automatically via the property watcher as well --- with values that are not right). What's the correct way of implementing this? Thanks in advance.

    Thanks. I tried that earlier, but it didn't seem to work for me. There seems to be an easier way I just found, but don't know if that's right.
    In your MyComp constructor you can add a listener:
    public function MyComp () {
       super ();
       addEventListener (ResizeEvent.RESIZE, rsHandler);
    private function rsHandler (rs:ResizeEvent):void {
       // custom code
    Of course, I guess this won't work if I want to do different actions for width, and a different action for height setter.

  • Is there any way to get the height/width of an image before importing it in the indesign document.

    Hi All,
    I need to obtain an image's attributes such as dimensions (height, width in pixels) without placing image in indesign document.
    I have full path of the image (say abc.jpg is stored at c:\my pic\abc.jpg).
    I have obtained the IDFile for this image, tried getting size using GetFileSize() which correctly return size in bytes.
    Is there any way to get the height/width of image without importing it in the indesign document.
    Please, give me some hints. I have spent quite a lot time digging in CHM. I have searched in FileUtils, IDFile API's but found no method which serves this purpose.
    At this point I am clueless where to search next.
    Any help will be appriciated.
    Just a point to mention, I am able to get image height and width for an image in indesign doc though Its not my requirement.
    Thnx,
    D.

    You might be able to examine the contents of the PlaceGun after calling kImportAndLoadPlaceGunCmdBoss without actually placing the image in a document. Not sure, but would be worth looking at.
    Otherwise you will probably have to write platform specific code, ideally with a generic platform-independant wrapper (see SDKSamples/paneltreeview/PlatformFileSystemIterator).
    For the Mac, look at CGImageGetWidth() etc., not sure what the best option is for windows.
    Perhaps Quicktime could provide you with a platform independant solution.

  • 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.

  • Changing scaleX/scaleY on parent scales the children but doesn't update  height/width property ?

    have created a custom component - MyImage - that has two children including a Bitmap as well as a Sprite.
    My display object hierarchy is as follows -
    mx:Canvas
      view:MyImage
         mx:Bitmap
         my:Sprite
    If I change the MyImage.scaleX, scaleY property, the children scale as I would expect them to.
    However when I try to place the children in the center using placeAgain() on getting a resize event:
        public function placeAgain():void
            if (image==null) return;
            var pCanvas:Canvas = this.parent as Canvas;
            if (image.width <= pCanvas.width)
                pCanvas.horizontalScrollPolicy="off";
                image.x = (pCanvas.width -image.width)/2;
            else
                pCanvas.horizontalScrollPolicy="on";
                image.x=0;
            if (image.height <= pCanvas.height)
                pCanvas.verticalScrollPolicy="off";
                image.y = (pCanvas.height -image.height)/2;
            else
                pCanvas.verticalScrollPolicy="on";
                image.y=0;
            alignKids();
    I find the image.height & width have not changed despite the image getting scaled!
    Isn't the child supposed to have its bounds changed after scaling its
    parent ? Especially after the child has actually been scaled correctly ?
    Why are bounds of the child stuck at the same value as before scaling? I
    am not caching the Bitmap, have not turned on caching of bitmaps.

    If I'm not mistaken, the bounds are updated with the scale. You rare not referencing the bounds, your referencing the width and height properties, which is a bit different. What happens if you use the getBounds function to get your dimensions?

  • How can I make the stage height shorter by "cropping out" the bottom portion of the stage?

    Right now my stage dimensions are 980 X 800 px.  I need to cut or "crop out" the bottom portion of the footer because its height is too long.  So I changed the stage dimensions to 980 X 600 px (and changed the corresponding dimensions in the embed tag in the index.html file to match).  Doing this seems to cut out the bottom but at the same time adds space to the top and seems to distort the overall spacing.  Is there a simple way to crop out the bottom of the stage (just like cropping out a section of a photo)?

    Forgetting about the html file and embed tag for now, I can't seem to get the .swf proportioned properly in the first place.  I just want the bottom portion of the stage cropped out.  How do I do that without distorting the spacing?  When I tried to reduce the stage height, it doesn't simply crop out the bottom - it reduces the stage's height but it also seems to add space to the top and "squeezes" lines together, distorting the vertical spacing.
    Is there a way to simply crop out the bottom, just like cropping an image?

  • How to display the height, width and resolution of an EPS file

    Hi friends,
    I have to do a small module.. in that I have to display height, width and resolution of a given EPS file..
    please help..
    Thank you very much..
    Regards,
    krishna.

    Hi friends,
    I have to do display the resolution of an eps file..
    I have to use only Java.
    Can any body know the eps file format...
    I searched through net but I didn't find any best tutorial for that format..
    I am able to find the height and width from the eps file..
    By just opening that eps file.. I found %%Bounding box height width....as in some post posted by our jive member...
    In this way, is there any way to find the resolution..
    if any body knows this details.. please post.. Even if you have the file format tutorial post that one..
    Thank you.
    Regards,
    Krishna.

  • Scanning: The image size is too big. Please reduce the image height, width, resolution, scaling or output type.

    Good Day.
    I have recently discovered an issue with scanning.  I have tried scanning straight from the printer, through image capture, and through preview.  All yeilding the same results since they are essentailly kicking off the same scanning applet.  I can scan a jpeg formatted file as long as I applet is in the "Hide Details" mode.  If I click on the "Show Details" button, which I need to do to scan to PDF, I immediately receive an error stating: The image size is too big. Please reduce the image height, width, resolution, scaling or output type.
    I'm currently using an HP C5180 printer.   The most recently installed software was Adobe Digital Editions (I installed this to read an on-line e-book).  Not sure if there is any correlation.    Thanks for any help.
    Mac details are:
      Model Name:          MacBook Pro
      Model Identifier:          MacBookPro8,1
      Processor Name:          Intel Core i5
      Processor Speed:          2.3 GHz
      Number of Processors:          1
      Total Number of Cores:          2
      L2 Cache (per Core):          256 KB
      L3 Cache:          3 MB
      Memory:          8 GB
      Boot ROM Version:          MBP81.0047.B27
    Printer access log:
      Source:          /var/log/cups/access_log
      Size:          174 bytes
      Last Modified:          11/21/12 10:09 PM
      Recent Contents:          localhost - - [21/Nov/2012:22:09:16 -0500] "POST / HTTP/1.1" 200 61628 CUPS-Get-PPDs -
    localhost - - [21/Nov/2012:22:09:20 -0500] "POST / HTTP/1.1" 200 61628 CUPS-Get-PPDs -
    Image Capture Support:
      Image Capture Support:
      Path:          /Library/Image Capture/Support/Hewlett-Packard/Devices/HPAiOScan.bundle/Contents/Info.plist
      Version:          2.3.0
      Path:          /Library/Image Capture/Support/Hewlett-Packard/Devices/HPAiOScan.bundle/Contents/Resources/Dev iceInfo.plist
      Version:          2.3.0
    Photosmart C5100 series:
      Status:          Idle
      Print Server:          Local
      Driver Version:          4.0.0
      Default:          Yes
      Shared:          No
      URI:          dnssd://Photosmart%20C5100%20series%20%5B960B9E%5D._pdl-datastream._tcp.lo cal./?bidi
      PPD:          HP Photosmart C5100 series
      PPD File Version:          4.0.0
      PostScript Version:          (3011.104) 0
      CUPS Version:          1.6svn (cups-327)
      Scanning support:          Yes
      Scanning app (bundleID path):          -
      Scanning app version:          -
      Scanner UUID:          CC8DD435-CC8D-D435-CC8D-D435CC8DD435
      Printer Commands:          ReportLevels
      CUPS filters:
    Inkjet:
      Path:          /Library/Printers/hp/cups/Inkjet.driver/Contents/MacOS/Inkjet
      Permissions:          rwxr-xr-x
      Version:          4.0.0
    commandtohp:
      Path:          /Library/Printers/hp/cups/filters/commandtohp.filter/Contents/MacOS/comman dtohp
      Permissions:          rwxr-xr-x
      Version:          2.1.1
      Fax support:          No
      Printer utility:          /Library/Printers/hp/Utilities/HP Utility.app
      Printer utility version:          5.9.1
      PDEs:
    PDE.plugin:
      Sandbox compliant:          Yes

    Hello Sig
    The scanner works with a Windows computer, which proves the device is functional at a cursory level. The drivers are now distributed by Apple and this is an Apple computer. There is no scanning software provided by HP. HP's answer is that Mountain Lion takes care of all of this.  I anticipate that some setting or driver was somehow tweaked since the scanner had been working with Mountain Lion until a few days ago.  The device in question is an Apple product. So, I'm pretty confident that I'm in the right place.
    Regards

  • 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.

Maybe you are looking for