Stage.stageWidth and some browsers

Has anyone else encountered this? When I program banner ads, I use a variable to calculate the center of the banner, something like:
var MiddleX = stage.stageWidth/2; //If stage is 300 pixels wide MiddleX would be 150
I then use that variable to position text dead center, something like:
mcText.x = MiddleX;
What I have discovered is that some browsers don't care for this. So instead of centering the text they position it at 0. The quick fix was to just put in a number rather than have it calculate.
I don't think the code is flawed. Just wondering why some browsers hiccup on this code. It seems pretty basic.

there could be some issues with scaling unless you assign the scaleMode to noScale.

Similar Messages

  • Stage height and width in private const or variable

    Hello, everyone I've got problem with this code.
    I need stage size in const or variable because of some resize reasons.
    ok so, code below works but it's static and I need dynamicaly get stage size.
    private const LIST_HEIGHT          :uint = 800;
    private const LIST_WIDTH            :uint = 1200;
    with(_mask)
    graphics.beginFill(0);
    graphics.drawrect(0, 0, LIST_WIDTH, LIST_HEIGHT);
    graphics.endFill();
    and if I change constants to this:
    private const LIST_HEIGHT          :uint = stage.stageHeight;
    private const LIST_WIDTH           :uint = stage.stageWidth;
    it's not work
    also this not work
    private var _listH          :uint = stage.stageHeight;
    private var _listW         :uint = stage.stageWidth;
    and this:
    private var _listH          :String = stage.stageHeight;
    private var _listW         :String = stage.stageWidth;
    not work means that I get this error
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at com.filebrowser::FilesList()[/Users/Peter/Desktop/projectfl/projectfl beta 0.6/as3/com/filebrowser/FilesList.as:14]
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at com.filebrowser::FileBrowser()[/Users/Peter/Desktop/projectfl/projectfl beta 0.6/as3/com/filebrowser/FileBrowser.as:51]
    Thanks in advance for all replies, all help is very appreciated.

    ps. I should add this information.
    this is code for external swf.
    if it's alone it works but if I load it to main swf it's not working.
    and my only problem is this:
    this is working
    private const STAGE_HEIGHT:uint = 800;
    and this not
    private const STAGE_HEIGHT:uint = stage.stageHeight;

  • AS3 Preloader matching stage.stageWidth (simple)

    Hello,
    Experimenting with Flash as usual.
    Preloader's are always something that have caused me trouble.
    Here's what I typically use for a timeline based preloader in AS3:
    this.addEventListener(Event.ENTER_FRAME, loading);
    function loading(e:Event):void {
    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;
    loadBar.scaleX = loaded/total;
    loaderText.text = Math.floor((loaded/total)*100)+ "%"; (if percentage text is wanted)
    if (total == loaded) {
    gotoAndPlay(3);
    this.removeEventListener(Event.ENTER_FRAME, loading);
    This works perfectly well, but isn't that pleasing aesthetically.
    I'm really interested in a preloader that loads right across the stage however - regardless of if the stage is resized.
    I should imagine it'll involve implementing = Math.round(stage.stageWidth); at some point?
    If anybody knows how this is achieved, through actionscript, in the timeline, I'd really appreciate the support
    Thanks a lot!

    I haven't been able to make this work straight away with this code:
    var lbW:Number
    var stageW:Number
    var ratioNum:Number
    resizeF(null);
    stage.addEventListener(Event.RESIZE,resizeF);
    function resizeF(e:Event){
    lbW = loadBar.width
    stageW = stage.stageWidth
    ratioNum = stageW/lbW;
    this.addEventListener(Event.ENTER_FRAME, loading);
    function loading(e:Event):void {
    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;
    loadBar.scaleX = ratioNum*loaded/total;
    if (total == loaded) {
    gotoAndPlay(2);
    this.removeEventListener(Event.ENTER_FRAME, loading);
    But I shall explore and try and fix it.
    Thanks so much for your time and expertise!
    Really do appreciate it!

  • Viewing Flash Applications on a Mac: stage.stageWidth/stage.stageHeight Return 0 in Firefox/IE

    I am using SWFOBJECT to embed my flash content.
    I have been worried about stage.stageWidth and stage.stageHeight returning 0 in Firefox/Internet Explorer; this problem is referred to in question #21 on the SWFOBJECT FAQ (http://code.google.com/p/swfobject/wiki/faq).
    I have been told that this problem is particularly prevelant on Macs.
    The SWFOBJECT FAQ (question 21) indirectly suggests that this problem does not occur with static publishing.  Is this correct?  Is it still advisable to implement a solution to this stageWidth/stageHeight problem, even if you are using static publishing?
    Thank you.

    Bug 3637793
    https://bugbase.adobe.com/index.cfm?event=bug&id=3637793

  • On Firefox stage.stageWidth stage.stageHeight return wrong values

    Hello,
    I have a problem on firefox windows 8, stage.stageWidth and stage.stageHeight return wrong values,
    swfobject.embedSWF("mySwf.swf", "mySwf", "500", "500", "14.0.0","expressInstall.swf", flashvars, params, attributes);
    on ie, Chrome stage.stageWidth and stage.stageHeight return 500
    on iFirefox stage.stageWidth and stage.stageHeight return 750 and my animation is smaller (66%)
    Thanks

    In order to target iPhone 5 you need to use AIR 3.5 beta or AIR 3.4
    pointing to iOS 6 SDK. Be sure to include the [email protected] to
    trigger the iPhone 5 size. In other words, the app has to be built
    targeting the iOS 6 SDK and have the new default png to trigger the full
    size on the iPhone 5.
    AIR 3.5 beta includes the bits that to target iOS 6 SDK, but you can
    target iOS 6 with AIR 3.4 by using the external SDK path in the package
    ANE prompt in FB 4.6
    http://labs.adobe.com
    iBrent

  • When I open 2 or more browsers of Firefox, click to open and close email it pops up the First Firefox browser since I have verrsion 6 as of yesterday. And some times the tool bar dosen't appear or have to refresh it.

    Question
    When I open 2 or more browsers of Firefox, click to open and close email it pops up the First Firefox browser since I have verrsion 6 as of yesterday. And some times the tool bar dosen't appear or have to refresh it.

    Question
    When I open 2 or more browsers of Firefox, click to open and close email it pops up the First Firefox browser since I have verrsion 6 as of yesterday. And some times the tool bar dosen't appear or have to refresh it.

  • Links are not working with Firefox and some other browsers

    Hello,
    On my site (iWeb08) I have some pictures of pieces of text as a link to another page of website.. but with some browsers the links doesn't work.
    Also de links are very difficult to activate on the site.. What I mean is when you want to click the link.. you have to search with the cursor in stead of stand on the word and click to activate..
    (hope that you understand what I mean, but my English is a bit difficult in English for me...)
    Regards,
    Jose

    Jose,
    It might be good to give us the link to your site so we can see for ourselves what is happening.
    Phil

  • DW designed site, some browsers are dropping images and doing other wonky things, suggestions?

    Hello, we have a small website and on the contact page there are hyperlinked images for facebook and linkedin. On some browsers or computers the images and links are being dropped entirely, including my own when I run Firefox but shows up fine in IE. On one computer instead of left aligning it was center aligned. Here is the page in question:
    Vote Russ Tierney for State Representative
    (Aside from the CSS doing away with tables which is a subject I still need to read up on) is there anything bad about that particular segment of html:
    <tr>
       <td colspan="2">Find me on:<br /><a href="https://www.facebook.com/voterusstierney"><img src="images/Facebook.png"  alt="Facebook" width="47"/></a> <a href="https://www.linkedin.com/pub/russ-tierney/34/49/920"><img src="images/LinkedIN.png" alt="Linkedin"/></a></td>
       </tr>
    Suggestions?

    Aaron Hartley wrote:
    (Aside from the CSS doing away with tables which is a subject I still need to read up on) is there anything bad about that particular segment of html:
    Possibly.
    Servers are case sensitive, so a link to images/LinkedIN.png will not be directed to a file called linkedin.png on the server. Your local OS won't have an issue with it, but the server generally will view that as a separate file from the mixed case version.
    You may want to go through and normalize your file names from within DW's Files window and keep them all as lower case alpha-numeric names. Don't use special characters or spaces in the names either. Instead of spaces, use underscores or hyphens. When you change the names from within the Files window, DW will update all of your links for you.
    Since you're seeing issues in some but not all browsers, I'm guessing the above probably isn't the problem (still worth mentioning though). It almost sounds to me like you are caching older versions in some of those browsers. Try clearing the browser cache to see if that clears up the issue.
    Also, run your pages through the validator at http://validator.w3.org to get a list of html errors in your page. HTML errors can cause all kinds of funky behavior between browsers/versions. If it's still happening once you have your code cleaned up, post back and we can take a closer look.

  • Partially transparent rectangles on links and buttons in some browsers and phones

    When I create links in Acrobat Pro and specify them to be invisible, they display correctly in Reader and on browsers such as IE and Firefox, however, when viewed in Chrome or Safari the supposedly invisible rectangle appears as a partially transparent box.
    This also happens when viewed on mobile phones such as Samsung SII as a download.
    Also, while the links work on a mobile phone, the buttons do not.
    Any advice will be appreciated.
    Thanks
    Scott

    Chrome has its own PDF engine. And Safari is supposed to.

  • My MacBook not responding with all browsers and some applications!!!

    Hi !!!
    First sorry my english...
    My apple not respond i i need force to quiet... (Safari, firefox, chrome, some applications like players)
    I a few days my mac don't works like before i try to use chrome safari fireworks and is always the same in youtube or any website with flash content, and some applications too the same problem not respond, i was unistall and reinstall a lot o softwares i use clean app to remove the app complete and reinstall but don't works ... What i do? whatis this? My mac is all updated i use all lastest versions ... I don't understand why... Somebody can help me...
    Thank you for all news...
    bye!

    Hi,
    Click once on the hard drive icon. Then hold down the  key and tap i (  + i ).
    Capacity XX
    Available XX
    Used XX
    Post back with your values of XX.
    Regards.
    Ian.

  • How do I make a form compatible in all versions of Adobe Reader and various browsers?

    I have created a fillable form in Adobe Live Cycle Designer ES 8.2 and the form is available for download on our company's website. Many users are experiencing trouble with the fields not being able to be filled in. I have Adobe Acrobat 9 on my computer. I do know that people using Adobe Reader X have not been able to use the form. I also know that there are issues when viewing/using the form in web browsers. I really need some help as I have exhausted all avenues that I can think of. I have three forms that I created and some people experience problems with only one form, some people have trouble with two, etc. Any assistance would be greatly appreciated.

    There are three forms.
    Form #1
    http://www.kapsi-annarbor.org/npc/67th-Province-Council-Kappas-Registration-Form.pdf
    Form #2
    http://www.kapsi-annarbor.org/npc/67th-Province-Council-Silhouettes-Registration-Form.pdf
    Form #3
    http://www.kapsi-annarbor.org/npc/67th-Province-Council-KL-Registration-Form.pdf

  • I can not get Firefox to play music backgrounds on pages in browsers it works in IE and other browsers but not firefox, what HTML or Jave script do I need too use to make them work?

    I'm having a problem with firefox playing background music on some sites, it works with IE and other browsers but not with fire fox, what html or java script do I need to add to the pages so that they play the music?
    I develop my pages in Front Page and I know that the music only works in IE, so if someone can tell me how to correct this problem as it is important as I use fire fox as my main browser.
    I thank you in advance

    If a website uses BGSOUND then it will only work in IE.
    BGSOUND is not compatible with other browsers like Firefox.
    * http://kb.mozillazine.org/Background_music_does_not_play

  • Safari vs. Firefox and Other Browsers

    As already posted in these Safari forums, a number of people can not visit certain web pages using Safari under Leopard, while Firefox and similar browsers, and also Safari under Tiger, can. Some people can not visit certain pages at all, and some people can not visit certain pages only some of the time (i.e., "their" problems appear to be random). What seems to be clear, at least to me, is that it is an Apple problem, and not problem of our individual settings.
    I am posting this example hoping that someone from Apple is reading these forums. The example shows a MacWorld page as opened by Safari, and the same page opened with Firefox. Some well-meaning posters suggested that problem with opening certain pages could be attributed to Safari-unfriendly page coding, but I would not expect MacWorld to have that problem.

    Hi
    Initial release of an OS is going to have oddities appear. Seems this is another one in a growing list.
    Best way to get Apple's attention is either via a telephone call to Apple Care, if your machine is under warranty, or send a Bug Report to Apple via the Safari Menu.

  • Problems with instant play in some browsers

    This is not a problem with how Safari works, but I thought someone here might help me with a frustrating problem for which I can find no solution.
    I created several web pages with embedded QuickTime movies in mp4 format.  They are constructed so that the movies begin instantly to play as soon as the pages are accessed.  This has worked for the past couple of years regardless of which browser was used ( Mac versions of Safari, Firefox versions <4.x, Sunrise and others;  Windows versions of Internet Explorer and Firefox).
    It has recently been brought to my attention that this functionality is broken when updating to Firefox 4.x for Mac or when using Chrome for Mac.  Using either of these browsers to access the pages results in a static page with no video play.  The user must wait 1-2 minutes for the video to completely download and then it will automatically play.   Since the movies play fine on multiple browsers, including the new Firefox 4.x for Windows, it seems to me that the problem is not in how the movies were coded but rather in how the browsers handle the html code for the pages.
    The movies were edited in FCP, exported to Compressor, processed as mp4 streaming video and then embedded in web pages using Freeway Pro software with the "auto play" option enabled.
    Any ideas will be appreciated.
    John
    a sample page is:    http://lccut.org/videofiles/gospelvideo6high.html

    Here's the response I got from Freeway Pro support:
    Hi John
    There seems to be an issue at the moment with the way that Firefox 4 (and to a certain extent Chrome) handles QuickTime movies. If you go to the test page on our site at <http://users.softpress.com/keith/firefox4test/> you'll see that it is very erratic in what it shows and how it plays - but note that you may need to wait a while in between clicking on Firefox 4's Refresh button to see that the results change from one refresh to the next.
    Freeway is certainly publishing the code correctly, so this is does not appear to be a Freeway issue - though we would like to get to the source of the problem so we can advise customers on the best options to fix things. If you Google for "firefox4 quicktime movie problem" (without the quotes) you will see that this is not a problem specific to Freeway users.
    Leopard users report that Firefox 4 displays and plays QT movies fine, but Snow Leopard seems to have problems. This may be due to the way that QuickTime and Firefox 4 play together, as Leopard and Snow Leopard use slightly different versions of QuickTime.
    You should, however, be aware that non-Mac users will always need to download the QuickTime plug-in (which many PC users are reluctant to do, and some may not be allowed to by their IT department) for them to be able to see the movies play. The only truly universal method for offering video content on a web page is to use Flash .flv files and then use the FLV Player Action so that iPhone/iPad users will see an alternative (non-Flash) movie which is created by the Action. See the movie tutorial at <http://www.softpress.com/support/tutorials> (Episode 14) for details of how to set this up.
    As soon as we find a workaround for the problems with Firefox 4 and Chrome, we will put up an article on our KnowledgeBase at <http://www.softpress.com/kb/>. It might be that Firefox and Chrome will release a new update soon to fix the problem, in which case we will tell you which version you need to download an install.
    Best regards
    So the FW people insist that there software is encoded the pages properly and it is the fault of the newer Mac browsers causing the error.
    John

  • Documents from UCM not opening in some browsers

    Hi ,
    I am using the RIDC GET_FILE service to display the pdf in the WebCenter portal page. When the method is called the pdf document opens in Chrome browser in some machines but not in Firefox or other browsers. The file is returned as "application/octet-stream" and hence does not open as a pdf document.
    Following is the java code written to fetch the files
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.adf.share.ADFContext;
    import oracle.javatools.resourcebundle.BundleFactory;
    import oracle.security.xmlsec.samlp.ResponseType;
    import oracle.stellent.ridc.IdcClient;
    import oracle.stellent.ridc.IdcClientManager;
    import oracle.stellent.ridc.IdcClientException;
    import oracle.stellent.ridc.IdcClientManager;
    import oracle.stellent.ridc.IdcContext;
    import oracle.stellent.ridc.convenience.usersecurity.CacheId;
    import oracle.stellent.ridc.convenience.usersecurity.IUserSecurityCache;
    import oracle.stellent.ridc.convenience.usersecurity.impl.UserSGAcctAclCache;
    import oracle.stellent.ridc.convenience.usersecurity.impl.UserSecurityGroupsCache;
    import oracle.stellent.ridc.model.DataBinder;
    import oracle.stellent.ridc.model.DataObject;
    import oracle.stellent.ridc.model.DataResultSet;
    import oracle.stellent.ridc.protocol.ServiceResponse;
    import utils.system;
        public class getFile extends HttpServlet {
            private static final String CONTENT_TYPE = "text/html; charset=UTF-8";
            private static final long serialVersionUID = 1L;
            public void init(ServletConfig config) throws ServletException {
                super.init(config);
            String cid ;
        public  void doGet( HttpServletRequest request,
                            HttpServletResponse response) throws  ServletException ,IOException {
                       try {
                           cid = request.getParameter("cid");
                       } catch (Exception e) {
                           e.printStackTrace();
            try{
                IdcClientManager manager = new IdcClientManager();
                IdcClient idcClient = manager.createClient("idc://oa8054.us.oracle.com:7444");
                IdcContext userContext = new IdcContext("SADMIN", "SADMIN1");
                        System.out.println("got idc client");
                    // populate the binder with the parameters
                        DataBinder dataBinder = idcClient.createBinder();
                        dataBinder.putLocal("IdcService", "GET_FILE");
                        dataBinder.putLocal("dDocName",cid);
                        dataBinder.putLocal("RevisionSelectionMethod","Latest");
                        dataBinder.putLocal("Rendition","Web");  
                     dataBinder.putLocal("allowInterrupt","1");
                        ServiceResponse response1 = idcClient.sendRequest (userContext, dataBinder);
                    response1 = idcClient.sendRequest (userContext, dataBinder);
                         InputStream content = response1.getResponseStream() ;  
                        BufferedOutputStream  output = new BufferedOutputStream(response.getOutputStream(), 1024);             
                        byte[] buffer = new byte[1024]; 
                        int length;
                        while ((length = content.read(buffer)) > 0){ 
                        output.write(buffer, 0, length); 
                content.close(); 
                output.flush();
                        output.close();
                    catch (IdcClientException e) {
                                 e.printStackTrace();
    And the call to the servlet is  made on click of a link.
    Why doesn't the documents() open in some browsers while it does in some.Similarly i want to open docx and rtf files from UCM also using the same code without downloading.
    Please help.
    Thanks

    Hi.
    Try following sample code:
    Include cmfn tag library in your page
    xmlns:cmfn="http://xmlns.oracle.com/webcenter/content/functions"
    Use next EL Expression to get a Node url's (are the same methods as a Node in CP):
    #{cmfn:getNodeById(yourdDocName).url.downloadUrl
    #{cmfn:getNodeById(yourdDocName).url.renderUrl
    Sample:
    <af:goLink targetFrame="_blank" destination="#{cmfn:getNodeById('UCM676546').url.downloadUrl}"/>
    You'll need connection to UCM configured in your WebCenter Portal Application because it will ask for the current IDC connection configured.
    Regards.

Maybe you are looking for

  • SAP is not coming up after installing Java Add-in

    Hi, I have installed a Java Add-in for an existing ABAP system. At the stage of "start J2EE engine" it is throwing an error message saying that Java is not coming up after 1142 seconds. I checked config tool and it is working fine. I restarted SAP. A

  • NFS File Access problem

    Hello, I am having problems trying to "tail" an existing file. When the file is being written into, I can tail it without any problem. The problem rises when the file is already complete, and I try to open it. I tried to make a small demo program but

  • Process order conversion problem-sto

    Dear all, We are using STO scenerio  with strategy 20,  requirement comes in depots ,depots will be created sale order and then run the MRP in depots system will create PR against sale order in depots and pass the requirement to manufacturing plant 

  • How good is the stock thermal compound on the Rx9800?

    I can't overclock my card any higher than 410/370 w/o artifacting, yet when I touch the heatsink it is only mildly warm when I have a big fan on it.  This leads me to believe that the stock thermal compound b/w the heatesink and chip is crappy... per

  • Why won't this Best Buy PC App craplet uninstall?

    I don't appreciate the fact that when I try to uninstall this program as an administrator it remains on other accounts, and when I uninstall it from those it pops up again if I create a new user account. Why is this necessary and how do I get rid of