Swfloader and accessing width/height

Hi,
I have an AS3 swf that I'm trying to embed within a Flex 3 application.  The problem is that I need to know the size of the available width/height from inside the swf.  When the swf is embedded in a webpage, I can easily access this by stage.stageWidth, but in the case of an embedded swf, this doesn't work because the stage is of the entire application and not just my swf.  Is there anyway in my embedded swf to figure out these values?
Thanks!
Christie

If the embedded SWF was loaded via SWFLoader, then  this.parent.parent.parent.width (and height)  from within the embedded SWF will give you what you want.

Similar Messages

  • How to increase and descrease width/height of an item?

    Hi,
    My question is, there are so many item are displayed in the form and user wants to increase/decrease the size(width/height) of any item, just like we changes the size of any window.
    how we can do the same in form at run time. if anyone is having solution pl fwd to me at [email protected] or [email protected]
    thanks in advance.
    Regards,
    Anil

    Hi Anil
    Use the SET_ITEM_PROPERTY(item_name, WIDTH, y) for changing the width of the item and similarly for changinging the HEIGHT.
    Put this command in a loop and assign the loop variable to the "y" variable in the SET_ITEM_PROPERTY. Doing this will change your item width and height at the run time.
    try this and for any other queries in Forms , reports, ORACLE database pl. feel free to get in touch with me.
    Ciao take care
    Manish

  • Character mode report and Report Width & Height

    Hi
    I need to print a report on a pre-printed pay slip which is 4" height x 9" width.
    May i know what value should i set for these parameter?
    Report Level: Unit of measurement: Inch
    Report Level: Design in Character Units: Yes
    Layout Model, Main Section: Width: 9, Height: 4
    Layout Model, Character Mode: Report Width: 132, Report Height: 24
    Apps SRW driver: width: 132, height: 24
    If i need to print the character with 15cpi, is the value of 24 for the height (above) correct?
    What should be the value to set for Ruler Settings, character cell size: horizontal & vertical?
    Thanks
    Ung

    Could it be because A4 is actually 11.5" by 8.5" ?
    Message was edited by:
    Dave Hemming
    In fact the ISO standard is 8.3" × 11.7". 8.5" x 11" is "Letter", which nobody uses any more.

  • Width*height vals changing in save for web ??

    Hi all
    I've opened an EPS file in illustrator cs4. And its width & height values are differing with width & height values in "save for web" option.
    For example, normally in width & height boxes shows as
    width : 247.499 pt
    height : 116.524 pt
    but in save for web
    width : 249
    height : 117
    I've checked with various figures too.

    Script lan : javascript
    thanks for ur help!
    Actually I've to resize the figure for the width 175, 525, 1400 and the height should change proportionally. So I tried, but I couldn't resize the figures using save for web. Becoz its horizontalScale & verticalScale treats values as percentage. eg. 175 treats as 175%. Then I grouped all items and changed its "width" and foud out the values' corresponding "height" values. But the problem is, exported file's values are changing nearly 3pts.
    could u help on this?

  • Width/height/x/y value mismatch with the reality and what is coded

    hello there everyone,
    hope i got the title right..,
    so here goes the problem i need your opinion and help to solve:
    application definition:
    i have this desktop flash application that will go fullscreen what this application do is loading external asset (mostlySWF) and play it inside this application. Each external asset will be place inside a container/holder (empty movie clip created by code), each of this container have it's own dimension ( width, height, x, y).my code all working without any warning nor error.oh and i also have an image.jpg/png as it's background and place at the bottom of display list (depth = 0), the image is customly made with using photoshop and each container location and dimension also measured there so it just needed to be writen down is the XML file..,
    the problem:
    the bug is when i loaded some image of those background image each container width,height,x,y  will mismatch with what i have in the XML file.
    the funny thing is when i trace the value of each container width,height,x,y it value is the same with what the XML has yet by seeing with eye you know that is wrong..,
    here's the code i used:
    var myXML:XML; //to hold the loaded xml file
    var SWFList:XMLList; //used to hold a list of all external swf source,atribute and etc
    var xmlLoader:URLLoader = new URLLoader(); //intance of URLloader class used to XML file
    var totalSWF:int; //hold the total number of external swf there is to be loaded
    var mainContainer:MovieClip =new MovieClip();//act as the main container
    var SWFContainer:MovieClip; //hold the loaded SWF as it's child
    var swfLoader:Loader; //instance of loader class used to load the external swf
    var myCounter:int = 0; //used to track how many external swf has been loaded and added to stage
    var bgImageURL:String;//hold the url of the background image
    var imageLoader:Loader;//intance of loader class used to load background image
    // Stage Setting
    //========================================================================================
    this.stage.align = StageAlign.TOP_LEFT;
    this.stage.scaleMode = StageScaleMode.NO_SCALE ;
    this.stage.displayState = StageDisplayState.FULL_SCREEN;
    //load the xml file
    //======================================================================================== ==
    xmlLoader.load(new URLRequest("FlashBlock[s].xml"));
    xmlLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void
        e.target.removeEventListener(Event.COMPLETE , processXML);
        myXML = new XML(e.target.data);
        bgImageURL = myXML.Background.text();
        SWFList = myXML.BLOCK;
        totalSWF = myXML.BLOCK.length();   
        doSizeUpMainContainer();
        loadBackgroundImage();
    function doSizeUpMainContainer():void
        //resizing the mainContainer dimension
        //in this case i just make the size the same as the screen dimension
        addChild(mainContainer);
        mainContainer.graphics.beginFill(0xFD562D, 0);
        mainContainer.graphics.drawRect(0,0, stage.stageWidth, stage.stageHeight);
        mainContainer.graphics.endFill();
    function loadBackgroundImage():void
        //load the background image
        imageLoader = new Loader();
        imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onBgImageLoadComplete);
        imageLoader.load(new URLRequest(bgImageURL));
    function onBgImageLoadComplete(e:Event):void
        e.target.removeEventListener(Event.COMPLETE, onBgImageLoadComplete);
        mainContainer.addChild(imageLoader.content);
        imageLoader.x = (stage.stageWidth - imageLoader.content.width)/2;
        imageLoader.y = (stage.stageHeight - imageLoader.content.height)/2;
        loadSWF();
    function loadSWF():void
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE , swfSetting);
        swfLoader.load(new URLRequest(SWFList[myCounter].@source));
    function swfSetting(e:Event):void
        e.target.removeEventListener(Event.COMPLETE , swfSetting);
       SWFContainer = new MovieClip();
        mainContainer.addChild(SWFContainer);
        // i did this so i can resize the movieclip size to what i need..,
        SWFContainer.graphics.beginFill(0xff6633, 0);
        SWFContainer.graphics.drawRect(0,0, Number(SWFList[myCounter].@width), Number(SWFList[myCounter].@height));
        SWFContainer.graphics.endFill();
        SWFContainer.x = SWFList[myCounter].@left;
        SWFContainer.y = SWFList[myCounter].@top;
        SWFContainer.addChild(e.target.content);
        //load and add another SWFContainer untill all swf listed in the swf added
        if(myCounter < (totalSWF-1))
            myCounter++;
            swfLoader = null;
            loadSWF();
    i really do not have any idea why this could happen and how to solve it..,
    any help would be greatly apprecited cause i'm literally meeting a dead end with this bug..,

    hello there kglad,
    thanks for responding in this thread..,
    i did what you told me :
    i did check all of my loader instance till myLoader.parent.parent.parent and it return 1 for every single one of them
    but by removiing the "this.stage.displayState = StageDisplayState.FULL_SCREEN;"
    i do get new error which is:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at slideshow_fla::MainTimeline/doAspectRatio()
    well from what it tokd me it came from my slideshow swf..,(this swf also fully code and has nothing placed on stage by manually)
    the thing is in my mine swf code i never refer to what external asset property, i just told to load it and when the load is complete i put it in the display list..,
    from googling i suspect that it played to early beacause i put the script in the first frame of the timeline of slideshow.swf
    and for the moment i'm trying to find what error do cause it..,
    (but why this didn't happen all the time??)
    here is the slideshow code:
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.display.*
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    //list of global variables
    var mySlideSpeed:Number; //determine how long each image displayed
    var myTransitionName:String; //the name of the transition to be used
    var myxmlList : XMLList;//reference to the list of the image
    var myTotal:int;     //total of image to be displayed
    var myImage:Loader;//load the image into the container
    var tempWidth:int;
    var tempHeight:int;
    var myTraansitionInDuration:int = 2;//the duration of transition in effect
    var myTraansitionOutDuration:int = 2;//the duration of transition out effect
    var myThumbHolderArray : Array = [];//to hold each thumbimage of the image
    var Counter : Number = 0; //to count how many image has been successfully loaded
    var myMC : MovieClip = new MovieClip(); //as the container of the picture so that it can be manipulated with transition manager
    var container: MovieClip = new MovieClip();//hold the image after transition
    var myImageTracker :Number = 0; //to know which image is in the stage
    var myTimer :Timer; //the timer
    var myTM:TransitionManager = new TransitionManager(myMC);//instance of transitionmanager class;used to give transition effect the image
    //creating the loader instance n loading the file
        var myXML:XML;
        var XMLLoader :URLLoader = new URLLoader();
        XMLLoader.addEventListener(Event.COMPLETE, processXML);
        var base:String = this.root.loaderInfo.url;
        base = base.substr(0, base.lastIndexOf("/") + 1);
        XMLLoader.load(new URLRequest(base + "slideshow.xml"));
    function processXML(e:Event):void
        e.target.removeEventListener(Event.COMPLETE, processXML);
        XML.ignoreWhitespace = true;
        myXML =new XML(e.target.data) ;
        mySlideSpeed = Number(myXML.transition.@slidespeed) + myTraansitionInDuration + myTraansitionOutDuration ;
        myTimer = new Timer (mySlideSpeed*1000);
        myTimer.addEventListener(TimerEvent.TIMER, imageRemover);
        myTransitionName = myXML.transition.@name;
        myxmlList = myXML.IMAGE;
        myTotal = myXML.IMAGE.length();
        imageLoader();
    function imageLoader():void
        for (var i:Number = 0; i < myTotal; i++)
            var imageURL:String = base + myxmlList[i];
            var myLoader:Loader = new Loader();
            myLoader.load(new URLRequest(imageURL));
            myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete)
            //transfering each thumb image loaded to a variable to be able to be refered back when the show is running
            myThumbHolderArray.push(myLoader);
    function onComplete(e:Event):void
        Counter ++;
        if(Counter == myTotal)
            e.target.removeEventListener(Event.COMPLETE, onComplete);
            showStarter();
    function showStarter():void
            addChild(container);
            addChild(myMC);
    //        myMC.x = container.x = myMC.y = container.x = 0;
            doAspectRatio();
            imageSlider();
    function doAspectRatio():void
        for (var i:Number = 0; i < myTotal; i++)
            myImage = Loader (myThumbHolderArray[i]);
            if (myImage.width > myImage.height)
                tempWidth = myImage.width;
                tempHeight = myImage.height;
                //supposedly to access the container dimension holding this swf as it's child
                myImage.width = this.parent.width;
                myImage.height = (tempHeight * this.parent.height)/tempWidth ;
            else if (myImage.width < myImage.height)
                tempWidth = myImage.width;
                tempHeight = myImage.height;
                myImage.height = this.parent.height;
                myImage.width = (tempWidth * this.parent.width)/tempHeight ;
    function imageSlider():void
        if (getChildIndex(container)== 1)
            swapChildren(myMC, container);
        myImage = Loader (myThumbHolderArray[myImageTracker]);
        myMC.addChild(myImage);
        //center the image
        myImage.x = (this.parent.width - myImage.width)/2;
        myImage.y = (this.parent.height - myImage.height)/2;
        if (myTransitionName == 'Fly')
            myTM.startTransition({type:Fly, direction:Transition.IN, duration:myTraansitionInDuration, easing:None.easeIn, startPoint:7});
        else
        if (myTransitionName == 'Zoom')
            myTM.startTransition({type:Zoom, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn});
        else
        if (myTransitionName == 'Photo')
            myTM.startTransition({type:Photo, direction:Transition.IN, duration:myTraansitionInDuration, easing:None.easeIn});
        else
        if (myTransitionName == 'Squeeze')
            myTM.startTransition({type:Squeeze, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn, dimension:0});
        else
            myTM.startTransition({type:Fade, direction:Transition.IN, duration:myTraansitionInDuration, easing:Strong.easeIn});
        myTM.addEventListener("allTransitionsInDone", holdDelay);
    function holdDelay(e:Event):void
        this.removeEventListener("allTransitionsInDone", holdDelay);
        myTimer.start();
        container.addChild(myImage);
        if (getChildIndex(myMC)== 1)
            swapChildren(container, myMC);
    function imageRemover(e:Event):void
        myImageTracker ++;
        if (myImageTracker == myTotal)
            myImageTracker =0;
        imageSlider();
    and by the way can you tell me the reason you told me to remove "this.stage.displayState = StageDisplayState.FULL_SCREEN;" line ??

  • Problem with width/height of swfloader

    I am loading in a swf file via swfloader and I want the dimensions to be 600x300:
    <mx:SWFLoader id="loader1" width="600" height="300"/>
    In the loaded swf file, everything is layed out based on the dimensions.  I check the dimensions in the actions of the the first frame of the timeline.  When the swf file is embedded in html, this.stage.width is equal to 600.  However, when I load it via the SWFLoader above, this.stage.width is the size of my browser window.
    Why is this?  Is there a way to force it to stick to the dimensions set by SWFLoader?
    Thanks,Christie

    I figured out the problem.  Turns out there is only one stage and that is the stage of the flex application.  I went around this by adding a function to the embedded swf that allows me to resize it.  I'm not sure how I would have gotten around it if I did not have control over that file, but that is a  moot point for now.

  • SWFLoader width height Issue

    When I use the SWFLoader to load an swf from a URL it is not
    using the
    sizes specified in the SWFLoader component that is loading
    it, the swf
    seems to initially load at whatever size the actual swf is,
    but after
    the swf has been downloaded fully then the SWFLoader jumps to
    the
    width/height I specified, so basically all swfs I load start
    out huge
    then after sever seconds shrink to the size I want them to
    be. has
    anyone else seen this or know how to remedy this issue?
    (also the element in the swf that animate say from outside
    the
    original swf stage width/height show out way outside the
    bounds of the
    size specified)
    //set the source(within a function)
    swfplayer.source="
    http://www.somedomain.com/myswf.swf";
    <mx:Canvas id="swfplaycontainer" width="452" height="252"
    horizontalCenter="0" verticalCenter="0">
    <mx:SWFLoader id="swfplayer" width="100%"
    height="100%"/>
    </mx:Canvas>
    Also tried with no Canvas...
    <mx:SWFLoader id="swfplayer" width="452" height="252"
    width="100%"
    height="100%"/>
    Thanks, Tim
    specified size does not take effect until fully loaded swf

    hmm, well I tried explicitly setting the widht/height of the
    SWFLoader to no avail, I just tried the scaleContent, it also did
    not work ;-( I cannot hide the SWFLoader until complete event
    because these are long swf animations(they are tutorial videos in
    swf format) some seem to take 30-60 seconds to fully load(depending
    on network traffic). They do start playing quite well immediately
    but the size is messed up until complete, but I would think and
    explicit size on the SWFLoader should be the definitive answer.
    Adobe?

  • Report Row Height and Column Width

    Hi,
    I have a cell in a report (a description column) that causes the row height to become very large (when there is a lot of text in the description). I can make the column wider on the report attributes page, but there doesn't seem to be any place to influence the maximum height of a row on a report, short of modifying the template.
    Adding style attributes (e.g. max-height:30px) to an element only affects the <span> that the element resides in, not the table cell or row.
    Displaying the column as a text area is a useful workaround. The downside is the border and scroll bars do waste a lot of screen real estate. Does there exist some other way of setting a limit on the height and/or width of a report, report column or report row?
    Oh, and another question- how do make line breaks in this forum? There's no support for <BR> or [br].

    Please reply to this thread, my customer is facing the same issue. He does not have issue with the excel and the pdf output but in the rtf output the table heght increases to accomadate the data.He want it to bevave in the same way as the pdf do.
    Regards,
    Ajay

  • Control the page height and page width of pdf report using pasta_pdf.cfg

    Hi All,
    I've followed the note: 338990.1 (how to print publisher PDF reports via the concurrent manager) in metalink to print a PDF REPORT. Everything work fine except the page height and page width is used as default (8X11). Is there anyway that i can custom page height and page width size such as: legal (8.5X14).
    current set up in pasta_pdf.cfg
    [DEFAULT]
    %% ============== Preprocessing Command ==================== %%
    % Pasta can use a preprocessing command to invoke any executable
    % that supports an input file and an output file (a filter program).
    % You can use redirection. Pasta will invoke the filter program
    % to preprocess the Pasta output before passing it to the printing
    % command. By using the preprocess option, you can generate output
    % formats other than the formats Pasta currently supports. For
    % example, you can generate PCL output.
    % You can use {infile} and {outfile} in this option.
    % {infile} is the output file generated by Pasta. You can use
    % it as input for the preprocessing command. It is a temporary
    % file and will be deleted after being passed to the
    % preprocessing command. {outfile} is the output file generated
    % by the preprocessing command. Pasta names it temporarily and
    % it will be deleted after being passed to the printing command.
    % If you want to keep it, you can name it by using the '-o'
    % command line option. Pasta will copy {outfile} to the file you
    % specify.
    % Preprocess for PDF output
    % This is an example for PDF output to print.
    ; Xpdf
    preprocess=/usr/local/bin/pdftops {infile} {outfile}
    ; Ghost Script
    ; preprocess=pdf2ps {infile} {outfile}
    ; Acrobat
    ; preprocess=acroread -toPostScript -pairs {infile} {outfile}
    %% ============== Printing Command ========================= %%
    % You can specify the printing command and options you want
    % to use to print your report. Pasta will pass the final output
    % to this command. {printername} will be replaced by the
    % actual printer name passed through the command line option
    % (-pn), so in most cases you don't have to change these
    % options.
    % for UNIX platform
    printCommand=lp -c -d{printername}
    % for Windows platform
    ntPrintCommand=print /D:{printername}
    %% ============== Error Log File =========================== %%
    % This tells Pasta to create a log file. The default error
    % output is stderr.
    ;errorlogfile=pasta.log
    NOTE: pasta version 3.0.4
    form server 6.0.8.27.0
    third party tool is pdftops
    Thanks
    Kevin

    i think that can be down from the printing direver/styles/prt files when you added the printer at your apps system check the follwoign for more info.
    ( How to Implement Printing for Oracle Applications: Getting Started )
    Note:269129.1
    (Step By Step Guide to Set Up a Printer in Oracle Applications)
    ( Note:60936.1)
    fadi
    http://oracle-magic.blogspot.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.

  • How to export layer width, height, and position to a text document?

    I am working on an automated workflow for which I need to know the exact width, height, and position in pixels of certain layers in a PSD.
    I am pretty sure this is possible with applescript but does anyone know of a way to have this info included automatically in the documents metadata?
    thanks,
    ryan

    Hi Gabriele - how did you add the subs to FCP? if you added them using the text tools built in then you need to try to extract those first. Neither FCP or DVDSP are good places to create subtitles, but apps like STL Edit and Belle Nuit are. These will both create subs that can be imported into DVDSP. You can also use a text file to import the subs as long as the text file is set up correctly. The precise format is listed in the manual for DVDSP and a tool like BBEdit is ideal if you want to do the subs this way. Some folk even use Excel to set up the timecodes, etc, but personally I find that too distracting, preferring to work with STL Edit when I need to add subs.
    One thing is almost universally agreed upon in here - create the subs outside of DVDSP and import them in, since if you need to move, alter or otherwise change them it is a lot easier from within a text file than from within DVDSP.

  • [svn:osmf:] 14871: Fixing anchoring 'right' and 'bottom' properties not being applied on items that don't have a width/ height and position set.

    Revision: 14871
    Revision: 14871
    Author:   [email protected]
    Date:     2010-03-19 01:05:54 -0700 (Fri, 19 Mar 2010)
    Log Message:
    Fixing anchoring 'right' and 'bottom' properties not being applied on items that don't have a width/height and position set.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/layout/LayoutRenderer.as

    If you're just doing it in a back and forth or spiral fashion, you don't need to check whether a square's been filled in. You just go from a start point to an end point. Those points and the squares in between are determined by simple arithmetic.
    If you're doing it randomly, I wouldn't use the GUI elements themselves. I'd have, for example, and array of booleans that tells whether each square has been filled in.

  • How many ways are there to get the Width/Height of an image ?

    I am currently using the following code to get the width and hight of an image :
    BufferedImage Buffered_Image=ImageIO.read(new File(Image_Path));
    int Image_Width=Buffered_Image.getWidth();
    int Image_Height=Buffered_Image.getHeight();I don't need to get the image (*.jpg, *.gif, *.png), just want to know it's dimensions. I wonder how many other ways are available to do the same thing in a Java application ?
    Frank

    Ni_Min wrote:
    That's what I thought. I am asking because I hit a wall and am trying to find a different approach.Yeah, if you only have one file type you can probably write the code to read the header in 20 min.
    I packed my programs into an executable Jar file which I can run and access images on my C:\ drive, everything worked fine until I tried to experiment with something new. I know that I can force JVM to pre-load all my java classes just after it starts, so I deleted the jar right after the program pre-loaded all my classes and tried to see if it would work, but now I get a null pointer error when it tried to get the width/height of an existing image, because ImageIO.read return null. ( The same image is still on my C:\ drive )Sounds like a strange thing you're doing here. What's the point of this?
    So I wonder why it makes a difference after I deleted the jar, what was the problem ( or do I need to pre-load another class related to ImageIO.read ? ), and maybe if I use something else other than the ImageIO.read to get the width/height, I can bypass the problem.I dunno why you need to do this preload stuff and/or delete anything. I'd say leave the JVM and the app alone if possible.

  • How to load and access bitmaps?

    Hey there!
         After a few days of frustration and searching the web, I've finally come to understand how to make a sprite sheet and animate it.  I understand classes and how to import external actionscript files which contain them into my Flash project.  The problem is, I can't figure out how to properly name and load a bitmap file from the folder and pass it onto my functions as arguements.  >_<
    How do I load and access an external bitmap in Actionscript 3.0?
    I'm using a class I found online here:  http://www.bensilvis.com/?p=229
    The problem comes around when I try to access pieces of my bitmap, as he attempts to do here:  http://www.bensilvis.com/?p=317
    var currentSprite:SpriteSheet = new SpriteSheet(sheet, 20, 20);
    This is the only line that is confusing me, becuase he uses a variable "sheet", which is a bitmap, and I'm not sure how to define/name my external bitmap image as such.
    SpriteSheet(tileSheetBitmap:Bitmap, width:Number = 16, height:Number = 16)
    tileSheetBitmap: the Bitmap of the sprite sheet we will use
    width: the width of  tiles in the sheet
    height: the height of tiles in the sheet
    Thank you!  <3

    Actually, nevermind.  I got rid of the "new" and it worked fine.  My bitmap was converted and displalys fine.    Thank you very much!
    However, I keep getting one last error:
      "Call to a possibly undefined methond DrawTile through a reference with a static type SpriteSheet."
    ...I'm not sure what I'm doing wrong.  Here's the DrawTile part of the class:
    public function drawTile(tileNumber:int):BitmapData
                tileRectangle.x = int((tileNumber % rowLength)) * tileWidth;
                tileRectangle.y = int((tileNumber / rowLength)) * tileHeight;
                canvasBitmapData.copyPixels(tileSheetBitmapData, tileRectangle, tilePoint);
                return canvasBitmapData.clone();
    ...and here's my trouble code:
      var sprites:Bitmap = Bitmap(my_loader.content);
                         var MySheet:SpriteSheet = new SpriteSheet(sprites, 32, 32);
                        sprites.bitmapData = MySheet.DrawTile(0);
                        addChild(sprites);

  • Determine the type of connection & set webcam width/height

    Hi, two quick questions:
    1. Is there a way in ActionScript to determine what type of connection is being used (e.g. P2P or FMS)?
    2. Is there a way to set the width/height of the webcam picture? I currently extend the WebcamPublisher class to access the _camera instance and use the Camera.setMode() method, but it looks like that doesn't have any effect whatsoever.
    Thanks in advance,
    Michiel
    PS: I'm aware of the captureWidthHeightFactor method, but I really don't like that approach, as it's not really clear what dimensions are being used for the video. I would like to set the dimensions myself, like when using the Camera.setMode() method.

    Hironmay wrote:
    For you height/width part, you can use resolutionFactor API in webcamPublisher as captureWidthHeight API is deprecated. The default width and height gets multiplied.
    Ok, I'm using resolutionFactor now, but I'm not sure what the difference is. captureWidthHeightFactor is not really documented (it's there, but pretty unexplained), but the resolutionFactor uses multiples of the default width/height. I assume it does the exact same thing? (By the way: the resolutionFactor is not documenten on livedocs, only in the local documentation received as part of the zipped SDK.)
    And still if you want to set your own native width/height , since you are already subclassing WebcamPublisher, just subclass the function createMyStream and add your native width and height. See that function in the player 9 source code of WebcamPublisher provided.
    I'll look into that, for now resolutionFactor will have to do. (For testing purposes all video parameters have to be adjustable on the fly, and I unfortunately am already very short on time.)
    One thing I forgot to mention in last mail, you can only have P2P with player 10 and you need to use player 10 swc for any verification of P2P. Player 9 will be always FMS.
    You may have just saved my life! I was indeed using the player 9 swc, and tried the isP2P property, but didn't get it to work. And since it's not documented I labeled this as "deprecated" and dropped it. Great to see that it really is in there.
    Also, the difference between the player 9 and player 10 swc you just explained answers another question I had (but totally forgot about). When connecting, the console always showed:
    #FMSConnector# Wed Jan 6 10:52:11 GMT+0100 2010 is using RTMPS? true
    This gave me the idea that the P2P service was unavailable. I'm glad to see that this isn't the case.
    Thanks for your rapid replies everyone, I really appreciate it!
    Michiel

Maybe you are looking for